aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2018-12-16 23:46:32 +0100
committerAdrian Kummerlaender2018-12-16 23:46:32 +0100
commitdc69fab1565659241eb6f2f3576076872e86c45e (patch)
tree43fc7857250637261b45e6d17ba025b4f60b719c
parentce334547f0f0560386ca8b97f354d83da68019a5 (diff)
downloadcompustream-dc69fab1565659241eb6f2f3576076872e86c45e.tar
compustream-dc69fab1565659241eb6f2f3576076872e86c45e.tar.gz
compustream-dc69fab1565659241eb6f2f3576076872e86c45e.tar.bz2
compustream-dc69fab1565659241eb6f2f3576076872e86c45e.tar.lz
compustream-dc69fab1565659241eb6f2f3576076872e86c45e.tar.xz
compustream-dc69fab1565659241eb6f2f3576076872e86c45e.tar.zst
compustream-dc69fab1565659241eb6f2f3576076872e86c45e.zip
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.
-rw-r--r--src/shader/code/collide.glsl2
-rw-r--r--src/shader/code/geometry.glsl8
-rw-r--r--src/shader/code/vertex.glsl2
3 files changed, 7 insertions, 5 deletions
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() {