Skip to content

WebGPURenderer&autoClear: Using renderer.autoClear = false yields a different effect. #31966

@Jenychen1996

Description

@Jenychen1996

Description

I have some confusion regarding the use of autoclear in WebGPU.
When I use renderer.autoClear = false in both webgpu_postprocessing_outline.html and webgl_postprocessing_outline.html, rotating the scene does not yield the same rendering effect. It seems that in the WebGPURenderer, some objects or caches are not being properly culled. To address this, I added renderer.clear() in the animate method of webgpu_postprocessing_outline.html, but this still did not resolve the issue.
Could you please guide me on the correct way to use it? Thank you.

Reproduction steps

1.Run webgpu_postprocessing_outline.html or webgl_postprocessing_outline.html
2.Run renderer.autoClear = false in the console.
3.Left-click Rotation Scene

Code

// code goes here
const guiObj = {
  autoClear: true
};

gui.add(guiObj, 'autoClear').name('autoClear').onChange(value => {
  if (renderer) {
    renderer.autoClear = value;
  }
})

if (!renderer.autoClear) {
  renderer.setClearColor(0xffffff)
  renderer.clear()
}

Live example

WebGPURenderer&autoClear

Screenshots

No response

Version

r178

Device

No response

Browser

No response

OS

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions