diff options
-rw-r--r-- | boltzgas/visual/view.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/boltzgas/visual/view.py b/boltzgas/visual/view.py index 7d7d2cc..891d0f2 100644 --- a/boltzgas/visual/view.py +++ b/boltzgas/visual/view.py @@ -22,6 +22,8 @@ particle_shader = ( vec2 tex_coord; } fs_in; + layout(location = 0) out vec4 frag_color; + void main(){ if (length(fs_in.tex_coord - vec2(0.5)) > 0.5) { discard; @@ -34,7 +36,7 @@ particle_shader = ( vec3 dir = normalize(camera_pos.xyz - fs_in.particle_pos); vec3 color = vec3(1.) * max(0., dot(dir, n)); - gl_FragColor = vec4(color.xyz, 1.0); + frag_color = vec4(color.xyz, 1.0); } """, """ @@ -102,8 +104,10 @@ decoration_shader = ( """ #version 430 + layout(location = 0) out vec4 frag_color; + void main(){ - gl_FragColor = vec4(1.); + frag_color = vec4(1.); } """, """ @@ -131,12 +135,14 @@ texture_shader = ( uniform float mixing; + layout(location = 0) out vec4 frag_color; + void main() { vec3 color = mix(texture(picture[0], tex_coord), texture(picture[1], tex_coord), mixing).xyz; if (color == vec3(0.,0.,0.)) { - gl_FragColor = vec4(color, 0.5); + frag_color = vec4(color, 0.5); } else { - gl_FragColor = vec4(color, 1.0); + frag_color = vec4(color, 1.0); } } """, |