I want to know the difference between o.pos and worldPos . thank you
VertexOutput vert (VertexInput v){
VertexOutput o;
o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
float3 worldPos = mul (_Object2World, v.vertex).xyz;
}
I want to know the difference between o.pos and worldPos . thank you
VertexOutput vert (VertexInput v){
VertexOutput o;
o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
float3 worldPos = mul (_Object2World, v.vertex).xyz;
}
Wrong forum, moved.
o.pos is Clip space.
worldPos is World space.
o.pos is view space? screen space? x,y,z are between 0-1 or -1,1
Clip space.
So, this space limits x,y from -1 to 1 and z from -1 to1 (opengl)
0 to 1 for z (Direct3d)