-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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] - Fix dependency of shadow mapping on the optional PrepassPlugin
#7878
Conversation
While investigating #7879, I have found a third issue: When using custom materials, the default |
Co-authored-by: Robert Swain <robert.swain@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does work, but I don't think adding the dummy fragment shader should be necessary. instead we can just not add the FragmentState in PrepassPipeline::specialize()
when the material_fragment_shader
is None
.
StandardMaterial
returns a handle, so that will behave correctly. Custom Materials that return None would not add a frag shader, which would be more efficient.
0.10 is looming though, so if there isn't time then this is fine as is
… shader Except if the normal prepass is run.
This reverts commit 50cb4b2.
Ok, I adjusted the fragment state condition and its comment, reverted the fragment entry point commit and tested that the |
bors r+ |
# Objective Unfortunately, there are three issues with my changes introduced by #7784. 1. The changes left some dead code. This is already taken care of here: #7875. 2. Disabling prepass causes failures because the shadow mapping relies on the `PrepassPlugin` now. 3. Custom materials use the `prepass.wgsl` shader, but this does not always define a fragment entry point. This PR fixes 2. and 3. and resolves #7879. ## Solution - Add a regression test with disabled prepass. - Split `PrepassPlugin` into two plugins: - `PrepassPipelinePlugin` contains the part that is required for the shadow mapping to work and is unconditionally added. - `PrepassPlugin` now only adds the systems and resources required for the "real" prepasses. - Add a noop fragment entry point to `prepass.wgsl`, used if `NORMAL_PASS` is not defined. Co-authored-by: Edgar Geier <geieredgar@gmail.com>
PrepassPlugin
PrepassPlugin
…yengine#7878) # Objective Unfortunately, there are three issues with my changes introduced by bevyengine#7784. 1. The changes left some dead code. This is already taken care of here: bevyengine#7875. 2. Disabling prepass causes failures because the shadow mapping relies on the `PrepassPlugin` now. 3. Custom materials use the `prepass.wgsl` shader, but this does not always define a fragment entry point. This PR fixes 2. and 3. and resolves bevyengine#7879. ## Solution - Add a regression test with disabled prepass. - Split `PrepassPlugin` into two plugins: - `PrepassPipelinePlugin` contains the part that is required for the shadow mapping to work and is unconditionally added. - `PrepassPlugin` now only adds the systems and resources required for the "real" prepasses. - Add a noop fragment entry point to `prepass.wgsl`, used if `NORMAL_PASS` is not defined. Co-authored-by: Edgar Geier <geieredgar@gmail.com>
Objective
Unfortunately, there are three issues with my changes introduced by #7784.
PrepassPlugin
now.prepass.wgsl
shader, but this does not always define a fragment entry point.This PR fixes 2. and 3. and resolves #7879.
Solution
PrepassPlugin
into two plugins:PrepassPipelinePlugin
contains the part that is required for the shadow mapping to work and is unconditionally added.PrepassPlugin
now only adds the systems and resources required for the "real" prepasses.prepass.wgsl
, used ifNORMAL_PASS
is not defined.