Made point shadows with shadow mapping an experimental shader

This commit is contained in:
Joshua Barretto 2023-01-12 15:39:11 +00:00
parent 0bdc66b10a
commit 4d7526b920
2 changed files with 5 additions and 3 deletions

View File

@ -94,9 +94,7 @@ vec3 light_at(vec3 wpos, vec3 wnorm) {
float shadow_at(vec3 wpos, vec3 wnorm) {
float shadow = 1.0;
#if (SHADOW_MODE == SHADOW_MODE_NONE)
return shadow;
#elif (SHADOW_MODE == SHADOW_MODE_CHEAP || SHADOW_MODE == SHADOW_MODE_MAP)
#if (SHADOW_MODE == SHADOW_MODE_CHEAP || (SHADOW_MODE == SHADOW_MODE_MAP && defined(EXPERIMENTAL_POINTSHADOWSWITHSHADOWMAPPING)))
for (uint i = 0u; i < light_shadow_count.y; i ++) {
// Only access the array once
@ -121,6 +119,8 @@ float shadow_at(vec3 wpos, vec3 wnorm) {
// NOTE: Squared to compenate for prior saturation.
return min(shadow, 1.0);
// return min(shadow * shadow, 1.0);
#else
return shadow;
#endif
}

View File

@ -534,4 +534,6 @@ pub enum ExperimentalShader {
/// Rather than fading out screen-space reflections at view space borders,
/// smear screen space to cover the reflection vector.
SmearReflections,
/// Apply the point shadows from cheap shadows on top of shadow mapping.
PointShadowsWithShadowMapping,
}