Skip to content

Viewer fixes for IBL Shadows (Draft) #16659

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

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

MiiBond
Copy link
Contributor

@MiiBond MiiBond commented May 22, 2025

When using the geometry buffer with animated meshes, we're hitting this compile error about uniforms.mPreviousBones not being defined. Turns out there was a slight difference in the WebGPU shader that was preventing compilation when BONETEXTURE was also defined. Now, the behaviour matches WebGL.

@bjsplat
Copy link
Collaborator

bjsplat commented May 22, 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 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented May 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented May 22, 2025

1 similar comment
@bjsplat
Copy link
Collaborator

bjsplat commented May 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented May 22, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented May 23, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented May 23, 2025

@sebavan sebavan requested a review from ryantrem May 23, 2025 22:39
Copy link
Member

@sebavan sebavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good for me

Not sure about the viewer/snapshot changes. let s wait on @ryantrem to approve

Copy link
Member

@sebavan sebavan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we split into a shader / IBL only bug fix PR and the viewer specific one ?

Copy link
Member

@ryantrem ryantrem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a change to this PR to fix WebGPU snapshot rendering with IBL shadows. The only other thing I think we probably want before exposing IBL shadows in the Viewer is to disallow them when the model is animated (since IBL shadows do not update in real time as the model animates). @alexandremottet do you want to make those changes in this PR?

@@ -1693,7 +1684,7 @@ export class Viewer implements IDisposable {

updateMaterial();

pipeline.onShadowTextureReadyObservable.addOnce(updateMaterial);
pipeline.onShadowTextureReadyObservable.add(updateMaterial);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change needed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess regardless we don't really need to track and remove the observer, since we would do that at exactly the same time as when we dispose the entire pipeline anyway (which clears observers), correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I don't think this change is needed.

@bjsplat
Copy link
Collaborator

bjsplat commented May 27, 2025

@bjsplat
Copy link
Collaborator

bjsplat commented May 27, 2025

@MiiBond
Copy link
Contributor Author

MiiBond commented May 28, 2025

Can we split into a shader / IBL only bug fix PR and the viewer specific one

Yes. In fact, I already opened a PR for the animation fix on WebGPU. I didn't really intend this PR to also include that... I'm not sure how I managed to do that.

@MiiBond
Copy link
Contributor Author

MiiBond commented May 28, 2025

Opened 2 PR's for IBL shadow fixes and for geometryBuffer compile fixes in WebGPU
#16686
#16687

Once those are in, I will open up a new PR with viewer fixes.

@MiiBond MiiBond marked this pull request as draft May 28, 2025 17:20
@MiiBond MiiBond changed the title Fix compile error for WebGPU and animated meshes Viewer fixes for IBL Shadows (Draft) May 28, 2025
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

Successfully merging this pull request may close these issues.

4 participants