improve VSM variance

main
Dominik Madarász 2024-08-30 14:26:44 +02:00
parent 320e653558
commit 19eeeb4696
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ float shadow_vsm(float distance, vec3 dir, int light_index) {
float variance = moments.y - (moments.x*moments.x); float variance = moments.y - (moments.x*moments.x);
//variance = max(variance, 0.000002); //variance = max(variance, 0.000002);
// variance = max(variance, 0.00002); // variance = max(variance, 0.00002);
variance = max(variance, 0.002); variance = max(variance, 0.0002);
float d = distance - moments.x; float d = distance - moments.x;
float p_max = variance / (variance + d*d); float p_max = variance / (variance + d*d);