summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);
}
}
""",