From f512528d51eb59dea1eb8ddb2c96c96f3fd583b4 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 6 Feb 2022 22:42:30 +0100 Subject: Replace deprecated gl_FragColor --- boltzgas/visual/view.py | 14 ++++++++++---- 1 file 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); } } """, -- cgit v1.2.3