Today I was working on implementing parallel processing to animate from a worker, and have everything working (including resizing, orbit controls, etc.) however, this one I’m a little puzzled on. Is there a better way to go about this?
canvas.style = {} // Offscreen Canvas does not have a Style!
renderer.setPixelRatio( devicePixelRatio )
renderer.setSize(width, height)
renderer.setClearColor( 0x000000, 0 )
Resorted to setting .style on the Offscreen Canvas to an empty object. Width / Height are being set from a Vue component on main thread as it resizes by styling and all appropriate settings are sent to the worker. Everything seems to be working flawless, including a column drag / drop which resizes the canvas. Chat GPT couldn’t answer why it was throwing errors, and google searches yielded nothing as to a how you’d do this “properly.” Soo, this was the fix.
Or perhaps I should submit a bug: Three.js should be updated to check if the Canvas has a .Style when setting the Width / Height to canvas.style?