Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGPURenderer: WebGL2 backend: moving directional light causes shadow flickering #30066

Closed
srfall opened this issue Dec 8, 2024 · 1 comment
Assignees
Milestone

Comments

@srfall
Copy link

srfall commented Dec 8, 2024

Description

I am using a DirectionalLight and update its position when the camera has moved. This works fine with the WebGlRenderer, but I try the same thing with the WebGPURenderer (in Firefox), every time the light is moved, the shadows glitch. I would expect the same behavior in the WebGL2 fallback as when directly using the WebGlRenderer.

Reproduction steps

  1. Copy / open the two shadowmap examples for WebGl and WebGPU
  2. Insert e.g:
scene.add(dirLight.target);
const cameraLightOffset = new THREE.Vector3().copy(camera.position).sub(dirLight.position);
controls.addEventListener('change', () => {
    dirLight.position.copy(camera.position).sub(cameraLightOffset);
    dirLight.target.position.copy(controls.target);
});

or any other code that updates the dirLight position when the camera position changes.

  1. Notice that the shadows look fine in the webGL version, but in the WebGPU->WebGL2 fallback version, they glitch

Code

// see live example

Live example

Screenshots

No response

Version

r171

Device

Desktop

Browser

Firefox

OS

Windows

Repository owner deleted a comment Dec 9, 2024
@sunag
Copy link
Collaborator

sunag commented Dec 13, 2024

I was fixed in dev branch #30064

@sunag sunag closed this as completed Dec 13, 2024
@sunag sunag added this to the r172 milestone Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants