feat: configure stencil operations for 3D as 2D shader#835
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds configurable stencil support to the URP “Toon 3D as 2D” shader and exposes the new stencil controls in the custom material inspector UI.
Changes:
- Added shader properties for stencil ref/compare/pass/fail and wired them into the shader’s
Stencil{}block. - Added editor UI (“Shader Settings” → “Stencil”) to edit these properties per-material.
- Introduced editor constants/helpers to populate enum popups and support indented header layout.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| com.unity.toonshader/Runtime/Shaders/URP/ToonURP_3Das2D.shader | Replaces hardcoded stencil state with material-driven stencil properties. |
| com.unity.toonshader/Runtime/Scripts/ToonConstants.cs | Adds shader property name constants for the new stencil properties. |
| com.unity.toonshader/Editor/Scripts/Utilities/ToonEditorGUIUtility.cs | Adds a helper to get an indented header rect for foldout header groups. |
| com.unity.toonshader/Editor/Scripts/ToonEditorConstants.cs | Adds enum option arrays intended for stencil compare/op popups (currently incorrect—see comment). |
| com.unity.toonshader/Editor/Scripts/GUI/UnityToon3Das2DGUI.cs | Adds a “Shader Settings” foldout with stencil controls and registers the properties in the UI element list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.