#I don't understand material.HasMatrix

1 messages · Page 1 of 1 (latest)

tight siren
#

When does material.HasMatrix return true? I tried to give it the name of a matrix that's in a SubShader block - since I can set it with SetMatrix(name, matrix), I assumed that I could check if it existed with HasMatrix(name), but no luck.

As far as I can tell, all the material.HasXXX functions checks if there's a corresponding thing of the correct type in the Properties block of the shader.
And also, as far as I can tell, there's no way to put a matrix in the Properties block. I can at least not find it in the documentation, and google just tells me that matrices are set from code.

Is there a way I can declare a matrix in the Properties block? Or some other way to make a matrix "visible" to HasMatrix?

tacit heron
#

Do you call HasMatrix before or after SetMatrix ?

#

Indeed matrices can't be defined in the properties block of a .shader file, but once the matric is set, it is "saved" on the material instance.

misty sky