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
21layout(set = 0, binding = 0) uniform sampler2D samp;
26layout(location = 0) in vec2 tc;
47 float modVal = mod(x, length * 2.0);
48 return modVal <= length ? modVal : length * 2.0 - modVal;
72 float gray = dot(col, vec3(0.299, 0.587, 0.114));
73 return mix(vec3(gray), col, s);
82 float U = cos(angle);
float W = sin(angle);
84 0.299+0.701*U+0.168*
W, 0.587-0.587*U+0.330*
W, 0.114-0.114*U-0.497*
W,
85 0.299-0.299*U-0.328*
W, 0.587+0.413*U+0.035*
W, 0.114-0.114*U+0.292*
W,
86 0.299-0.300*U+1.250*
W, 0.587-0.588*U-1.050*
W, 0.114+0.886*U-0.203*
W
88 return clamp(
R * col, 0.0, 1.0);
99 vec3 colBlue = vec3(0.05, 0.2, 1.0);
100 vec3 colPurple = vec3(0.7, 0.0, 1.0);
101 vec3 colPink = vec3(1.0, 0.05, 0.5);
103 if (x < 0.33)
return mix(colBlue, colPurple, x * 3.0);
104 else if (x < 0.66)
return mix(colPurple, colPink, (x - 0.33) * 3.0);
105 else return mix(colPink, colBlue, (x - 0.66) * 3.0);
116 return 1.0 - abs(1.0 - 2.0 * fract(tc * 0.5));
127 vec2 ts = vec2(textureSize(tex, 0));
130 vec2 sampleUV = clamp(uv, eps, 1.0 - eps);
132 vec2 deriv = fwidth(tc);
133 if (deriv.x > 0.0 || deriv.y > 0.0) {
134 lod = log2(max(max(deriv.x, deriv.y) * max(ts.x, ts.y), 1.0));
136 return textureLod(tex, sampleUV, lod);
146 float c = cos(a);
float s = sin(a);
147 return mat2(c, -s, s, c) * p;
159 float pi = 3.14159265359;
161 float a = atan(p.y, p.x);
162 float sector = pi * 2.0 / slices;
164 a = abs(a - sector * 0.5);
165 return vec2(cos(a), sin(a)) * r;
175 return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);
186 vec2 u = f * f * (3.0 - 2.0 * f);
187 return mix(mix(
hash(i),
hash(i + vec2(1.0, 0.0)), u.x),
188 mix(
hash(i + vec2(0.0, 1.0)),
hash(i + vec2(1.0, 1.0)), u.x), u.y);
199 mat2
rot = mat2(cos(0.5), sin(0.5), -sin(0.5), cos(0.5));
200 for (
int i = 0; i < 4; i++) {
202 p =
rot * p * 2.0 + vec2(100.0);
219 float aspect = res.x / res.y;
220 vec2 p = (uv - center) * vec2(aspect, 1.0);
224 float zoom = max(
iZoom, 0.01);
232 float waveAmp = 0.1 * sin(0.2 * time_t) *
iAmplitude;
233 float waveSpd = sin(0.3 * time_s);
235 p.y += sin(p.x * waveFreq +
time_f * waveSpd) * waveAmp;
246 for(
int i = 0; i < iterations; i++) {
250 p =
rotate2D(p, t * 0.05 +
float(i));
257 q.x =
fbm(p + vec2(0.0, 0.0) + 0.05*t);
258 q.y =
fbm(p + vec2(5.2, 1.3) + 0.05*t);
261 r.x =
fbm(p + 4.0*q + vec2(t * 0.1));
262 r.y =
fbm(p + 4.0*q + vec2(t * 0.05, 2.8));
266 float liquidStrength = 0.2 + (
iAmplitude * 0.5);
267 vec2 distortion = r * liquidStrength;
271 vec2 finalUV = uv + distortion;
274 finalUV.y += sin(finalUV.x * waveFreq +
time_f * waveSpd) * waveAmp;
276 vec3 texCol =
mxTexture(samp, finalUV).rgb;
281 float pattern = length(q) + length(r) + t * 0.1;
286 vec3 col = texCol *
neon * 2.0;
289 float turbulence = length(r);
290 col = mix(col, texCol, max(0.0, 1.0 - turbulence * 2.0));
304 vec2 center = vec2(0.5);
311 float caStrength = 0.003 * (1.0 +
iAmplitude);
325 vec2 vUV = uv * (1.0 - uv.yx);
326 float vig = vUV.x * vUV.y * 15.0;
330 color = vec4(col, 1.0);
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 rotateHue(vec3 col, float angle)
Evaluates rotateHue for this shader effect.
vec3 getNeonPalette(float t)
Evaluates getNeonPalette for this shader effect.
vec3 sampleSuperShader(vec2 uv, float t, vec2 center, vec2 res)
Evaluates sampleSuperShader for this shader effect.
float fbm(vec2 point)
Evaluates fbm for this shader effect.
float pingPong(float x, float length)
Evaluates pingPong 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 neon(float t)
Evaluates neon for this shader effect.
vec2 kaleido(vec2 p, float seg)
Evaluates kaleido for this shader effect.
mat2 R(float a)
Evaluates R for this shader effect.
float W(vec2 p)
Evaluates W for this shader effect.
mat2 rotate2D(float a)
Evaluates rotate2D for this shader effect.