Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Vulkan2021
VkCV Framework
Commits
8c4e3d0f
Commit
8c4e3d0f
authored
3 years ago
by
Alexander Gauggel
Browse files
Options
Downloads
Patches
Plain Diff
[
#82
] Fix diffuse trace weights
parent
c771c7fa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!70
Resolve "Voxel cone tracing"
Pipeline
#25909
passed
3 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
projects/voxelization/resources/shaders/voxel.inc
+3
-3
3 additions, 3 deletions
projects/voxelization/resources/shaders/voxel.inc
with
3 additions
and
3 deletions
projects/voxelization/resources/shaders/voxel.inc
+
3
−
3
View file @
8c4e3d0f
...
...
@@ -124,7 +124,7 @@ vec3 voxelConeTrace(vec3 direction, vec3 startPosition, float coneAngleRadian, t
float
maxMip
=
float
(
log2
(
voxelResolution
));
float
maxStableMip
=
4
;
// must be the same as in Voxelization::voxelizeMeshes
maxMip
=
min
(
maxMip
,
maxStableMip
);
float
d
=
2
*
sqrt
(
3
*
pow
(
voxelSize
,
2
));
float
d
=
0.75
*
sqrt
(
3
*
pow
(
voxelSize
,
2
));
vec3
color
=
vec3
(
0
);
float
a
=
0
;
...
...
@@ -173,9 +173,9 @@ vec3 diffuseVoxelTraceHemisphere(mat3 toSurface, vec3 position, texture3D voxelT
float
theta
=
2
*
pi
/
i
;
float
phi
=
pi
/
3
;
// 60 degrees
vec3
sampleDirection
=
toSurface
*
vec3
(
cos
(
theta
)
*
sin
(
phi
),
sin
(
theta
)
*
sin
(
phi
),
cos
(
phi
));
float
weight
=
pi
*
(
3.
f
/
4.
f
)
/
i
;
float
weight
=
pi
*
(
3.
f
/
4.
f
)
/
6
;
vec3
trace
=
voxelConeTrace
(
sampleDirection
,
position
,
coneAngle
,
voxelTexture
,
voxelSampler
,
voxelInfo
);
diffuseTrace
+=
trace
;
diffuseTrace
+=
weight
*
trace
;
}
return
diffuseTrace
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment