NV Oblique Frustum Clipping demo

来源:互联网 发布:如何劫持域名 编辑:程序博客网 时间:2024/06/03 01:46
Back
ATTACHMENTS
  • Direct3D Demo (.zip) ( 541 KB)
  • OpenGL Demo (.zip) ( 350 KB)

Oblique Frustum Clipping

 
 

code_75.gifThis example aligns the hardware near clip plane with an aribitraily oriented, user specified plane.  The result is that you get an arbitrary near clip plane for no cost, since depth values below zero will be clipped by the hardware.  The projection matrix is modified to shear the Z values to align with the user specified clip plane.

Because the projection matrix is modified, the depth values are different. This is fine for uses like render-to-texture or rendering mirror or portal views, but it cannot be arbitrarily enabled and disabled within a scene the way you can with user clipping planes.

Demos for both DirectX and OpenGL are available as attachments.

Please note that the 'x' key toggles between geometry clip plane and projection matrix near clip plane.


0 0