Skip to content

Math.Unproject

Name Mandatory Description Default Type
⬅️ Input Takes a float3 vector representing the 3D vector where x and y are screen coordinates, and z is the depth value in screen space. Float3
Output ➡️ Outputs a float3 vector representing the unprojected 3D point in world space. Float3
Matrix No The combined 4x4 view-projection matrix (sequence of four float4 vectors) to use. none [Float4](4)Var([Float4](4))
ScreenSize No The float2 vector representing the size of the screen or viewport in pixels. none Float2Var(Float2)
DepthRange No The float2 vector representing the range of depth values (near and far planes). Default is [0, 1]. none NoneFloat2Var(Float2)
FlipY No Flip Y coordinate (on by default) true NoneBoolVar(Var(Bool))

This shard converts 2D screen coordinates back to 3D world coordinates using the inverse of a view-projection matrix. Both 3D and 2D coordinates are represented as float3 vectors (vectors with 3 float elements).It performs the reverse operation of the projection pipeline, including inverse matrix multiplication, and coordinate space transformations using the 4x4 view-projection matrix specified in the Matrix parameter and the screen size in the ScreenSize parameter.