- Home /
Declaring a matrix parameter in a shader
Hi,
I'm writing a shader, and it would be convenient for me to expose a matrix (for programmable parameter insertion) rather than four vectors. I see that the material class has a SetMatrix function, but can only find predefined examples of using that.
I would like to do something like
_MyMat ("My Matrix", Matrix) = (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)
In my shader, but can't get the syntax to compile. Does anyone know if its possible, and if so, what the syntax is?
Thanks!
Answer by Bunny83 · Mar 16, 2011 at 08:46 PM
Well, i wasn't able to figure out if shaderlab supports matrix properties. The Unity docs doesn't say anything about that but in cg - shaders it seems to be possible, at least as global uniform parameter.
Most matrices are available by default (as far as i know), but i'm not really into shader development in Unity yet.
We need a shader guru here ;)
Your answer
Follow this Question
Related Questions
Shader Fusion (Detail-map, how to) 1 Answer
Custom Shader not working on Android Device 0 Answers
Where can we find the Specular/Base shader pass script ? 1 Answer
How to write Diffuse shader with Pass{} instead of surface? 1 Answer
toonLighted shader to work with deferred rendered shadows 2 Answers