add uResolution uniform2f

This commit is contained in:
do butterflies cry? 2026-01-31 11:40:22 +10:00
parent 9681cc76fa
commit 6ffcfa692e
3 changed files with 15 additions and 9 deletions

View file

@ -9,6 +9,7 @@ precision highp float;
#endif
uniform float uTime;
uniform vec2 uResolution;
/* ==== Text Colouring ==== */
#define PHOSPHOR_COL vec4(1, 1., 1., 1.)
@ -150,9 +151,9 @@ float roundLine(vec2 p, vec2 a, vec2 b) {
b -= a + vec2(1.0,0.);
p -= a;
float f = length(p-clamp(dot(p,b)/dot(b,b),0.0,1.0)*b);
if (iResolution.y < 320.) // attempt to get rid of aliasing on small resolution
if (uResolution.y < 320.) // attempt to get rid of aliasing on small resolution
return smoothstep(1.0, 0.9, f);
else if (iResolution.y < 720.)
else if (uResolution.y < 720.)
return smoothstep(0.75, 0.5, f);
else
return smoothstep(1., 0., f);
@ -357,12 +358,12 @@ float bloom(vec2 uv2) {
}
void mainImage(out vec4 fragColor) {
vec2 uv = vec2(gl_FragCoord.x, iResolution.y - gl_FragCoord.y);
vec2 uvT = ROWCOLS * FONT_SIZE * uv / iResolution.xy;
vec2 uvG = floor(ROWCOLS * uv / iResolution.xy);
vec2 uvC = gl_FragCoord/iResolution.xy;
vec2 uv = vec2(gl_FragCoord.x, uResolution.y - gl_FragCoord.y);
vec2 uvT = ROWCOLS * FONT_SIZE * uv / uResolution.xy;
vec2 uvG = floor(ROWCOLS * uv / uResolution.xy);
vec2 uvC = gl_FragCoord/uResolution.xy;
vec2 uvNoise = gl_FragCoord.xy / iResolution.xy;
vec2 uvNoise = gl_FragCoord.xy / uResolution.xy;
uvNoise = ceil(uvNoise * ROWCOLS) / ROWCOLS;
float val;