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
Merge requests
!70
Resolve "Voxel cone tracing"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Voxel cone tracing"
82-voxel-cone-tracing
into
develop
Overview
7
Commits
95
Pipelines
67
Changes
5
Merged
Ghost User
requested to merge
82-voxel-cone-tracing
into
develop
3 years ago
Overview
7
Commits
95
Pipelines
67
Changes
5
Expand
Closes
#82 (closed)
Edited
3 years ago
by
Tobias Frisch
0
0
Merge request reports
Viewing commit
88dcc1e7
Prev
Next
Show latest version
5 files
+
128
−
19
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
88dcc1e7
[
#82
] Separate shadow blur
· 88dcc1e7
Alexander Gauggel
authored
3 years ago
projects/voxelization/resources/shaders/shadowBlur.inc
0 → 100644
+
27
−
0
Options
#ifndef SHADOW_BLUR_INC
#define SHADOW_BLUR_INC
vec4
blurMomentShadowMap1D
(
ivec2
coord
,
ivec2
blurDirection
,
texture2D
srcTexture
,
sampler
depthSampler
){
int
blurRadius
=
9
;
int
minOffset
=
-
(
blurRadius
-
1
)
/
2
;
int
maxOffset
=
-
minOffset
;
vec2
pixelSize
=
vec2
(
1
)
/
textureSize
(
sampler2D
(
srcTexture
,
depthSampler
),
0
);
float
wTotal
=
0
;
vec4
moments
=
vec4
(
0
);
float
weights1D
[
4
]
=
{
0.5
,
0.25
,
0.125
,
0.0625
};
// gaussian
for
(
int
i
=
minOffset
;
i
<=
maxOffset
;
i
++
){
vec2
uv
=
(
coord
+
i
*
blurDirection
)
*
pixelSize
;
uv
+=
0.5
*
pixelSize
*
blurDirection
*
sign
(
i
);
// half pixel shift to take advantage of bilinear filtering
float
w
=
weights1D
[
abs
(
i
)];
moments
+=
w
*
texture
(
sampler2D
(
srcTexture
,
depthSampler
),
uv
);
wTotal
+=
w
;
}
return
moments
/
wTotal
;
}
#endif // #ifndef SHADOW_BLUR_INC
\ No newline at end of file
Loading