diff options
author | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-18 21:03:34 +0200 |
---|---|---|
committer | Ilion Beyst <ilion.beyst@gmail.com> | 2022-07-18 21:03:34 +0200 |
commit | 7daf8f643798ce76733006f8469890bf1a3fd05e (patch) | |
tree | d755c4f0979f56792684b109d263624aef4baaad /web/pw-visualizer/assets/shaders | |
parent | 608d05bc167c57d190d3c06f250b5e4a5662e77e (diff) | |
parent | d092f5d89c0fda5cc67349d5489b4ef1b294e053 (diff) | |
download | planetwars.dev-7daf8f643798ce76733006f8469890bf1a3fd05e.tar.xz planetwars.dev-7daf8f643798ce76733006f8469890bf1a3fd05e.zip |
Merge branch 'next'
Diffstat (limited to 'web/pw-visualizer/assets/shaders')
-rw-r--r-- | web/pw-visualizer/assets/shaders/frag/image.glsl | 1 | ||||
-rw-r--r-- | web/pw-visualizer/assets/shaders/frag/masked_image.glsl | 21 |
2 files changed, 21 insertions, 1 deletions
diff --git a/web/pw-visualizer/assets/shaders/frag/image.glsl b/web/pw-visualizer/assets/shaders/frag/image.glsl index 69c8b91..f8d62c9 100644 --- a/web/pw-visualizer/assets/shaders/frag/image.glsl +++ b/web/pw-visualizer/assets/shaders/frag/image.glsl @@ -10,5 +10,4 @@ uniform sampler2D u_texture; void main() { gl_FragColor = texture2D(u_texture, v_texCoord); -// gl_FragColor = vec4(0.7, 0.7, 0.0, 1.0); } diff --git a/web/pw-visualizer/assets/shaders/frag/masked_image.glsl b/web/pw-visualizer/assets/shaders/frag/masked_image.glsl new file mode 100644 index 0000000..da0c787 --- /dev/null +++ b/web/pw-visualizer/assets/shaders/frag/masked_image.glsl @@ -0,0 +1,21 @@ +#ifdef GL_ES +precision mediump float; +#endif + +// Passed in from the vertex shader. +varying vec2 v_texCoord; + +uniform float u_step_interval; +uniform float u_time; +uniform vec3 u_color; +uniform vec3 u_color_next; + + +// The texture. +uniform sampler2D u_texture; + +void main() { + float alpha = texture2D(u_texture, v_texCoord).a; + vec3 color = mix(u_color, u_color_next, u_time); + gl_FragColor = vec4(color, alpha); +} |