diff options
Diffstat (limited to 'channel_3d_gl_interop.py')
-rw-r--r-- | channel_3d_gl_interop.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/channel_3d_gl_interop.py b/channel_3d_gl_interop.py index 535d595..3b93f86 100644 --- a/channel_3d_gl_interop.py +++ b/channel_3d_gl_interop.py @@ -17,7 +17,6 @@ from geometry.box import Box from geometry.cylinder import Cylinder from utility.projection import Projection, Rotation -from utility.opengl import MomentsVertexBuffer from utility.mouse import MouseDragMonitor, MouseScrollMonitor lattice_x = 256 @@ -135,8 +134,10 @@ fragment_shader = shaders.compileShader(""" in vec3 color; +layout(location = 0) out vec4 frag_color; + void main(){ - gl_FragColor = vec4(color.xyz, 0.0); + frag_color = vec4(color.xyz, 0.0); }""", GL_FRAGMENT_SHADER) lighting_vertex_shader = shaders.compileShader(""" @@ -211,11 +212,8 @@ primitives = list(map(lambda material: material[0], filter(lambda material: no lattice.apply_material_map(material_map) lattice.sync_material() -moments_vbo = MomentsVertexBuffer(lattice) - particles = Particles( lattice, - moments_vbo, numpy.mgrid[ 2*lattice.geometry.size_x//100:4*lattice.geometry.size_x//100:particle_count/10000j, lattice.geometry.size_y//16:15*lattice.geometry.size_y//16:100j, @@ -231,7 +229,7 @@ def on_display(): for i in range(0,updates_per_frame): lattice.evolve() - moments_vbo.collect() + lattice.update_moments() for i in range(0,updates_per_frame): particles.update(aging = True) |