Archived
1
Fork 0

Fix spot shadows being used upside down

This commit is contained in:
redstrate 2020-08-19 17:19:20 -04:00
parent 56cfc02816
commit 5fa5ae32bf

View file

@ -231,7 +231,7 @@ void ShadowPass::render_spot(GFXCommandBuffer* command_buffer, Scene& scene, Obj
const Matrix4x4 realMVP = perspective * inverse(scene.get<Transform>(light_object).model);
scene.spotLightSpaces[last_spot_light] = perspective;
scene.spotLightSpaces[1][1] *= -1;
scene.spotLightSpaces[last_spot_light][1][1] *= -1;
scene.spotLightSpaces[last_spot_light] = scene.spotLightSpaces[last_spot_light] * inverse(scene.get<Transform>(light_object).model);
const auto frustum = normalize_frustum(extract_frustum(perspective * inverse(scene.get<Transform>(light_object).model)));