shadow_sampling.wgsl
Name | Type | Value |
---|---|---|
SPOT_SHADOW_TEXEL_SIZE
#
![]() |
f32
![]() |
0.0134277345 |
POINT_SHADOW_SCALE
#
![]() |
f32
![]() |
0.003 |
POINT_SHADOW_TEMPORAL_OFFSET_SCALE
#
![]() |
f32
![]() |
0.5 |
Parameter | Type |
---|---|
light_local |
vec2<f32>
![]() |
depth |
f32
![]() |
array_index |
i32
![]() |
Parameter | Type |
---|---|
light_local |
vec2<f32>
![]() |
depth |
f32
![]() |
array_index |
i32
![]() |
Parameter | Type |
---|---|
light_local |
vec2<f32>
![]() |
depth |
f32
![]() |
array_index |
i32
![]() |
Parameter | Type |
---|---|
min1 |
f32
![]() |
max1 |
f32
![]() |
min2 |
f32
![]() |
max2 |
f32
![]() |
value |
f32
![]() |
Parameter | Type |
---|---|
scale |
vec2<f32>
![]() |
temporal |
bool
![]() |
Parameter | Type |
---|---|
texel_size |
f32
![]() |
blur_size |
f32
![]() |
Parameter | Type |
---|---|
light_local |
vec2<f32>
![]() |
depth |
f32
![]() |
array_index |
i32
![]() |
texel_size |
f32
![]() |
blur_size |
f32
![]() |
temporal |
bool
![]() |
search_size
is the size of the search region in texels.Parameter | Type |
---|---|
light_local |
vec2<f32>
![]() |
depth |
f32
![]() |
array_index |
i32
![]() |
texel_size |
f32
![]() |
search_size |
f32
![]() |
Parameter | Type |
---|---|
light_local |
vec2<f32>
![]() |
depth |
f32
![]() |
array_index |
i32
![]() |
texel_size |
f32
![]() |
Parameter | Type |
---|---|
light_local |
vec2<f32>
![]() |
depth |
f32
![]() |
array_index |
i32
![]() |
texel_size |
f32
![]() |
light_size |
f32
![]() |
shadows::fetch_point_shadow
,
we must use the Level variant of textureSampleCompare to avoid undefined
behavior due to some of the fragments in a quad (2x2 fragments) being
processed not being sampled, and this messing with mip-mapping functionality.
The shadow maps have no mipmaps so Level just samples from LOD 0.Parameter | Type |
---|---|
light_local |
vec3<f32>
![]() |
depth |
f32
![]() |
light_id |
u32
![]() |
Parameter | Type |
---|---|
light_local |
vec3<f32>
![]() |
depth |
f32
![]() |
light_id |
u32
![]() |
Parameter | Type |
---|---|
position |
vec2<f32>
![]() |
coeff |
f32
![]() |
x_basis |
vec3<f32>
![]() |
y_basis |
vec3<f32>
![]() |
light_local |
vec3<f32>
![]() |
depth |
f32
![]() |
light_id |
u32
![]() |
x_basis`, `y_basis`, and `light_local
form an orthonormal basis over which
the blocker search happens.Parameter | Type |
---|---|
position |
vec2<f32>
![]() |
x_basis |
vec3<f32>
![]() |
y_basis |
vec3<f32>
![]() |
light_local |
vec3<f32>
![]() |
depth |
f32
![]() |
light_id |
u32
![]() |
Parameter | Type |
---|---|
light_local |
vec3<f32>
![]() |
depth |
f32
![]() |
scale |
f32
![]() |
distance_to_light |
f32
![]() |
light_id |
u32
![]() |
Parameter | Type |
---|---|
light_local |
vec3<f32>
![]() |
depth |
f32
![]() |
scale |
f32
![]() |
distance_to_light |
f32
![]() |
light_id |
u32
![]() |
temporal |
bool
![]() |
Parameter | Type |
---|---|
light_local |
vec3<f32>
![]() |
distance_to_light |
f32
![]() |
depth |
f32
![]() |
light_id |
u32
![]() |
sample_shadow_cubemap_gaussian
, but uses linear
sampling instead of percentage-closer filtering.
The scale
parameter represents the size of the light.Parameter | Type |
---|---|
light_local |
vec3<f32>
![]() |
depth |
f32
![]() |
scale |
f32
![]() |
distance_to_light |
f32
![]() |
light_id |
u32
![]() |
Parameter | Type |
---|---|
light_local |
vec3<f32>
![]() |
distance_to_light |
f32
![]() |
depth |
f32
![]() |
light_id |
u32
![]() |
light_size |
f32
![]() |