Hi,
This is probably a stupid question, but since there is a poor documentation about shader, I hope some will be able to answer me :x
So, as I understood it, for passing a float from c# to shader, we need to do it in 3 step:
-
something.material.SetFloat("_MyFloat", 5f)
C# side -
_MyFloat("A description", Float) = 0.0
Shader side. (ShaderLab properties) -
float _MyFloat;
Shader side (Inside the CGPROGRAM)
–
at the step one I can use SetArrayFloat()
But, at the step two unity doesn’t allow Float[]
.
and the step 3 allow float _MyValue[]
–
So how can I achieve it ?