aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.cc4
-rw-r--r--src/shader/code/vertex.glsl11
2 files changed, 7 insertions, 8 deletions
diff --git a/src/main.cc b/src/main.cc
index c19b32d..3048979 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -23,8 +23,8 @@
#include "timer.h"
-constexpr GLuint nX = 512;
-constexpr GLuint nY = 512;
+constexpr GLuint nX = 256;
+constexpr GLuint nY = 256;
constexpr int lups = 50; // max lattice updates per second
diff --git a/src/shader/code/vertex.glsl b/src/shader/code/vertex.glsl
index 1051d8f..700a9b7 100644
--- a/src/shader/code/vertex.glsl
+++ b/src/shader/code/vertex.glsl
@@ -24,17 +24,12 @@ float norm(vec2 v) {
return sqrt(sq(v.x)+sq(v.y));
}
-vec3 getColor(float x) {
- return x*vec3(1.0,0.0,0.0) + (1-x)*vec3(-0.5,0.0,1.0);
-}
-
vec2 fluidVertexAtIndex(uint i) {
const float y = floor(float(i) / float(nX));
return vec2(
i - nX*y,
y
);
-
}
void main() {
@@ -47,6 +42,10 @@ void main() {
1.
);
- vs_out.color = getColor(unit(displayAmplifier * VertexPosition.z * norm(VertexPosition.xy)));
+ vs_out.color = mix(
+ vec3(-0.5, 0.0, 1.0),
+ vec3( 1.0, 0.0, 0.0),
+ displayAmplifier * VertexPosition.z * norm(VertexPosition.xy)
+ );
}
)";