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

Include the material bind group in the shadow batch set key. #17738

Merged
merged 1 commit into from
Feb 8, 2025

Conversation

pcwalton
Copy link
Contributor

@pcwalton pcwalton commented Feb 8, 2025

Right now, meshes aren't grouped together based on the bindless texture slab when drawing shadows. This manifests itself as flickering in Bistro. I believe that there are two causes of this:

  1. Alpha masked shadows may try to sample from the wrong texture, causing the alpha mask to appear and disappear.

  2. Objects may try to sample from the blank textures that we pad out the bindless slabs with, causing them to vanish intermittently.

This commit fixes the issue by including the material bind group ID as part of the shadow batch set key, just as we do for the prepass and main pass.

Right now, meshes aren't grouped together based on the bindless texture
slab when drawing shadows. This manifests itself as flickering in
Bistro. I believe that there are two causes of this:

1. Alpha masked shadows may try to sample from the wrong texture,
   causing the alpha mask to appear and disappear.

2. Objects may try to sample from the blank textures that we pad out the
   bindless slabs with, causing them to vanish intermittently.

This commit fixes the issue by including the material bind group ID as
part of the shadow batch set key, just as we do for the prepass and main
pass.
@pcwalton pcwalton added A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior P-Regression Functionality that used to work but no longer does. Add a test for this! S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Feb 8, 2025
@alice-i-cecile alice-i-cecile added this to the 0.16 milestone Feb 8, 2025
@superdump superdump added this pull request to the merge queue Feb 8, 2025
Merged via the queue into bevyengine:main with commit bcfc086 Feb 8, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior P-Regression Functionality that used to work but no longer does. Add a test for this! S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants