Disabling lighting for now

This commit is contained in:
Dynamitos committed 2025-04-13 14:41:42 +02:00
1 parent 54c5f9a5d7
commit 19007ac601
15 files changed
+86 -84

No files matched your search

+7 -13
View File
@@ -20,19 +20,13 @@ Viewport::~Viewport() {}
Matrix4 Viewport::getProjectionMatrix() const {
if (fieldOfView > 0.0f) {
// float h = 1.0 / tan(fieldOfView * 0.5);
// float w = h / (sizeX / static_cast<float>(sizeY));
// float zFar = 1000.0f;
// float zNear = 0.1f;
// float a = -zNear / (zFar - zNear);
// float b = (zNear * zFar) / (zFar - zNear);
// return Matrix4(
// w, 0, 0, 0,
// 0, -h, 0, 0,
// 0, 0, a, b,
// 0, 0, 1, 0
//);
return glm::perspective(fieldOfView, sizeX / static_cast<float>(sizeY), 0.1f, 1000.0f);
Matrix4 projectionMatrix = glm::perspective(fieldOfView, sizeX / static_cast<float>(sizeY), 0.1f, 1000.0f);
Matrix4 correctionMatrix = Matrix4(
1, 0, 0, 0,
0, -1, 0, 0,
0, 0, 1 / 2.f, 0,
0, 0, 1 / 2.f, 1);
return correctionMatrix * projectionMatrix;
} else {
return glm::ortho(0.0f, (float)sizeX, (float)sizeY, 0.0f);
}