Declaring a matrix parameter in a shader


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?


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 :wink: