aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2022-02-06 22:42:30 +0100
committerAdrian Kummerlaender2022-02-06 22:42:30 +0100
commitf512528d51eb59dea1eb8ddb2c96c96f3fd583b4 (patch)
tree50aab044469707f81cb700ce6564c912959117ab
parent90ebf661ef8d16a3569f7fa329c68ac10f0f1978 (diff)
downloadboltzgas-f512528d51eb59dea1eb8ddb2c96c96f3fd583b4.tar
boltzgas-f512528d51eb59dea1eb8ddb2c96c96f3fd583b4.tar.gz
boltzgas-f512528d51eb59dea1eb8ddb2c96c96f3fd583b4.tar.bz2
boltzgas-f512528d51eb59dea1eb8ddb2c96c96f3fd583b4.tar.lz
boltzgas-f512528d51eb59dea1eb8ddb2c96c96f3fd583b4.tar.xz
boltzgas-f512528d51eb59dea1eb8ddb2c96c96f3fd583b4.tar.zst
boltzgas-f512528d51eb59dea1eb8ddb2c96c96f3fd583b4.zip
Replace deprecated gl_FragColorHEADmaster
-rw-r--r--boltzgas/visual/view.py14
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);
}
}
""",