nicer traces

This commit is contained in:
Andreas Ortmann 2016-09-29 09:36:57 +02:00
parent b15cc1304d
commit 11fb091b34
2 changed files with 4 additions and 14 deletions

View file

@ -18,7 +18,7 @@ void main()
//todo materials (& light color)
vec4 IAmbient = vec4(0.2f, 0.2f, 0.2f, 1.0f);
vec4 IDiffuse = vec4(1.0f, 1.0f, 1.0f, 0.0f) * max(dot(normal, lightvec), 0.0);
vec4 IDiffuse = vec4(color, 0.0f) * max(dot(normal, lightvec), 0.0);
//todo shininess
vec4 ISpecular = vec4(1.0f, 0.0f, 0.0f, 0.0f) * pow(max(dot(Reflected, Eye), 0.0), 3);

View file

@ -73,12 +73,12 @@ namespace endofthejedi {
renderShips();
renderMissiles();
renderTraces();
//glDisable(GL_DEPTH_TEST);
renderParticles();
//glEnable(GL_DEPTH_TEST);
renderTraces();
//glColor3f(1.0, 0.0, 0.0);
//glBegin(GL_QUADS);
//glVertex2f(-1.0f, -1.0f);
@ -249,16 +249,6 @@ namespace endofthejedi {
void RendererPolygon3d::renderTraces()
{
//std::vector<glm::vec2> points;
//points.push_back(glm::vec2(0.0, 0.0));
//points.push_back(glm::vec2(0.1, 0.02));
//points.push_back(glm::vec2(0.2, 0.05));
//points.push_back(glm::vec2(0.3, 0.1));
//points.push_back(glm::vec2(0.4, 0.2));
//points.push_back(glm::vec2(0.5, 0.4));
//points.push_back(glm::vec2(0.6, 0.8));
//points.push_back(glm::vec2(0.7, 1.0));
// revert to default
glUseProgram(0);
@ -269,7 +259,7 @@ namespace endofthejedi {
fade_out = 1.0 - (trace->age / trace->maxAge);
}
glColor3f(0.0, 0.3/fade_out, 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);