diff options
Improvise interactive wall drawing
Internal wall cells need to be disabled to prevent delayed propagation
of the reflected populations.
This is just quickly thrown together - both the visual drawing and the backend's
material handling remain to be improved.
Diffstat (limited to 'src/shader/code/vertex.glsl')
-rw-r--r-- | src/shader/code/vertex.glsl | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/shader/code/vertex.glsl b/src/shader/code/vertex.glsl index 700a9b7..52d9403 100644 --- a/src/shader/code/vertex.glsl +++ b/src/shader/code/vertex.glsl @@ -10,7 +10,7 @@ out VS_OUT { uniform uint nX; uniform uint nY; -const float displayAmplifier = 5.0; +const float displayAmplifier = 50.0; float unit(float x) { return 1.0/(1.0+exp(-x)); @@ -42,10 +42,14 @@ void main() { 1. ); - vs_out.color = mix( - vec3(-0.5, 0.0, 1.0), - vec3( 1.0, 0.0, 0.0), - displayAmplifier * VertexPosition.z * norm(VertexPosition.xy) - ); + if ( VertexPosition.z < -1.0 ) { + vs_out.color = vec3(0.0, 0.0, 0.0); + } else { + vs_out.color = mix( + vec3(-0.5, 0.0, 1.0), + vec3( 1.0, 0.0, 0.0), + displayAmplifier * VertexPosition.z * norm(VertexPosition.xy) + ); + } } )"; |