Skip to content

Conversation

@sindharta
Copy link
Collaborator

No description provided.

cursoragent and others added 3 commits December 25, 2025 09:40
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
@cla-assistant-unity
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ sindharta
❌ cursoragent
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

Copilot AI left a 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";

Copy link

Copilot AI Dec 26, 2025

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.

Suggested change

Copilot uses AI. Check for mistakes.
}

return srpDefaultLightModeName;
return ToonConstants.SHADER_LIGHT_MODE_NAME_FOR_OUTLINE;
Copy link

Copilot AI Dec 26, 2025

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.

Copilot uses AI. Check for mistakes.
@sindharta sindharta changed the title Consolidate toon shader constants refactor: consolidate shader constants Dec 29, 2025
@sindharta sindharta merged commit 7d044d6 into master Dec 29, 2025
23 of 24 checks passed
@sindharta sindharta deleted the consolidate-toon-shader-constants branch December 29, 2025 02:18
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.

3 participants