Skip to content

feat: configure stencil operations for 3D as 2D shader#835

Merged
sindharta merged 12 commits into
masterfrom
2d-stencil
Jun 16, 2026
Merged

feat: configure stencil operations for 3D as 2D shader#835
sindharta merged 12 commits into
masterfrom
2d-stencil

Conversation

@sindharta

Copy link
Copy Markdown
Collaborator

No description provided.

@sindharta sindharta changed the title 2d stencil feat: configure stencil operations for 3D as 2D shader Jun 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Comment thread com.unity.toonshader/Editor/Scripts/ToonEditorConstants.cs Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comment thread com.unity.toonshader/Editor/Scripts/GUI/UnityToon3Das2DGUI.cs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@sindharta sindharta merged commit 60b313c into master Jun 16, 2026
32 checks passed
@sindharta sindharta deleted the 2d-stencil branch June 16, 2026 05:20
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