From 630d107c91a83f1c6294845de6ff3f4cd56488b6 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 6 Feb 2022 22:48:13 +0100 Subject: Replace deprecated gl_FragColor --- interacticle/visual/view.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/interacticle/visual/view.py b/interacticle/visual/view.py index 14ff487..92811ae 100644 --- a/interacticle/visual/view.py +++ b/interacticle/visual/view.py @@ -21,6 +21,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; @@ -29,11 +31,11 @@ particle_shader = ( vec3 n = vec3(fs_in.tex_coord - vec2(0.5), 0.); n.z = -sqrt(1 - length(n))*0.6; n = normalize(n); - + vec3 dir = normalize(camera_pos.xyz - fs_in.particle_pos); vec3 color = fs_in.atom_color * dot(dir, n); - gl_FragColor = vec4(color.xyz, 1.0); + frag_color = vec4(color.xyz, 1.0); } """, """ @@ -107,11 +109,13 @@ particle_shader = ( decoration_shader = ( """ #version 430 - + uniform vec3 color; - + + layout(location = 0) out vec4 frag_color; + void main(){ - gl_FragColor = vec4(color, 1); + frag_color = vec4(color, 1); } """, """ @@ -139,12 +143,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