Skip to content

fix(preview): keep material mesh visible after inspector apply - #885

Open
looopmax wants to merge 1 commit into
cocos:mainfrom
looopmax:fix/material-preview-empty-phase
Open

fix(preview): keep material mesh visible after inspector apply#885
looopmax wants to merge 1 commit into
cocos:mainfrom
looopmax:fix/material-preview-empty-phase

Conversation

@looopmax

@looopmax looopmax commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Drop dump-default empty phase overrides before material preview rebuilds passes.
  • Keep named or numeric phase overrides unchanged.
  • Cover empty vs named/invalid phase handling in unit tests.

Cause

Material inspector dumps encode an unset effect pass phase as ''. Pass.fillPipelineInfo treats any defined phase as an override, and getPhaseID('') registers a unique unused render phase. After Apply, the preview camera still draws the default phase, so the mesh disappears.

Verification

  • npx jest src/core/scene/test/material-preview-states.test.ts
  • npx tsc -b --pretty false
  • npm run build:static-web

@looopmax
looopmax requested a review from bofeng-song August 25, 2026 08:52
Inspector dumps encode an unset pass phase as an empty string.
Applying that override made getPhaseID('') register a unique unused
render phase, so the preview mesh disappeared. Drop empty phase
overrides before rebuilding passes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@looopmax
looopmax force-pushed the fix/material-preview-empty-phase branch from 7afa5bc to 5fca023 Compare August 25, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants