-
Notifications
You must be signed in to change notification settings - Fork 203
refactor: consolidate shader constants #696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: sindharta.tanuwijaya <sindharta.tanuwijaya@unity3d.com>
Co-authored-by: sindharta.tanuwijaya <sindharta.tanuwijaya@unity3d.com>
…onsolidation-b208 Cursor/toon shader constants consolidation b208
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR consolidates shader property constant definitions by moving legacy Toon 3D shader property names into the centralized ToonConstants.cs file and replacing local constant definitions across editor GUI classes with references to these centralized constants.
Key Changes:
- Added 23 new constants for legacy Toon 3D shader properties to
ToonConstants.cs - Removed duplicate constant definitions from editor GUI classes
- Updated all references to use the centralized constants from
ToonConstants
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| com.unity.toonshader/Runtime/Scripts/ToonConstants.cs | Added centralized constants for Toon 3D legacy shader property names |
| com.unity.toonshader/Editor/UTS3GUI.cs | Replaced local shader property constants with references to centralized ToonConstants |
| com.unity.toonshader/Editor/ToonGUI-RenderingPerChannel.cs | Updated shader keyword references to use ToonConstants |
| com.unity.toonshader/Editor/Scripts/GUI/UnityToon3Das2DGUI.cs | Replaced local constant definitions with ToonConstants references and updated property name mappings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| internal const string SHADER_PROP_TOON3D_IS_BAKED_NORMAL = "_Is_BakedNormal"; | ||
| internal const string SHADER_PROP_TOON3D_BAKED_NORMAL = "_BakedNormal"; | ||
|
|
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace on line 120 should be removed to maintain code cleanliness.
| } | ||
|
|
||
| return srpDefaultLightModeName; | ||
| return ToonConstants.SHADER_LIGHT_MODE_NAME_FOR_OUTLINE; |
Copilot
AI
Dec 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The unused local constant srpDefaultLightModeName has been removed, but the usage of ToonConstants.SHADER_LIGHT_MODE_NAME_FOR_OUTLINE suggests this constant should be defined in ToonConstants.cs. Verify that this constant exists in the ToonConstants file, as it's not visible in the provided diff.
No description provided.