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
0cbb4c29
Commit
0cbb4c29
authored
3 years ago
by
Alexander Gauggel
Browse files
Options
Downloads
Patches
Plain Diff
[
#82
] Reduce volumetric sample count to increase performance, add additional...
[
#82
] Reduce volumetric sample count to increase performance, add additional noise to hide artifacts
parent
609af6e8
No related branches found
No related tags found
1 merge request
!70
Resolve "Voxel cone tracing"
Pipeline
#26038
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/shader.frag
+6
-3
6 additions, 3 deletions
projects/voxelization/resources/shaders/shader.frag
with
6 additions
and
3 deletions
projects/voxelization/resources/shaders/shader.frag
+
6
−
3
View file @
0cbb4c29
...
...
@@ -82,19 +82,22 @@ float isotropicPhase(){
vec3
volumetricLighting
(
vec3
colorIn
,
vec3
V
,
vec3
pos
,
float
d
){
vec3
color
=
colorIn
;
int
sampleCount
=
48
;
int
sampleCount
=
20
;
float
stepSize
=
d
/
sampleCount
;
vec3
extinctionCoefficient
=
scatteringCoefficient
+
absorptionCoefficient
;
float
noiseScale
=
0
.
1
;
float
noise
=
2
*
pi
*
interleavedGradientNoise
(
gl_FragCoord
.
xy
);
vec2
shadowOffset
=
3
.
f
*
vec2
(
sin
(
noise
),
cos
(
noise
))
/
textureSize
(
sampler2D
(
shadowMap
,
shadowMapSampler
),
0
);
float
noiseScale
=
0
.
1
f
;
pos
+=
V
*
noiseScale
*
interleavedGradientNoise
(
gl_FragCoord
.
xy
);
for
(
int
i
=
0
;
i
<
sampleCount
;
i
++
){
vec3
samplePoint
=
pos
+
V
*
i
*
stepSize
;
float
phase
=
isotropicPhase
();
vec3
light
=
lightInfo
.
sunColor
*
lightInfo
.
sunStrength
;
float
shadow
=
shadowTest
(
samplePoint
,
lightInfo
,
shadowMap
,
shadowMapSampler
,
vec2
(
0
)
);
float
shadow
=
shadowTest
(
samplePoint
,
lightInfo
,
shadowMap
,
shadowMapSampler
,
shadowOffset
);
light
*=
shadow
;
light
+=
volumetricAmbientLight
;
...
...
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