fix: type safety in grainient

This commit is contained in:
Utkarsh-Singhal-26
2026-02-04 10:21:07 +05:30
parent 3b7da99d89
commit 7368a6cecb
3 changed files with 4 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -211,7 +211,7 @@ const setup = () => {
const width = Math.max(1, Math.floor(rect.width));
const height = Math.max(1, Math.floor(rect.height));
renderer.setSize(width, height);
const res = program.uniforms.iResolution.value as Float32Array;
const res = (program.uniforms.iResolution as { value: Float32Array }).value;
res[0] = gl.drawingBufferWidth;
res[1] = gl.drawingBufferHeight;
};
@@ -223,8 +223,7 @@ const setup = () => {
let raf = 0;
const t0 = performance.now();
const loop = (t: number) => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(program.uniforms.iTime as any).value = (t - t0) * 0.001;
(program.uniforms.iTime as { value: number }).value = (t - t0) * 0.001;
renderer.render({ scene: mesh });
raf = requestAnimationFrame(loop);
};