aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-09-05 21:12:48 +0200
committerAdrian Kummerlaender2019-09-05 21:12:48 +0200
commit3b2d08e57a272f14c1385ebc458f0c2b431414b9 (patch)
treed5287d54833c064837db54b13ba5f1149388f248
parent703810267472cd4e4e936e37d36250dd6c7ad8ca (diff)
downloadsymlbm_playground-3b2d08e57a272f14c1385ebc458f0c2b431414b9.tar
symlbm_playground-3b2d08e57a272f14c1385ebc458f0c2b431414b9.tar.gz
symlbm_playground-3b2d08e57a272f14c1385ebc458f0c2b431414b9.tar.bz2
symlbm_playground-3b2d08e57a272f14c1385ebc458f0c2b431414b9.tar.lz
symlbm_playground-3b2d08e57a272f14c1385ebc458f0c2b431414b9.tar.xz
symlbm_playground-3b2d08e57a272f14c1385ebc458f0c2b431414b9.tar.zst
symlbm_playground-3b2d08e57a272f14c1385ebc458f0c2b431414b9.zip
Change particle color
-rw-r--r--channel_2d_gl_interop.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/channel_2d_gl_interop.py b/channel_2d_gl_interop.py
index a47d6c0..3ca623c 100644
--- a/channel_2d_gl_interop.py
+++ b/channel_2d_gl_interop.py
@@ -15,7 +15,7 @@ from OpenGL.GL import shaders
screen_x = 1920
screen_y = 1200
pixels_per_cell = 4
-updates_per_frame = 100
+updates_per_frame = 80
inflow = 0.01
relaxation_time = 0.52
@@ -114,7 +114,7 @@ void main() {
if (CellMoments[3] > 0.0) {
color = blueRedPalette(CellMoments[3] / 0.2);
} else {
- color = vec3(0.0,0.0,0.0);
+ color = vec3(0.4,0.4,0.4);
}
}""").substitute({
'size_x': screen_x//pixels_per_cell,
@@ -147,7 +147,7 @@ void main() {
1.
);
- color = vec3(0.0,0.8,0.0);
+ color = vec3(1.0);
}""").substitute({}), GL_VERTEX_SHADER)
shader_program = shaders.compileProgram(vertex_shader, fragment_shader)
@@ -198,7 +198,6 @@ def on_display():
glVertexPointer(4, GL_FLOAT, 0, lattice.memory.gl_moments)
- glDisable(GL_POINT_SMOOTH)
glPointSize(pixels_per_cell)
glDrawArrays(GL_POINTS, 0, lattice.geometry.volume)
@@ -210,7 +209,6 @@ def on_display():
glVertexPointer(4, GL_FLOAT, 0, particles.gl_particles)
- glEnable(GL_POINT_SMOOTH)
glPointSize(1)
glDrawArrays(GL_POINTS, 0, particles.count)