fix uTime uniform

This commit is contained in:
Emile Clark-Boman 2026-01-31 11:32:09 +10:00
parent c4569168c7
commit c0d19f102a
2 changed files with 10 additions and 7 deletions

View file

@ -4,8 +4,11 @@
* View this shader on shadertoy: https://www.shadertoy.com/view/t3tSRj#
*/
#ifdef GL_ES
precision highp float;
#endif
uniform float uTime;
/* ==== Text Colouring ==== */
#define PHOSPHOR_COL vec4(1, 1., 1., 1.)
#define BG_COL vec4(0.2, 0.0, 0.2, 0.)
@ -296,7 +299,7 @@ float vt220Font(vec2 p, float c) {
// https://www.shadertoy.com/view/MsdGWn
//
float textLines(vec2 uvG) {
float wt = 5. * (iTime + 0.5*sin(iTime*1.4) + 0.2*sin(iTime*2.9)); // wobbly time
float wt = 5. * (uTime + 0.5*sin(uTime*1.4) + 0.2*sin(uTime*2.9)); // wobbly time
vec2 uvGt = uvG + vec2(0., floor(wt));
float ll = rand(vec2(uvGt.y, - 1.)) * ROWCOLS.x; // line length
@ -362,12 +365,12 @@ void mainImage(out vec4 fragColor, in vec2 fragCoord) {
uvNoise = ceil(uvNoise * ROWCOLS) / ROWCOLS;
float val;
if (iTime < 2.0)
if (uTime < 2.0)
val = textLines(uvG);
else if (iTime < 2.3)
val = rand(uvG * iTime) * 17.;
else if (uTime < 2.3)
val = rand(uvG * uTime) * 17.;
else {
float noise = smokeNoise(vec3(uvNoise * noiseScale, iTime * noiseTimeScale));
float noise = smokeNoise(vec3(uvNoise * noiseScale, uTime * noiseTimeScale));
// Noise is fed through a sigmoid function, then quantised to integer range 0-17
val = (exp(noise) / 2.71828); // increase contrast (normalised 0.0 - 1.0)
val = 1.0 / val;