From f5fd73fd1d723581afcc04578fd5c8e0084e4b39 Mon Sep 17 00:00:00 2001 From: Faerbit Date: Sun, 1 Mar 2015 18:19:19 +0100 Subject: [PATCH] Added another two render calls to further increase the number of vertices of the flame. --- data/shader/flame.gsh | 22 +++++++++++++++------- graphics.cc | 6 ++++++ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/data/shader/flame.gsh b/data/shader/flame.gsh index fe4cd44..53a61ce 100644 --- a/data/shader/flame.gsh +++ b/data/shader/flame.gsh @@ -3,6 +3,7 @@ uniform mat4 viewProjectionMatrix; uniform float time; uniform bool bottom; +uniform bool left; layout(points) in; layout(triangle_strip, max_vertices = 256) out; @@ -14,7 +15,7 @@ const float sin_p2 = 2; const float ex_p1 = 1.093; const float ex_p2 = 1.9996; const float begin = 0; -const float end = 2.3; +const float end = 2.5; float radiusFunction(float x) { if (x < transition_point) { @@ -38,14 +39,21 @@ void main() { i = (end-begin)/2.0; render_end = end; } - for (i; isetUniform("viewProjectionMatrix", lightingViewProjectionMatrix); flameShader->setUniform("time", (float) time); flameShader->setUniform("bottom", true); + flameShader->setUniform("left", true); + flame_positions->render(); + flameShader->setUniform("left", false); flame_positions->render(); flameShader->setUniform("bottom", false); + flameShader->setUniform("left", true); + flame_positions->render(); + flameShader->setUniform("left", false); flame_positions->render(); glDisable(GL_CULL_FACE);