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

Handle vertex_uvs if they are present in default prepass fragment shader #8330

Merged
merged 3 commits into from
Apr 23, 2023

Conversation

IceSentry
Copy link
Contributor

@IceSentry IceSentry commented Apr 8, 2023

Objective

  • Enabling AlphaMode::Opaque in the shader_prepass example crashes. The issue seems to be that enabling opaque also generates vertex_uvs

Fixes #8273

Solution

  • Use the vertex_uvs in the shader if they are present

@IceSentry IceSentry added A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior labels Apr 8, 2023
@alice-i-cecile alice-i-cecile requested review from superdump and JMS55 and removed request for superdump April 8, 2023 18:15
@prime31
Copy link

prime31 commented Apr 8, 2023

Minor nitpick: the comment “Opaque cube using the StandardMaterial” should say “CustomMaterial”

@nicopap
Copy link
Contributor

nicopap commented Apr 20, 2023

Could using a common Vertex definition between the prepass and the mesh shader help avoid similar issues in the future? I wrote a patch at https://gist.github.com/nicopap/be825768467ad2285ad5a345aa502786

The branch is at https://github.com/nicopap/bevy/tree/cleanup-prepass

@IceSentry
Copy link
Contributor Author

Could using a common Vertex definition between the prepass and the mesh shader help

Maybe, but they technically aren't the same. For example, vertex_color shouldn't really be part of the prepass. There's also things in the prepass vertex output that aren't part of the main pass vertex output like the previous_world_position used for motion vectors

@IceSentry IceSentry added this to the 0.11 milestone Apr 22, 2023
@mockersf mockersf added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Apr 23, 2023
@mockersf mockersf added this pull request to the merge queue Apr 23, 2023
Merged via the queue into bevyengine:main with commit 3f6367d Apr 23, 2023
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 S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

shader_prepass example crashes with opaque CustomMaterial
5 participants