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;
57 return (col - 0.5) * c + 0.5;
67 float gray = dot(col, vec3(0.299, 0.587, 0.114));
68 return mix(vec3(gray), col, s);
81 0.299 + 0.701*U + 0.168*
W,
82 0.587 - 0.587*U + 0.330*
W,
83 0.114 - 0.114*U - 0.497*
W,
84 0.299 - 0.299*U - 0.328*
W,
85 0.587 + 0.413*U + 0.035*
W,
86 0.114 - 0.114*U + 0.292*
W,
87 0.299 - 0.300*U + 1.250*
W,
88 0.587 - 0.588*U - 1.050*
W,
89 0.114 + 0.886*U - 0.203*
W
91 return clamp(
R * col, 0.0, 1.0);
104 return clamp(col, 0.0, 1.0);
114 vec2 p = uv - center;
117 p = mat2(c, -s, s, c) * p;
118 float z = max(abs(
iZoom), 0.001);
130 return 1.0 - abs(1.0 - 2.0 * fract(tc * 0.5));
140 vec2 ts = vec2(textureSize(tex, 0));
144 vec2 sampleUV = clamp(uv, eps, 1.0 - eps);
147 vec2 deriv = fwidth(tc);
148 if (deriv.x > 0.0 || deriv.y > 0.0) {
149 lod = log2(max(max(deriv.x, deriv.y) * max(ts.x, ts.y), 1.0));
152 return textureLod(tex, sampleUV, lod);
167 return mat2(c, -s, s, c) * p;
177 float pi = 3.14159265359;
179 float a = atan(p.y, p.x);
180 float sector = pi * 2.0 / slices;
182 a = abs(a - sector * 0.5);
183 return vec2(cos(a), sin(a)) * r;
197 float aspect = res.x / res.y;
200 float ampControl = clamp(
iAmplitude, 0.0, 2.0);
201 float freqControl = clamp(
iFrequency, 0.0, 2.0);
204 vec2 p = (uv - center) * vec2(aspect, 1.0);
207 float slices = 6.0 + floor(ampControl * 4.0);
213 int iterations = 4 + int(ampControl * 2.0);
214 float scale = 1.2 + (freqControl * 0.5);
218 float angle = t * 0.1;
220 for(
int i = 0; i < iterations; i++) {
224 p =
rotate2D(p, angle +
float(i)*0.5);
229 vec2 finalUV = p * 0.5 + center;
232 float chroma = 0.005 *
strength * sin(t);
234 float r =
mxTexture(samp, finalUV + vec2(chroma, 0.0)).r;
236 float b =
mxTexture(samp, finalUV - vec2(chroma, 0.0)).b;
238 return vec3(r, g, b);
254 float ampControl = clamp(
iAmplitude, 0.0, 2.0);
258 float t =
time_f * tSpeed;
259 float strength = 0.5 + (ampControl * 0.5);
261 vec2 center = vec2(0.5);
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.
vec3 applyColorAdjustments(vec3 col)
Evaluates applyColorAdjustments 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.
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.
vec2 applyZoomRotation(vec2 uv, vec2 center)
Evaluates applyZoomRotation for this shader effect.
vec3 sampleFractal(vec2 uv, float t, float strength, vec2 center, vec2 res)
Evaluates sampleFractal for this shader effect.