Skip to content

Viewer: Add shadow support #16459

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

Merged
merged 115 commits into from
May 15, 2025
Merged

Conversation

alexandremottet
Copy link
Contributor

@alexandremottet alexandremottet commented Apr 8, 2025

In the viewer, add the support for :

  • shadow map,
  • ibl shadows
  • shadow quality selection normal, high

For now, ibl shadows are dissabled for meshes that have animations in WebGPU even if the animation is paused as there is some issues.

The auto shadow selection will come in another PR.
The placement of the light will come in another PR.

Edit from @ryantrem: from local testing, these are the remaining issues I'm seeing:

  • Shadow map shadows don't work when "statically" enabled (e.g. <babylon-viewer shadow-quality="normal">).
  • IBL shadows do not update when an animation is running. I assume this is not supported in IBL shadows, but if that is the case, should we disallow IBL shadows for animated models?
  • IBL shadows seem to get into a bad state after I load a few different models. This can be reproed in the Viewer test app by just dragging and dropping a sequence of models with IBL shadows enabled. After a few models, I start seeing wrong shadows or significant rendering artifacts. I'm not sure if there is a missing accumulator reset, or if this is a bug in IBL shadows or what.

@bjsplat
Copy link
Collaborator

bjsplat commented May 12, 2025

Reviewer - this PR has made changes to one or more package.json files.

@bjsplat
Copy link
Collaborator

bjsplat commented May 12, 2025

Please make sure to label your PR with "bug", "new feature" or "breaking change" label(s).
To prevent this PR from going to the changelog marked it with the "skip changelog" label.

@bjsplat
Copy link
Collaborator

bjsplat commented May 12, 2025

Reviewer - this PR has made changes to one or more package.json files.

@bjsplat
Copy link
Collaborator

bjsplat commented May 12, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented May 12, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented May 12, 2025

@thomlucc thomlucc mentioned this pull request May 14, 2025
5 tasks
ryantrem added 4 commits May 15, 2025 11:03
…classic shadows into a broken state

Ignore AbortErrors and log other errors for async work done in sync functions

Make all root meshes shadow casters

Don't expose high quality (IBL) shadows yet, since there are some outstanding issues to resolve
Some classic shadow tuning
@bjsplat
Copy link
Collaborator

bjsplat commented May 15, 2025

Reviewer - this PR has made changes to one or more package.json files.

@ryantrem ryantrem removed the request for review from sebavan May 15, 2025 19:15
@bjsplat
Copy link
Collaborator

bjsplat commented May 15, 2025

Reviewer - this PR has made changes to one or more package.json files.

@sebavan sebavan enabled auto-merge (squash) May 15, 2025 19:45
@bjsplat
Copy link
Collaborator

bjsplat commented May 15, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented May 15, 2025

@sebavan sebavan merged commit 99f2f4f into BabylonJS:master May 15, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants