fix(rendering): add planar shadow rendering support for new render pipeline#19187
Open
UC-RX0 wants to merge 1 commit into
Open
fix(rendering): add planar shadow rendering support for new render pipeline#19187UC-RX0 wants to merge 1 commit into
UC-RX0 wants to merge 1 commit into
Conversation
|
Too many files changed for review. ( |
…peline The new render pipeline ForwardPass incorrectly used TRANSPARENT_OBJECT and RENDER_TRANSPARENT for the planar shadow queue, causing shadow casters to never match. scene-culling.ts also filtered out PLANAR_SHADOW via kDrawMask. This change: - Adds PLANAR_SHADOW to kDrawMask in scene-culling.ts - Fixes planar shadow queue in forward-pass.ts to use RENDER_OPAQUE with OPAQUE_OBJECT/CUTOUT_OBJECT - Adds PLANAR_SHADOW and SHADOW_CASTER flags for correct model filtering Fixes: cocos#19158
d38908f to
ca0e31b
Compare
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
Code Size Check Report
Interface Check ReportThis pull request does not change any public interfaces ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Planar shadows render correctly in the Legacy Pipeline but do not appear at all when using the New Render Pipeline in Cocos Creator 3.8.8.
Root Cause
The new render pipeline's forward pass setup (
buildForwardPassindefine.tsandsetupForwardPassinpipeline-define.ts) incorrectly includedSceneFlags.PLANAR_SHADOWin the main opaque queue. This added planar shadow casters to the opaque render queue, causing them to be rendered with their default material instead of the planar shadow projection pass.There was no dedicated queue for the
planar-shadowphase, unlike the shadow map path which correctly uses a separateshadow-casterqueue.Fix
SceneFlags.PLANAR_SHADOWfrom the opaque queueplanar-shadowphase (matchingPlanarShadowQueuein legacy pipeline)SHADOW_CASTERflag to filter only shadow-casting modelsOPAQUE_OBJECT | CUTOUT_OBJECTflags for correct queue processingPLANAR_SHADOWflag for correct frustum selection in scene cullingData Flow
Changes
cocos/rendering/custom/define.ts: +13/-1 lines (buildForwardPass)cocos/rendering/custom/pipeline-define.ts: +13/-1 lines (setupForwardPass)Fixes: #19158
Changelog