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
33bc9a99
Commit
33bc9a99
authored
3 years ago
by
Alexander Gauggel
Browse files
Options
Downloads
Patches
Plain Diff
[
#82
] Add small ambient light factor to volumetric lighting
parent
8a60170c
No related branches found
No related tags found
1 merge request
!70
Resolve "Voxel cone tracing"
Pipeline
#26017
passed
3 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
projects/voxelization/resources/shaders/lightInfo.inc
+5
-4
5 additions, 4 deletions
projects/voxelization/resources/shaders/lightInfo.inc
projects/voxelization/resources/shaders/shader.frag
+3
-0
3 additions, 0 deletions
projects/voxelization/resources/shaders/shader.frag
with
8 additions
and
4 deletions
projects/voxelization/resources/shaders/lightInfo.inc
+
5
−
4
View file @
33bc9a99
...
@@ -2,10 +2,11 @@
...
@@ -2,10 +2,11 @@
#define LIGHT_INFO_INC
#define LIGHT_INFO_INC
struct
LightInfo
{
struct
LightInfo
{
vec3
L
;
float
padding
;
vec3
L
;
vec3
sunColor
;
float
padding
;
float
sunStrength
;
vec3
sunColor
;
mat4
lightMatrix
;
float
sunStrength
;
mat4
lightMatrix
;
};
};
#endif // #ifndef LIGHT_INFO_INC
#endif // #ifndef LIGHT_INFO_INC
\ No newline at end of file
This diff is collapsed.
Click to expand it.
projects/voxelization/resources/shaders/shader.frag
+
3
−
0
View file @
33bc9a99
...
@@ -81,6 +81,7 @@ vec3 volumetricLighting(vec3 colorIn, vec3 V, vec3 pos, float d){
...
@@ -81,6 +81,7 @@ vec3 volumetricLighting(vec3 colorIn, vec3 V, vec3 pos, float d){
vec3
scatteringCoefficient
=
vec3
(
0
.
005
);
vec3
scatteringCoefficient
=
vec3
(
0
.
005
);
vec3
absorptionCoefficient
=
vec3
(
0
.
01
);
vec3
absorptionCoefficient
=
vec3
(
0
.
01
);
vec3
extinctionCoefficient
=
scatteringCoefficient
+
absorptionCoefficient
;
vec3
extinctionCoefficient
=
scatteringCoefficient
+
absorptionCoefficient
;
vec3
ambientLight
=
vec3
(
0
.
2
);
float
noiseScale
=
0
.
1
;
float
noiseScale
=
0
.
1
;
pos
+=
V
*
noiseScale
*
interleavedGradientNoise
(
gl_FragCoord
.
xy
);
pos
+=
V
*
noiseScale
*
interleavedGradientNoise
(
gl_FragCoord
.
xy
);
...
@@ -91,6 +92,8 @@ vec3 volumetricLighting(vec3 colorIn, vec3 V, vec3 pos, float d){
...
@@ -91,6 +92,8 @@ vec3 volumetricLighting(vec3 colorIn, vec3 V, vec3 pos, float d){
vec3
light
=
lightInfo
.
sunColor
*
lightInfo
.
sunStrength
;
vec3
light
=
lightInfo
.
sunColor
*
lightInfo
.
sunStrength
;
float
shadow
=
shadowTest
(
samplePoint
,
lightInfo
,
shadowMap
,
shadowMapSampler
,
vec2
(
0
));
float
shadow
=
shadowTest
(
samplePoint
,
lightInfo
,
shadowMap
,
shadowMapSampler
,
vec2
(
0
));
light
*=
shadow
;
light
*=
shadow
;
light
+=
ambientLight
;
color
+=
phase
*
light
*
scatteringCoefficient
*
stepSize
;
color
+=
phase
*
light
*
scatteringCoefficient
*
stepSize
;
color
*=
exp
(
-
stepSize
*
extinctionCoefficient
);
color
*=
exp
(
-
stepSize
*
extinctionCoefficient
);
}
}
...
...
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