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

[Merged by Bors] - Remove dependency on the mesh struct in the pbr function #7597

Closed
wants to merge 1 commit into from

Conversation

kurtkuehnert
Copy link
Contributor

Objective

Currently, it is quite awkward to use the pbr function in a custom shader without binding a mesh bind group.
This is because the pbr function depends on the MESH_FLAGS_SHADOW_RECEIVER_BIT flag.

Solution

I have removed this dependency by adding the flag as a parameter to the PbrInput struct.

I am not sure if this is the ideal solution since the mesh flag indicates both MESH_FLAGS_SIGN_DETERMINANT_MODEL_3X3_BIT and MESH_FLAGS_SHADOW_RECEIVER_BIT.
The former seems to be unrelated to PBR. Maybe the flag should be split.

@kurtkuehnert kurtkuehnert added A-Rendering Drawing game state to the screen C-Usability A targeted quality-of-life change that makes Bevy easier to use labels Feb 10, 2023
@alice-i-cecile
Copy link
Member

Spelling nit for the title: singular is "dependency" in English :)

@kurtkuehnert kurtkuehnert changed the title Remove dependencie on the mesh struct in the pbr function Remove dependency on the mesh struct in the pbr function Feb 10, 2023
@kurtkuehnert
Copy link
Contributor Author

Ups, Grammarly didn't catch that 😅.

Copy link
Contributor

@superdump superdump left a comment

Choose a reason for hiding this comment

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

bors r+

bors bot pushed a commit that referenced this pull request Feb 20, 2023
# Objective

Currently, it is quite awkward to use the `pbr` function in a custom shader without binding a mesh bind group.
This is because the `pbr` function depends on the `MESH_FLAGS_SHADOW_RECEIVER_BIT` flag.

## Solution

I have removed this dependency by adding the flag as a parameter to the `PbrInput` struct.

I am not sure if this is the ideal solution since the mesh flag indicates both `MESH_FLAGS_SIGN_DETERMINANT_MODEL_3X3_BIT` and `MESH_FLAGS_SHADOW_RECEIVER_BIT`.
The former seems to be unrelated to PBR. Maybe the flag should be split.
@bors bors bot changed the title Remove dependency on the mesh struct in the pbr function [Merged by Bors] - Remove dependency on the mesh struct in the pbr function Feb 20, 2023
@bors bors bot closed this Feb 20, 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-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants