Fixed multi spotlight shadows

This commit is contained in:
Antoine Pilote
2024-08-29 23:02:23 -04:00
parent cf7d236540
commit d42c2154cf
6 changed files with 600 additions and 574 deletions
+1 -1
View File
@@ -608,7 +608,7 @@ namespace Nuake
const Quat& globalRotation = glm::normalize(lightTransform.GetGlobalRotation());
const Matrix4& rotationMatrix = glm::mat4_cast(globalRotation);
shader->SetUniformMat4f("u_LightTransform", light.GetProjection() * lookatAt * spotLightTransform);
shader->SetUniformMat4f("u_LightTransform", light.GetProjection() * glm::inverse(lightTransform.GetGlobalTransform()));
for (auto e : meshView)
{
auto [transform, mesh, visibility] = meshView.get<TransformComponent, ModelComponent, VisibilityComponent>(e);