merge + trace fade out fix

This commit is contained in:
Andreas Ortmann 2016-09-29 11:43:00 +02:00
commit 26e1d4fd19
4 changed files with 6 additions and 5 deletions

View file

@ -75,7 +75,8 @@ namespace endofthejedi {
glm::vec3 c = glm::vec3(1.0, 1.0, 0.5);
glUniform3f(m_shader.location("lightColor"), c.x, c.y, c.z);
glm::vec3 p = glm::vec3(1.0, 0.0, 0.0);
//glm::vec3 p = glm::vec3(1.0, 0.0, 0.0);
glm::vec3 p = glm::vec3(0.5f, 0.5f, -4.0f);
glUniform3f(m_shader.location("lightPosition"), p.x, p.y, p.z);
renderPlanets();
@ -161,6 +162,7 @@ namespace endofthejedi {
glm::vec3 c = planet->getColor();
glUniform3f(m_shader.location("materialColor"), c.x, c.y, c.z);
glUniform3f(m_shader.location("color"), c.x, c.y, c.z);
m_planetModel->render(m_shader);
}
@ -268,7 +270,7 @@ namespace endofthejedi {
fade_out = 1.0 - (trace->age / trace->maxAge);
}
glColor3f(0.0, 0.0, 1.0/fade_out);
glColor3f(0.0, 0.0, 1.0*fade_out);
glBegin(GL_LINE_STRIP);
for (const game::Trace::TracePoint &tp : trace->points) {
glVertex2f(tp.position.x, tp.position.y);