Refactor: simplify iResolution uniform calculation by removing devicePixelRatio scaling and using gl.uniform3fv.
This commit is contained in:
parent
12592e3726
commit
f58ff49c46
@ -993,13 +993,10 @@ export function ShaderBackground() {
|
||||
"iResolution uniform not found (maybe not used by shader)."
|
||||
);
|
||||
} else {
|
||||
// Optionally convert to physical pixels:
|
||||
const dpr = window.devicePixelRatio || 1;
|
||||
const w = canvas.clientWidth * dpr;
|
||||
const h = canvas.clientHeight * dpr;
|
||||
const w = canvas.width;
|
||||
const h = canvas.height;
|
||||
|
||||
// set as vec3: x = width, y = height, z = pixel aspect (often 1.0)
|
||||
gl.uniform3f(loc, w, h, 1.0);
|
||||
gl.uniform3fv(loc, [w, h, 1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user