Closed 8Observer8 closed 1 year ago
That's quite strange. I'm unfortunately not familiar enough with webgl to tell you what's going on but here are some observations:
That sort of thing makes me think that there is a race condition somewhere in the code that is making an assumption about load ordering that doesn't always hold true.
I remembered a similar problem you helped me solve a year ago with window.onresize
: Three.js doesn’t start rendering automatically on Plunker
I added this window.onresize
handler and the problem was solved: https://plnkr.co/edit/RuOBTnWsiwk3uMln?preview
window.onresize = () => {
const w = gl.canvas.clientWidth;
const h = gl.canvas.clientHeight;
gl.canvas.width = w;
gl.canvas.height = h;
gl.viewport(0, 0, w, h);
mat4.lookAt(viewMatrix, [0, 0, 50], [0, 0, 0], [0, 1, 0]);
mat4.mul(projViewMatrix, projMatrix, viewMatrix);
};
window.onresize(null);
My example doesn't show animation and doesn't print any errors to the console: https://plnkr.co/edit/RuOBTnWsiwk3uMln?preview
Exactly the same example works on PlayCode: https://playcode.io/1524054
Using only PlayCode is not a solution. I need both for a reservation.
Source on GitHub with instruction to build with Rollup: https://github.com/8Observer8/run-animation-texture-packer-webgl-js