Shadows go brrr

This commit is contained in:
2025-01-16 14:03:28 +01:00
parent 8a3bf57d7e
commit 071caf51b6
22 changed files with 4140 additions and 3269 deletions

View File

@@ -21,18 +21,25 @@ void Light::SetUp(const dae::Vector3 &up) {
}
dae::Matrix Light::GetViewMatrix() const {
auto test = dae::Matrix::CreateLookAtLH(m_Position, m_Target, m_Up);
return dae::Matrix::CreateLookAtLH(m_Position, m_Target, m_Up);
}
dae::Matrix Light::GetProjectionMatrix(float nearPlane, float farPlane, float size) const {
return dae::Matrix::CreateOrthographic(size, size, nearPlane, farPlane);
}
dae::Matrix Light::GetViewProjectionMatrix(float nearPlane, float farPlane, float size) const {
return GetViewMatrix() * GetProjectionMatrix(nearPlane, farPlane, size);
}
void Light::Update() {
// If the light position or target changes dynamically, this is where updates would be managed.
}
// m_ViewMatrix = dae::Matrix::CreateLookAtLH(m_Position, m_Target, m_Up);
// m_ProjectionMatrix = dae::Matrix::CreateOrthographic(size, size, nearPlane, farPlane);
}
dae::Vector3 Light::GetTarget() {
return m_Target;
}
dae::Vector3 Light::GetPosition() {
return m_Position;
}