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 vec3 a = vec3(0.5, 0.5, 0.5);
48 vec3 b = vec3(0.5, 0.5, 0.5);
49 vec3 c = vec3(1.0, 1.0, 1.0);
50 vec3 d = vec3(0.263, 0.416, 0.557);
51 return a + b * cos(6.28318 * (c * t + d +
iHueShift));
75 float gray = dot(col, vec3(0.299, 0.587, 0.114));
76 return mix(vec3(gray), col, s);
86 return 1.0 - abs(1.0 - 2.0 * fract(tc * 0.5));
96 vec2 ts = vec2(textureSize(tex, 0));
99 vec2 sampleUV = clamp(uv, eps, 1.0 - eps);
101 return textureLod(tex, sampleUV, lod);
112 return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);
124 vec2 u = f * f * (3.0 - 2.0 * f);
125 float a =
hash(i + vec2(0.0, 0.0));
126 float b =
hash(i + vec2(1.0, 0.0));
127 float c =
hash(i + vec2(0.0, 1.0));
128 float d =
hash(i + vec2(1.0, 1.0));
129 return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);
139float fbm(vec2 p,
bool ridges) {
142 for (
int i = 0; i < 4; i++) {
144 if (ridges)
n = 1.0 - abs(
n * 2.0 - 1.0);
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 float c = cos(a), s = sin(a);
176 return mat2(c, -s, s, c);
189 float aspect = res.x / res.y;
190 vec2 p = (uv - center) * vec2(aspect, 1.0);
194 float zoomLvl = max(
iZoom, 0.1);
199 q.x =
fbm(p + vec2(0.0, 0.0) + t * 0.2,
false);
200 q.y =
fbm(p + vec2(5.2, 1.3) - t * 0.15,
false);
203 r.x =
fbm(p + 4.0 * q + vec2(t * 0.5, 9.2),
true);
204 r.y =
fbm(p + 4.0 * q + vec2(8.3, 2.8),
false);
210 float slices = 6.0 + 10.0 * sin(t * 0.1) *
iAmplitude;
211 vec2 k =
kaleido(warpedUV, max(3.0, slices));
215 vec2 texUV = k / vec2(aspect, 1.0) + center;
218 vec3 texCol =
mxTexture(samp, texUV).rgb;
222 float warpLen = length(r);
225 float electric = pow(warpLen, 3.0) *
iContrast;
238 finalCol += vec3(smoothstep(0.8, 1.0, electric)) * 2.0;
253 vec2 center = vec2(0.5);
261 vec2 offset = vec2(0.005 *
strength, 0.0);
272 vec2 vUV = uv * (1.0 - uv.yx);
273 float vig = vUV.x * vUV.y * 15.0;
274 vig = pow(vig, 0.25);
277 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.
float fbm(vec2 point)
Evaluates fbm for this shader effect.
vec3 palette(float phase)
Evaluates palette 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.
vec2 kaleido(vec2 p, float seg)
Evaluates kaleido for this shader effect.
vec3 pal(float t)
Evaluates pal for this shader effect.
float n(vec2 p)
Evaluates n for this shader effect.
vec3 renderEnergy(vec2 uv, float t, float strength, vec2 center, vec2 res)
Evaluates renderEnergy for this shader effect.