@@ -114,22 +114,15 @@ void Cluster::initialize(int _argc, char* _argv[])
114114
115115 // Sponza
116116 // debug camera + lights
117-
118- // scene->camera.move({ -7.0f, 2.0f, 0.0f });
119- // scene->camera.rotate({ -45.0f, -90.0f });
120-
121- // scene->camera.lookAt({ -7.0f, 2.0f, 0.0f }, scene->center, glm::vec3(0.0f, 1.0f, 0.0f));
122-
117+ scene->camera .lookAt ({ -7 .0f , 2 .0f , 0 .0f }, scene->center , glm::vec3 (0 .0f , 1 .0f , 0 .0f ));
123118 scene->pointLights .lights = {
124119 // pos, power
125120 { { -5 .0f , 0 .3f , 0 .0f }, { 100 .0f , 100 .0f , 100 .0f } },
126121 { { 0 .0f , 0 .3f , 0 .0f }, { 100 .0f , 100 .0f , 100 .0f } },
127122 { { 5 .0f , 0 .3f , 0 .0f }, { 100 .0f , 100 .0f , 100 .0f } }
128123 };
129124 scene->pointLights .update ();
130- config->lights = 3 ;
131-
132- // generateLights(config->lights);
125+ config->lights = scene->pointLights .lights .size ();
133126
134127 frameNumber = 0 ;
135128}
@@ -413,7 +406,8 @@ void Cluster::generateLights(unsigned int count)
413406 for (size_t i = keep; i < count; i++)
414407 {
415408 glm::vec3 position = glm::vec3 (dist (mt), dist (mt), dist (mt)) * scale - (scale * 0 .5f );
416- position.y = glm::abs (position.y );
409+ // position += scene->center; // not Sponza
410+ position.y = glm::abs (position.y ); // Sponza
417411 glm::vec3 color = glm::vec3 (dist (mt), dist (mt), dist (mt));
418412 glm::vec3 power = color * (dist (mt) * (POWER_MAX - POWER_MIN) + POWER_MIN);
419413 lights[i] = {
0 commit comments