Minor lighting improvements
This commit is contained in:
parent
da460af0b1
commit
163d413f9c
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user