From bb022bc4fc7a5656e741a2ab6a4d53237fd1e384 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 22 Feb 2013 19:16:42 +0900 Subject: [PATCH] Reverse the trail vertex order. That webgl app was designed for GL's default of CCW for front faces, but quake wants CW. Now the disable/enable of face culling isn't necessary. --- libs/video/renderer/glsl/glsl_particles.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libs/video/renderer/glsl/glsl_particles.c b/libs/video/renderer/glsl/glsl_particles.c index 6a4b59358..cc6df23eb 100644 --- a/libs/video/renderer/glsl/glsl_particles.c +++ b/libs/video/renderer/glsl/glsl_particles.c @@ -1745,20 +1745,20 @@ build_verts (trailvtx_t *v, GLushort *e) if (trail->num_points < 2) continue; point = trail->points; - set_vertex (v++, point, 1, bary + bind++, index/2); set_vertex (v++, point, -1, bary + bind++, index/2); + set_vertex (v++, point, 1, bary + bind++, index/2); bind %= 3; for (; point; point = point->next) { - set_vertex (v++, point, 1, bary + bind++, index/2 + 1); set_vertex (v++, point, -1, bary + bind++, index/2 + 1); + set_vertex (v++, point, 1, bary + bind++, index/2 + 1); bind %= 3; *e++ = index++; *e++ = index++; last_point = point; point->phys (point); } - set_vertex (v++, last_point, 1, bary + bind++, index/2 + 1); set_vertex (v++, last_point, -1, bary + bind++, index/2 + 1); + set_vertex (v++, last_point, 1, bary + bind++, index/2 + 1); index += 4; } } @@ -1803,8 +1803,6 @@ draw_trails (void) elements = alloca (num_verts * sizeof (GLushort)); build_verts (verts, elements); - qfeglDisable (GL_CULL_FACE); - qfeglUseProgram (trail.program); qfeglEnableVertexAttribArray (trail.last.location); qfeglEnableVertexAttribArray (trail.current.location); @@ -1845,8 +1843,6 @@ draw_trails (void) qfeglDisableVertexAttribArray (trail.barycentric.location); qfeglDisableVertexAttribArray (trail.texoff.location); - qfeglEnable (GL_CULL_FACE); - expire_trails (); }