[Merged by Bors] - Fix dependency of shadow mapping on the optional PrepassPlugin#7878
[Merged by Bors] - Fix dependency of shadow mapping on the optional PrepassPlugin#7878geieredgar wants to merge 9 commits intobevyengine:mainfrom
PrepassPlugin#7878Conversation
|
While investigating #7879, I have found a third issue: When using custom materials, the default |
Co-authored-by: Robert Swain <robert.swain@gmail.com>
robtfm
left a comment
There was a problem hiding this comment.
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>
PrepassPluginPrepassPlugin
…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.
PrepassPluginnow.prepass.wgslshader, but this does not always define a fragment entry point.This PR fixes 2. and 3. and resolves #7879.
Solution
PrepassPlugininto two plugins:PrepassPipelinePlugincontains the part that is required for the shadow mapping to work and is unconditionally added.PrepassPluginnow only adds the systems and resources required for the "real" prepasses.prepass.wgsl, used ifNORMAL_PASSis not defined.