-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Closed
Milestone
Description
Description
Couldn't for the life of me get a canvas that had been saturated by webGPURenderer to be cleared. It also yielded no warnings or errors.
Trying to run myWebGPURenderer.clear() basically no-ops and the last thing drawn remains on canvas
NOTE: The webgl2 fallback works fine! It is only when renderer is in new webgpu mode that clear() is nonfunctional. I can replicate this bug 100% consistency even with basic setup.
Reproduction steps
- Render anything to the screen via webGPURenderer(). Must not use webGL2 fallback!
- cancelAnimationFrame() your render loop
- Run
myWebGPURenderer.clear() - Canvas still dirty with the last thing drawn.
Code
// This was my best attempt
setClearColor(0x000000, 0)
gpu.setClearAlpha(0)
gpu.clear()
// Nothing happens if just above is run, canvas still dirty with the last drawn frame :(
gpuComposer.render()
// All black opaque screen from empty composer render()Live example
Holy cow finally got the fiddle up. We pull the plug here in a setTimeout and you can watch the canvas not be cleared after 3 seconds.
setTimeout(()=>{
cancelAnimationFrame(frame);
renderer.setClearColor(0xFF0000,0);
renderer.clear();
},3000)Screenshots
No response
Version
r174
Device
Desktop
Browser
Chrome
OS
MacOS
Metadata
Metadata
Assignees
Labels
No labels