Oh yes of course i wasn't thinking...
Camera Position (0, 10, -5)
FOV (horizontal) = 45
Width = 1000
Height = 800
So, FOV (vertical) = 54.75
This obviously leads to (bottom left)
frustumFarWorld ( -517.8, -414.2, 995, 1.000 )
So it's wrong... again
Edit: I just realized that my matrix multiplication order is wrong.... Anyway i got the correct result (finally). I have no idea why i chose to do this instead of just calculating values in view space in the first place. I decided to do that instead so sorry for wasting your time :/
Anyway, if anyone's interested, here's the final code to convert from screen space to object space:
float4 frustumNearWorld = FrustumNear[input.index];
float4 frustumFarWorld = FrustumFar[input.index];
float z = Proj._34 / (frustumNearWorld.z - Proj._33);
frustumNearWorld.xyz = float3(frustumNearWorld.x * z / Proj._11, frustumNearWorld.y * z / Proj._22, z);
z = Proj._34 / (frustumFarWorld.z - Proj._33);
frustumFarWorld.xyz = float3(frustumFarWorld.x * z / Proj._11, frustumFarWorld.y * z / Proj._22, z);
frustumNearWorld = mul(InvView, frustumNearWorld);
frustumFarWorld = mul(InvView, frustumFarWorld);
Where:
FrustumFar[0] ( -1.000, -1.000, 1.000, 1.000 )
FrustumFar[1] ( -1.000, 1.000, 1.000, 1.000 )
FrustumFar[2] ( 1.000, 1.000, 1.000, 1.000 )
FrustumFar[3] ( 1.000, -1.000, 1.000, 1.000 )
FrustumNear[0] ( -1.000, -1.000, 0, 1.000 )
FrustumNear[1] ( -1.000, 1.000, 0, 1.000 )
FrustumNear[2] ( 1.000, 1.000, 0, 1.000 )
FrustumNear[3] ( 1.000, -1.000, 0, 1.000 )
"Spending your life waiting for the messiah to come save the world is like waiting around for the straight piece to come in Tetris...even if it comes, by that time you've accumulated a mountain of shit so high that you're fucked no matter what you do. "