@@ -65,14 +65,6 @@ export default /* glsl */`
65
65
66
66
#endif
67
67
68
- /*
69
- #if NUM_RECT_AREA_LIGHTS > 0
70
-
71
- // TODO (abelnation): create uniforms for area light shadows
72
-
73
- #endif
74
- */
75
-
76
68
float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
77
69
78
70
float depth = unpackRGBAToDepth( texture2D( depths, uv ) );
@@ -95,25 +87,25 @@ export default /* glsl */`
95
87
96
88
}
97
89
98
- float VSMShadow ( sampler2D shadow, vec2 uv, float compare ){
90
+ float VSMShadow( sampler2D shadow, vec2 uv, float compare ) {
99
91
100
92
float occlusion = 1.0;
101
93
102
94
vec2 distribution = texture2DDistribution( shadow, uv );
103
95
104
96
#ifdef USE_REVERSED_DEPTH_BUFFER
105
97
106
- float hard_shadow = step( distribution.x, compare ); // Hard Shadow
98
+ float hard_shadow = step( distribution.x, compare );
107
99
108
100
#else
109
101
110
- float hard_shadow = step( compare , distribution.x ); // Hard Shadow
102
+ float hard_shadow = step( compare, distribution.x );
111
103
112
104
#endif
113
105
114
- if (hard_shadow != 1.0 ) {
106
+ if ( hard_shadow != 1.0 ) {
115
107
116
- float distance = compare - distribution.x ;
108
+ float distance = compare - distribution.x;
117
109
float variance = max( 0.00000, distribution.y * distribution.y );
118
110
float softness_probability = variance / (variance + distance * distance ); // Chebeyshevs inequality
119
111
softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); // 0.3 reduces light bleed
0 commit comments