summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2022-02-06 22:48:13 +0100
committerAdrian Kummerlaender2022-02-06 22:48:13 +0100
commit630d107c91a83f1c6294845de6ff3f4cd56488b6 (patch)
tree0c4cc8cd54f2e200fdae0d40657a71d33a43790d
parent45d70aadeb6c8e2959e836d8de6ef40a074850de (diff)
downloadinteracticle-master.tar
interacticle-master.tar.gz
interacticle-master.tar.bz2
interacticle-master.tar.lz
interacticle-master.tar.xz
interacticle-master.tar.zst
interacticle-master.zip
Replace deprecated gl_FragColorHEADmaster
-rw-r--r--interacticle/visual/view.py20
1 files 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);
}
}
""",