Shader "Cg basic shader"
{
SubShader
{
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
float4 vert(float4 vertexPos : POSITION) : SV_POSITION
{
//float4x4 myMatrix = UNITY_MATRIX_P * UNITY_MATRIX_V * unity_ObjectToWorld;
//float4x4 myMatrix = unity_ObjectToWorld * UNITY_MATRIX_V * UNITY_MATRIX_P;
float4x4 myMatrix = UNITY_MATRIX_MVP;
return mul(myMatrix, vertexPos);
}
float4 frag(void) : COLOR
{
return float4(1.0, 0.0, 0.0, 1.0);
}
ENDCG
}
}
}
Replacing line 18 with line 17 does not produce the same result. What am I misunderstanding?