Skip to content

Conversation

Lichtso
Copy link

@Lichtso Lichtso commented Sep 12, 2025

Objective

Fixes #20941

Solution

Implemented the missing MeshPipelineKey::VIEW_PROJECTION_* in check_views_lights_need_specialization() and PrepassPipeline::specialize().

Testing

I implemented a Material with a custom shader pipeline which uses these keys and added light sources with shadows_enabled. Before this change the material only appeared in the normal forward pass, after it also appears in the shadows.

Copy link
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@alice-i-cecile alice-i-cecile added C-Feature A new feature, making something new possible A-Rendering Drawing game state to the screen D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Sep 12, 2025
Copy link
Contributor

@atlv24 atlv24 left a comment

Choose a reason for hiding this comment

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

this is good, i think i'd extract the match into a variable so that the statement is less crazy looking but good other than that

@atlv24
Copy link
Contributor

atlv24 commented Sep 14, 2025

alternatively something like this

light_key.set(MeshPipelineKey::VIEW_PROJECTION_ORTHOGRAPHIC | MeshPipelineKey::UNCLIPPED_DEPTH_ORTHO, is_directional_light);
light_key.set(MeshPipelineKey::VIEW_PROJECTION_PERSPECTIVE, !is_directional_light);

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-Feature A new feature, making something new possible D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Specialization keys VIEW_PROJECTION_* in depth prepass for shadow maps
3 participants