7layout(set = 0, binding = 1, std140) uniform SpriteExtended {
13 vec4 custom_uniforms[16];
17#define iMouse ext.mouse
18#define iResolution ext.u0.zw
19#define time_f ext.u2.y
22layout(location = 0) in vec2 tc;
23layout(set = 0, binding = 0) uniform sampler2D samp;
36const
float PI = 3.14159;
46 float r = abs(t * 6.0 - 3.0) - 1.0;
47 float g = 2.0 - abs(t * 6.0 - 2.0);
48 float b = 2.0 - abs(t * 6.0 - 4.0);
49 return clamp(vec3(r, g, b), 0.0, 1.0);
75 float gray = dot(col, vec3(0.299, 0.587, 0.114));
76 return mix(vec3(gray), col, s);
85 return 1.0 - abs(1.0 - 2.0 * fract(tc * 0.5));
95 vec2 ts = vec2(textureSize(tex, 0));
98 vec2 sampleUV = clamp(uv, eps, 1.0 - eps);
99 return texture(tex, sampleUV);
109 float c = cos(a);
float s = sin(a);
110 return mat2(c, -s, s, c) * p;
120 return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);
131 vec2 u = f * f * (3.0 - 2.0 * f);
132 return mix(mix(
hash(i),
hash(i + vec2(1.0, 0.0)), u.x),
133 mix(
hash(i + vec2(0.0, 1.0)),
hash(i + vec2(1.0, 1.0)), u.x), u.y);
144 mat2
rot = mat2(cos(0.5), sin(0.5), -sin(0.5), cos(0.50));
145 for (
int i = 0; i < 5; i++) {
147 p =
rot * p * 2.0 + vec2(2.0);
165 float aspect = res.x / res.y;
168 vec2 p = (uv - center) * vec2(aspect, 1.0);
170 float zoom = max(
iZoom, 0.1);
175 q.x =
fbm(p + vec2(0.0, 0.0) + 0.05*t);
176 q.y =
fbm(p + vec2(5.2, 1.3) + 0.05*t);
179 r.x =
fbm(p + 4.0*q + vec2(t * 0.2));
180 r.y =
fbm(p + 4.0*q + vec2(t * 0.1, 2.8));
189 vec2 spiralCoords = p + distortion;
193 float angle = atan(spiralCoords.y, spiralCoords.x);
194 float spiralTwist = angle + length(spiralCoords) * 3.0 - t * 0.5;
202 vec2 fluidUV = uv + distortion;
203 vec3 texCol =
mxTexture(samp, fluidUV).rgb;
209 float blendFactor = 0.6 + 0.2 * sin(length(r) * 5.0 + t);
212 vec3 finalCol = mix(texCol, spiralColor, 0.5);
215 finalCol += spiralColor * 0.2 *
strength;
228 float ampControl = clamp(
iAmplitude, 0.0, 2.0);
229 float strength = 1.0 + (ampControl * 0.5);
231 vec2 center = vec2(0.5);
238 vec2 offset = vec2(0.005 *
strength, 0.0);
251 vec2 vUV = uv * (1.0 - uv.yx);
252 float vig = vUV.x * vUV.y * 15.0;
256 color.rgb = sin(col *
time_f);
layout(set=0, binding=1, std140) uniform SpriteExtended
void main(void)
Executes the fragment shader entry point.
vec4 mxTexture(sampler2D tex, vec2 tc)
Evaluates mxTexture for this shader effect.
vec3 adjustBrightness(vec3 col, float b)
Evaluates adjustBrightness for this shader effect.
vec2 wrapUV(vec2 tc)
Evaluates wrapUV for this shader effect.
vec3 adjustSaturation(vec3 col, float s)
Evaluates adjustSaturation for this shader effect.
vec3 adjustContrast(vec3 col, float c)
Evaluates adjustContrast for this shader effect.
vec3 sampleMergedLiquid(vec2 uv, float t, float strength, vec2 center, vec2 res)
Evaluates sampleMergedLiquid for this shader effect.
float fbm(vec2 point)
Evaluates fbm for this shader effect.
vec2 rot(vec2 v, float a)
Evaluates rot for this shader effect.
float hash(vec2 p)
Evaluates hash for this shader effect.
float noise(vec2 p)
Evaluates noise for this shader effect.
vec3 rainbow(float t)
Evaluates rainbow for this shader effect.
vec2 spiralTwist(vec2 uv, vec2 center, float aspect, float t, float drive)
Evaluates spiralTwist for this shader effect.
mat2 rotate2D(float a)
Evaluates rotate2D for this shader effect.