diff options
author | Adrian Kummerlaender | 2022-02-06 22:42:30 +0100 |
---|---|---|
committer | Adrian Kummerlaender | 2022-02-06 22:42:30 +0100 |
commit | f512528d51eb59dea1eb8ddb2c96c96f3fd583b4 (patch) | |
tree | 50aab044469707f81cb700ce6564c912959117ab | |
parent | 90ebf661ef8d16a3569f7fa329c68ac10f0f1978 (diff) | |
download | boltzgas-master.tar boltzgas-master.tar.gz boltzgas-master.tar.bz2 boltzgas-master.tar.lz boltzgas-master.tar.xz boltzgas-master.tar.zst boltzgas-master.zip |
-rw-r--r-- | boltzgas/visual/view.py | 14 |
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); } } """, |