grab up axis from camera view mat

main
Dominik Madarász 2024-09-02 16:00:21 +02:00
parent 7cfbd8c9f8
commit 567afc66d2
1 changed files with 2 additions and 1 deletions

View File

@ -39,7 +39,8 @@ float shadow_vsm(float distance, vec3 dir, int light_index, float min_variance,
vec2 tex_size = textureSize(shadowMap[light_index], 0); vec2 tex_size = textureSize(shadowMap[light_index], 0);
vec3 texelSize = 1.0 / vec3(tex_size.xyy); vec3 texelSize = 1.0 / vec3(tex_size.xyy);
vec3 light_plane_normal = normalize(dir); vec3 light_plane_normal = normalize(dir);
vec3 tangent = normalize(cross(light_plane_normal, vec3(0.0, 1.0, 0.0))); vec3 up_axis = normalize(view[1].xyz);
vec3 tangent = normalize(cross(light_plane_normal, up_axis));
vec3 bitangent = cross(light_plane_normal, tangent); vec3 bitangent = cross(light_plane_normal, tangent);
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {