From dc69fab1565659241eb6f2f3576076872e86c45e Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 16 Dec 2018 23:46:32 +0100 Subject: Filter weird origin vertex The same thing occurs in computicle. I suspect some initialization / compute shader invokation problem. On the other hand: Why would that happen for the origin vertex and not e.g. the first or last vertex in memory? To be investigated further. --- src/shader/code/collide.glsl | 2 +- src/shader/code/geometry.glsl | 8 +++++--- src/shader/code/vertex.glsl | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'src/shader/code') diff --git a/src/shader/code/collide.glsl b/src/shader/code/collide.glsl index 936ca89..3982ad8 100644 --- a/src/shader/code/collide.glsl +++ b/src/shader/code/collide.glsl @@ -13,7 +13,7 @@ uniform uint nY; const uint q = 9; const float omega = 0.6; -const float displayAmplifier = 50.; +const float displayAmplifier = 1000.; float get(uint x, uint y, int i, int j) { return collideCells[q*nX*y + q*x + (i+1)*3 + j+1]; diff --git a/src/shader/code/geometry.glsl b/src/shader/code/geometry.glsl index 6701b41..6ecfc99 100644 --- a/src/shader/code/geometry.glsl +++ b/src/shader/code/geometry.glsl @@ -30,8 +30,10 @@ void emitSquareAt(vec4 position) { } void main() { - color = gs_in[0].color; - emitSquareAt(gl_in[0].gl_Position); - EndPrimitive(); + if ( gl_in[0].gl_Position.xyz != vec3(0.,0.,0.) ) { + color = gs_in[0].color; + emitSquareAt(gl_in[0].gl_Position); + EndPrimitive(); + } } )"; diff --git a/src/shader/code/vertex.glsl b/src/shader/code/vertex.glsl index 0727708..453b6fa 100644 --- a/src/shader/code/vertex.glsl +++ b/src/shader/code/vertex.glsl @@ -4,7 +4,7 @@ static const std::string VERTEX_SHADER_CODE = R"( layout (location=0) in vec3 VertexPosition; out VS_OUT { - vec3 color; + vec3 color; } vs_out; void main() { -- cgit v1.2.3