Portal View/Projection Matrix near plane

Posted by melak47 on Game Development See other posts from Game Development or by melak47
Published on 2012-11-06T10:55:36Z Indexed on 2012/11/06 17:23 UTC
Read the original article Hit count: 193

Filed under:
|
|

For RenderToTexture/Camera based portal rendering, the basics seems simple enough.

However, with a free camera, most of the time it is going to be looking at such portals at an angle:

view volumes

Now a regular near clipping plane will not always work here, it will either intersect with the wall the portal is sitting on, or possibly with objects in front of the wall.

The desired near clipping plane would be aligned like the portal, producing a view volume more like this:

enter image description here

or this in 3D: enter image description here

So here is my question:

How does one construct or "truncate" a view/projection matrix to achieve such an off-camera-normal (near) clipping plane?

© Game Development or respective owner

Related posts about 3d

Related posts about math