1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-01 07:45:36 +00:00

omw_GetWorldPosFromUV() should use omw_GetDepth()

This commit is contained in:
Mads Buvik Sandvei 2022-08-21 17:43:54 +02:00
parent 537c6e96ab
commit 70e1efdd47

View file

@ -196,7 +196,7 @@ mat4 omw_InvProjectionMatrix()
#if (OMW_REVERSE_Z == 1)
float flippedDepth = 1.0 - depth;
#else
float flippedDepth = omw_Texture2D(omw_SamplerDepth, uv).r * 2.0 - 1.0;
float flippedDepth = depth * 2.0 - 1.0;
#endif
vec4 clip_space = vec4(uv * 2.0 - 1.0, flippedDepth, 1.0);
vec4 world_space = omw.invViewMatrix * (omw.invProjectionMatrix * clip_space);