I'm following MJP's article:
So I draw a fullscreen quad with the following vertices:
PVertex vertices[] =
{
PVertex(-1.0f, -1.0f, 1.0f),
PVertex(-1.0f, 1.0f, 1.0f),
PVertex(1.0f, 1.0f, 1.0f),
PVertex(1.0f, -1.0f, 1.0f)
};
And the vertex shader looks like this:
VS_OUT VS(VS_IN vIn)
{
VS_OUT vOut;
vOut.posH = float4(vIn.posL, 1.0f);
#ifdef DIRECTIONAL_LIGHT
vOut.positionVS = mul(float4(vIn.posL, 1.0f), gInvView);
#else
vOut.positionVS = mul(float4(vIn.posL, 1.0f), gWorld).xyz;
#endif
return vOut;
}
However positionVS gets values like: (-0.736, -0.414, 1.0); which is far from a far frustum corner position in view space...