mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Made point shadows with shadow mapping an experimental shader
This commit is contained in:
parent
0bdc66b10a
commit
4d7526b920
@ -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
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user