Skip to content
Snippets Groups Projects
Commit 80afaafa authored by Sindre Eiklid's avatar Sindre Eiklid
Browse files

Added better light colors

parent 4725afa8
No related branches found
No related tags found
No related merge requests found
...@@ -25,23 +25,17 @@ void LightCycle::update() { ...@@ -25,23 +25,17 @@ void LightCycle::update() {
g_mapData->lightDirection = glm::vec3(1.04f, 1.f, 0.f); g_mapData->lightDirection = glm::vec3(1.04f, 1.f, 0.f);
} else g_mapData->lightDirection = glm::vec3(((float)(hour) / 24.f) * hour, 1.f, 0.f); } else g_mapData->lightDirection = glm::vec3(((float)(hour) / 24.f) * hour, 1.f, 0.f);
//set color to the background according to the time //set color to the background according to the time
if(hour <= 5) { if(hour <= 6) {
//set night color //set night color
g_mapData->skyColor = glm::vec3(0.01f, 0.01f, 0.14f); g_mapData->lightColor = glm::vec3(0.5f, 0.5f, 0.5f);
g_mapData->lightColor = glm::vec3(1.f, 1.f, 1.f);
} else if(hour <= 7) {
//set mild night color
g_mapData->skyColor = glm::vec3(0.01f, 0.01f, 0.44f);
g_mapData->lightColor = glm::vec3(1.f, 0.9f, 0.65f);
} else if(hour <= 10) { } else if(hour <= 10) {
//set morning/evening color //set dusk/dawn color
g_mapData->skyColor = glm::vec3(0.f, 0.75f, 1.f);
g_mapData->lightColor = glm::vec3(1.f, 0.9f, 0.65f); g_mapData->lightColor = glm::vec3(1.f, 0.9f, 0.65f);
} else { } else {
//set day color //set day color
g_mapData->skyColor = glm::vec3(0.7f, 1.0f, 1.0f);
g_mapData->lightColor = glm::vec3(1.f, 1.f, 1.f); g_mapData->lightColor = glm::vec3(1.f, 1.f, 1.f);
} }
g_mapData->skyColor = glm::vec3(0.01f, 0.01f, (float)(hour) / 12.f);
//either increment or decrement according to cycle //either increment or decrement according to cycle
if(increment) { if(increment) {
hour++; hour++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment