@@ -98,12 +98,12 @@ subroutine(srtLightRadiance) vec3 lightRadianceAreaSphere(
9898
9999 vec3 positionToLightSource = lightPosition - pos;
100100 float distanceToLight = length (positionToLightSource);
101- float attenuation = pow (clamp (1.0 - (distanceToLight / max (lightRadius, 0.001 )), 0.0 , 1.0 ), 4.0 ) * lightEnergy;
101+ float attenuation = pow (clamp (1.0 - (distanceToLight / max (lightRadius, 0.00001 )), 0.0 , 1.0 ), 4.0 ) * lightEnergy;
102102
103103 vec3 Lpt = normalize (positionToLightSource);
104104
105105 vec3 centerToRay = dot (positionToLightSource, R) * R - positionToLightSource;
106- vec3 closestPoint = positionToLightSource + centerToRay * clamp (lightAreaRadius / max (length (centerToRay), 0.001 ), 0.0 , 1.0 );
106+ vec3 closestPoint = positionToLightSource + centerToRay * clamp (lightAreaRadius / max (length (centerToRay), 0.00001 ), 0.0 , 1.0 );
107107 vec3 L = normalize (closestPoint);
108108
109109 float NL = max (dot (N, Lpt), 0.0 );
@@ -122,15 +122,15 @@ subroutine(srtLightRadiance) vec3 lightRadianceAreaSphere(
122122 // fss90 used to "flatten" retroreflection based on roughness
123123 float FL = schlickFresnel(NL);
124124 float FV = schlickFresnel(NE);
125- float fss90 = LH * LH * max (roughness, 0.001 );
125+ float fss90 = LH * LH * max (roughness, 0.00001 );
126126 float fss = mix (1.0 , fss90, FL) * mix (1.0 , fss90, FV);
127127 float ss = 1.25 * (fss * (1.0 / max (NL + NE, 0.1 ) - 0.5 ) + 0.5 );
128128
129129 vec3 diffuse = invPI * albedo * mix (kD * NL * occlusion, vec3 (ss), subsurface) * (1.0 - metallic);
130130
131131 vec3 numerator = NDF * G * F;
132132 float denominator = 4.0 * max (dot (N, E), 0.0 ) * NL;
133- vec3 specular = numerator / max (denominator, 0.001 );
133+ vec3 specular = numerator / max (denominator, 0.00001 );
134134
135135 vec3 lightColorLinear = toLinear(lightColor.rgb);
136136
@@ -168,7 +168,7 @@ subroutine(srtLightRadiance) vec3 lightRadianceAreaTube(
168168
169169 vec3 positionToLightSource = (lightPosition + lightPosition2) * 0.5 - pos;
170170 float distanceToLight = length (positionToLightSource);
171- float attenuation = pow (clamp (1.0 - (distanceToLight / max (lightRadius, 0.001 )), 0.0 , 1.0 ), 4.0 ) * lightEnergy;
171+ float attenuation = pow (clamp (1.0 - (distanceToLight / max (lightRadius, 0.00001 )), 0.0 , 1.0 ), 4.0 ) * lightEnergy;
172172
173173 vec3 Lpt = normalize (positionToLightSource);
174174
@@ -188,15 +188,15 @@ subroutine(srtLightRadiance) vec3 lightRadianceAreaTube(
188188 // fss90 used to "flatten" retroreflection based on roughness
189189 float FL = schlickFresnel(NL);
190190 float FV = schlickFresnel(NE);
191- float fss90 = LH * LH * max (roughness, 0.001 );
191+ float fss90 = LH * LH * max (roughness, 0.00001 );
192192 float fss = mix (1.0 , fss90, FL) * mix (1.0 , fss90, FV);
193193 float ss = 1.25 * (fss * (1.0 / max (NL + NE, 0.1 ) - 0.5 ) + 0.5 );
194194
195195 vec3 diffuse = invPI * albedo * mix (kD * NL * occlusion, vec3 (ss), subsurface) * (1.0 - metallic);
196196
197197 vec3 numerator = NDF * G * F;
198198 float denominator = 4.0 * max (dot (N, E), 0.0 ) * NL;
199- vec3 specular = numerator / max (denominator, 0.001 );
199+ vec3 specular = numerator / max (denominator, 0.00001 );
200200
201201 vec3 incomingLight = toLinear(lightColor.rgb) * attenuation;
202202 vec3 radiance = (diffuse * lightDiffuse + specular * lightSpecular * NL) * incomingLight;
@@ -221,7 +221,7 @@ subroutine(srtLightRadiance) vec3 lightRadianceSpot(
221221 vec3 positionToLightSource = lightPosition - pos;
222222 float distanceToLight = length (positionToLightSource);
223223 vec3 L = normalize (positionToLightSource);
224- float attenuation = pow (clamp (1.0 - (distanceToLight / max (lightRadius, 0.001 )), 0.0 , 1.0 ), 2.0 ) * lightEnergy;
224+ float attenuation = pow (clamp (1.0 - (distanceToLight / max (lightRadius, 0.00001 )), 0.0 , 1.0 ), 2.0 ) * lightEnergy;
225225
226226 float spotCos = clamp (dot (L, normalize (lightSpotDirection)), 0.0 , 1.0 );
227227 float spotValue = smoothstep (lightSpotCosCutoff, lightSpotCosInnerCutoff, spotCos);
@@ -243,15 +243,15 @@ subroutine(srtLightRadiance) vec3 lightRadianceSpot(
243243 // fss90 used to "flatten" retroreflection based on roughness
244244 float FL = schlickFresnel(NL);
245245 float FV = schlickFresnel(NE);
246- float fss90 = LH * LH * max (roughness, 0.001 );
246+ float fss90 = LH * LH * max (roughness, 0.00001 );
247247 float fss = mix (1.0 , fss90, FL) * mix (1.0 , fss90, FV);
248248 float ss = 1.25 * (fss * (1.0 / max (NL + NE, 0.1 ) - 0.5 ) + 0.5 );
249249
250250 vec3 diffuse = invPI * albedo * mix (kD * NL * occlusion, vec3 (ss), subsurface) * (1.0 - metallic);
251251
252252 vec3 numerator = NDF * G * F;
253253 float denominator = 4.0 * max (dot (N, E), 0.0 ) * NL;
254- vec3 specular = numerator / max (denominator, 0.001 );
254+ vec3 specular = numerator / max (denominator, 0.00001 );
255255
256256 vec3 incomingLight = toLinear(lightColor.rgb) * attenuation;
257257 vec3 radiance = (diffuse * lightDiffuse + specular * lightSpecular * NL) * incomingLight;
@@ -286,7 +286,7 @@ subroutine(srtShadow) float shadowMapDualParaboloid(in vec3 worldPos)
286286 vec2 uv = dir.xy / (1.0 + abs (dir.z));
287287 uv = uv * 0.5 + 0.5 ;
288288 float layer = 1.0 - float (dir.z >= 0.0 );
289- float z = distanceToLight / max (0.001 , lightRadius) - bias;
289+ float z = distanceToLight / max (0.00001 , lightRadius) - bias;
290290 float shadow = texture(shadowTextureArray, vec4 (uv, layer, z));
291291 return shadow;
292292}
0 commit comments