JetBrains / JetBrains/resharper-unity
Rider suggests naming pattern in shader that is incompatible with some shader functions.
- Dominant language
- C#
- Stars
- 1.2k
- Forks
- 142
- PR merge metrics
- No merged PRs in 30d
Description
If you create a new project and a new Shader file in Rider you will notice that Rider already complains about some variables inside of the shader like _Glossiness or _Metallic... Rider wants to rename this to "glossiness" so that it has no capital letters.
I can't find any way to adjust this naming rule for shaders and it's also weird that the standard template is already wrong.
Further more you have to use capital letters for variables in order to use the function TRANSFORM_TEX. This function expects that some variable like _MainTex_ST exists. The "ST" needs to be in capital letters otherwise it wont work.
For this reason we currently disabled code inspection for shader files but of course we would like to reenable this.
Thanks for reading!
Contributor guide
Research direction
No files, tests, or entry points are named. Reproduce the warning in Rider with a new Unity project and Shader file, then inspect the shader naming inspection and its configuration. Done means Unity shader names such as _Glossiness, _Metallic, and _MainTex_ST no longer produce incompatible warnings, while inspection can be reenabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- unity
- Domain
- computer-graphics, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100