Browse Source

remove scene light dependancy on entity array

master
cinnaboot 8 years ago
parent
commit
d045374f9f
  1. 14
      src/renderer.cpp

14
src/renderer.cpp

@ -256,15 +256,11 @@ createScene(std::vector<hex_info>* hexes, Entity* entities, uint32 entity_count)
// lights // lights
// TODO: load light properties from scene/level files // TODO: load light properties from scene/level files
g_test_light.light_ID = glGetUniformLocation(g_default_shader.program_id, "light_position");
//g_test_light.light_ID = glGetUniformLocation(g_entity_render_group.program_id, "light_position"); g_test_light.position = glm::vec3(800, 300, 400); // above center of hexgrid
if (entities[0].ren_group != nullptr) { g_test_light.direction = glm::vec3(0, 0, 0) - g_test_light.position; // back towards test entity
g_test_light.light_ID = glGetUniformLocation(entities[0].ren_group->shader.program_id, "light_position"); g_test_light.color = glm::vec3(1.f, 1.f, 1.f);
g_test_light.position = glm::vec3(800, 300, 400); // above center of hexgrid g_test_light.intensity = 1.f;
g_test_light.direction = glm::vec3(0, 0, 0) - g_test_light.position; // back towards test entity
g_test_light.color = glm::vec3(1.f, 1.f, 1.f);
g_test_light.intensity = 1.f;
}
return true; return true;
} }

Loading…
Cancel
Save