go back to only white light

This commit is contained in:
2026-02-04 15:13:11 +01:00
parent 8b42f97594
commit 56f5b8a904
2 changed files with 3 additions and 13 deletions

View File

@@ -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);

View File

@@ -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)
}