- Home /
How do you hide a shader property?
There's this method...
ShaderUtil.IsShaderPropertyHidden
...but what's the ShaderLab syntax to make a property hidden?
Comment
Answer by RC-1290 · May 11, 2014 at 09:02 PM
You can hide Material Properties using using [HideInInspector] in front of the attribute
[HideInInspector]_SomethingHidden ("This text isn't shown", Float) = 1
This is useful when you have a property that is only set through a script, that should still have a default value when it's not set. Regular default values for global variables in Cg are ingored; the variables are set to 0 instead. Adding a Material property allows you to set the default value there. Which the HideInInspector attribute then hides from the user.
Answer by whydoidoit · Mar 23, 2013 at 11:45 AM
Don't declare it in the properties block - just code the definition of the variable.