-
Notifications
You must be signed in to change notification settings - Fork 203
Refactor urp #717
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
base: master
Are you sure you want to change the base?
Refactor urp #717
Conversation
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 refactors shader code by introducing a reusable UV variable and removing obsolete code comments. The changes improve code maintainability by eliminating repeated UV transformations and cleaning up deprecated assignments.
Changes:
- Introduced
mainTexUVvariable to cache UV transformations instead of recalculating them multiple times - Removed obsolete version comments and deprecated
_Color = _BaseColorassignment - Applied consistent UV variable usage across texture sampling operations
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| UniversalToonBodyShadingGradeMap.hlsl | Added mainTexUV variable and replaced inline UV transformations with the cached variable; removed deprecated color assignment |
| UniversalToonBodyDoubleShadeWithFeather.hlsl | Added mainTexUV variable and replaced inline UV transformations; removed deprecated color assignment and version comments |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const float4 secondShadeTex = lerp(SAMPLE_TEXTURE2D(_2nd_ShadeMap, sampler_MainTex, TRANSFORM_TEX(Set_UV0, _MainTex)),firstShadeTex, _Use_1stAs2nd); | ||
| const float4 mainTex = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, mainTexUV); | ||
| const float4 firstShadeTex = lerp(SAMPLE_TEXTURE2D(_1st_ShadeMap, sampler_MainTex, mainTexUV),mainTex, _Use_BaseAs1st); | ||
| const float4 secondShadeTex = lerp(SAMPLE_TEXTURE2D(_2nd_ShadeMap, sampler_MainTex, mainTexUV),firstShadeTex, _Use_1stAs2nd); |
Copilot
AI
Jan 16, 2026
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.
Missing space after comma in function calls. Add a space after the comma following 'mainTexUV' to maintain consistent code formatting with other function calls in the file.
| const float4 secondShadeTex = lerp(SAMPLE_TEXTURE2D(_2nd_ShadeMap, sampler_MainTex, mainTexUV),firstShadeTex, _Use_1stAs2nd); | |
| const float4 secondShadeTex = lerp(SAMPLE_TEXTURE2D(_2nd_ShadeMap, sampler_MainTex, mainTexUV), firstShadeTex, _Use_1stAs2nd); |
| const float4 firstShadeTex = lerp(SAMPLE_TEXTURE2D(_1st_ShadeMap, sampler_MainTex, mainTexUV),mainTex, _Use_BaseAs1st); | ||
| float3 Set_1st_ShadeColor = lerp((_1st_ShadeColor.rgb * firstShadeTex.rgb),((_1st_ShadeColor.rgb * firstShadeTex.rgb) * Set_LightColor), _Is_LightColor_1st_Shade); | ||
| const float4 secondShadeTex = lerp(SAMPLE_TEXTURE2D(_2nd_ShadeMap, sampler_MainTex, TRANSFORM_TEX(Set_UV0, _MainTex)),firstShadeTex, _Use_1stAs2nd); | ||
| const float4 secondShadeTex = lerp(SAMPLE_TEXTURE2D(_2nd_ShadeMap, sampler_MainTex, mainTexUV),firstShadeTex, _Use_1stAs2nd); |
Copilot
AI
Jan 16, 2026
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.
Missing space after comma in function calls. Add a space after the comma following 'mainTexUV' to maintain consistent code formatting with other function calls in the file.
No description provided.