From 56f5b8a90467b07613e6b02e9613a3506bd5feb7 Mon Sep 17 00:00:00 2001 From: Fredrik Robertsen Date: Wed, 4 Feb 2026 15:13:11 +0100 Subject: [PATCH] go back to only white light --- res/shaders/simple.frag | 2 +- src/gamelogic.cpp | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/res/shaders/simple.frag b/res/shaders/simple.frag index 0bb5f4d..73ab172 100644 --- a/res/shaders/simple.frag +++ b/res/shaders/simple.frag @@ -45,7 +45,7 @@ void main() // start with ambience vec3 result = ambientStrength * baseColor; - for (int i = 0; i < 3; i++) { + for (int i = 0; i < 1; i++) { vec3 toLight = lights[i].position - worldPosition; vec3 L = normalize(toLight); float dist = length(toLight); diff --git a/src/gamelogic.cpp b/src/gamelogic.cpp index 54dc46b..c27b823 100644 --- a/src/gamelogic.cpp +++ b/src/gamelogic.cpp @@ -146,26 +146,16 @@ void initGame(GLFWwindow* window, CommandLineOptions gameOptions) { ballNode->vertexArrayObjectID = ballVAO; ballNode->VAOIndexCount = ballMesh.indices.size(); - for (int i = 0; i < 3; i++) { auto* light = new SceneNode(); light->nodeType = POINT_LIGHT; - light->lightIdx = i; + light->lightIdx = 0; lightNodes.push_back(light); - } auto* ceilingLight = lightNodes[0]; - auto* padLight = lightNodes[1]; - auto* ballLight = lightNodes[2]; boxNode->children.push_back(ceilingLight); ceilingLight->position = { 0, 10, 0 }; - padNode->children.push_back(padLight); - padLight->position = { 0, 10, 0 }; - - ballNode->children.push_back(ballLight); - ballLight->position = { 0, 0, 0 }; - std::cout << "loading textures..." << std::endl; textureShader = new Gloom::Shader(); @@ -326,7 +316,7 @@ void updateFrame(GLFWwindow* window) { l.position = node->worldPosition; switch (node->lightIdx) { - case 0: l.color = glm::vec3(1, 0, 0); break; // red (ceiling) + case 0: l.color = glm::vec3(1, 1, 1); break; // red (ceiling) case 1: l.color = glm::vec3(0, 1, 0); break; // green (pad) case 2: l.color = glm::vec3(0, 0, 1); break; // blue (ball) }