Files
Dwinzo_Demo/app/src/assets/shaders/zone/zone2.frag.glsl

26 lines
647 B
GLSL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
varying vec2 vUv;
uniform vec3 uOuterColor;
uniform float uTime;
void main() {
// Map vUv into -1..1 range like Shadertoy
vec2 uv = (vUv - 1.0) * 0.5;
// Distortion loop slowed down (uTime * 0.25)
for (float i = 1.0; i < 8.0; i++) {
uv.y += 0.1 * sin(uv.x * i * i + uTime * 0.25)
* sin(uv.y * i * i + uTime * 0.25);
}
// Base color influenced by uv + zone color
vec3 col = uOuterColor;
col.r += uv.y * 0.2;
col.g += uv.y * 0.3;
col.b += uv.y * 0.4;
// Vertical fade
float verticalFade = 1.0 - vUv.y;
gl_FragColor = vec4(col * verticalFade, verticalFade);
}