5,337
edits
Line 105: | Line 105: | ||
===Perspective Projection Matrix=== | ===Perspective Projection Matrix=== | ||
[https://www.scratchapixel.com/lessons/3d-basic-rendering/perspective-and-orthographic-projection-matrix/building-basic-perspective-projection-matrix https://www.scratchapixel.com/lessons/3d-basic-rendering/perspective-and-orthographic-projection-matrix/building-basic-perspective-projection-matrix] | [https://www.scratchapixel.com/lessons/3d-basic-rendering/perspective-and-orthographic-projection-matrix/building-basic-perspective-projection-matrix https://www.scratchapixel.com/lessons/3d-basic-rendering/perspective-and-orthographic-projection-matrix/building-basic-perspective-projection-matrix] | ||
===Inverting the projection=== | |||
If you have the depth (either z-depth or euclidean depth), you can invert the projection operation. | |||
The idea is to construct a ray from the camera to the pixel on a plane of the viewing frustrum and scale the distance accordingly. | |||
See [https://gamedev.stackexchange.com/questions/108856/fast-position-reconstruction-from-depth/111885#111885 stackexchange]. | |||
==Shading== | ==Shading== |