Inconsistent built-in matrices

Could someone who is more familiar with Unity explain how the MVP shader is constructed in the shader?
Not only are the matrices constructed in script unusable in the shader,even built-in values in shaders don’t work. :?

I tried to construct the MVP matrix from the builtin glstate values like this,just to test it,but even this doesn’t work,the object just disappears :frowning:

float4x4 mvp =mul(glstate.matrix.modelview[0],glstate.matrix.projection);

shouldn’t it be identical to the glstate.matrix.mvp?
I’d really appreciate it if Unity could provide some more documentation about values passed to the shader,possibly even allowing us to add more variables.

Matrices are left-multiplied onto vectors, so in your case the multiplication order should be:

MVP = P*MV

Yeah,thats actually how it was originally,thought for a moment it might be other way around in the Cg,it still doesn’t work.