So that means that the position what comes out of the vertex program and then comes in to the fragment program, are the same ( since multiplying by the MVP already gives me the vertex position in clip space).
So in theory, I could move the perspective division and multiplication operations to the fragment shader, and it should result in the same results, but they aren’t ( it comes all white ).
SV_POSITION semantic has different meaning when used in vertex and pixel shader respectively. It is a position in clip space in vertex shader and screen space position in pixel shader. So in your pixel shader i.pos.x is in range from 0 to screenWidth and i.pos.y is in range from 0 to screenHeight. SV_POSITION in pixel shader is an replacement for VPOS semantic from the old days. It will only work under DX10 and up or equivalent OpenGL.
There it says that ( on the left) after the perspective divide , you get “Normalized Device Coordinates - real” ( and by real I suppose that they are referring to screen size in pixels) , but according to this (section 4.1.10) and this you only get the “real” coordinates after the viewport transform, so in the normalized device coordinates you still have the homogeneous form. Is that correct?
Cheers
(and btw that image I got it from here section 9.3.1)
I guess by “real” they mean “not homogeneous”. You have 4D homogeneous clips space, you do perspective divide and you have NDC. NDC is 3D space where x and y are in range [-1, 1] and z is in range [-1, 1] on OpenGL and [0, 1] on DirectX. Then you apply viewport transform and you have screen space (or window space in that picture).