Minor lighting improvements

This commit is contained in:
karl 2021-05-23 20:39:10 +02:00
parent da460af0b1
commit 163d413f9c
2 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ float get_shadow(vec4 fragPosLightSpace, vec3 normal) {
// We divide by this later, so make sure it's not exactly 0
// It seems like it should always be 0.0, but due to interpolation it's not -- it increases with the deviation!
// A larger second parameter to max() means more blur (but also more light bleeding)
float variance = max(moments.y - moments.x * moments.x, (currentDepth - closestDepth) * 0.05);
float variance = max(moments.y - moments.x * moments.x, (-0.01 + (currentDepth - closestDepth) * 0.7) * 0.1);
float d = projCoords.z - moments.x * 1.0;
// Use linear_step to prevent light bleeding

View File

@ -35,7 +35,7 @@ void main() {
vec3 N = normalize(mat3(model) * aNormal);
mat3 TBN = transpose(mat3(T, B, N));
vs_out.TangentLightDir = light_direction;
vs_out.TangentLightDir = TBN * -light_direction;
vs_out.TangentViewPos = TBN * viewPos;
vs_out.TangentFragPos = TBN * vs_out.FragPos;
}