Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Razor's edge and near clip plane

  1. #1
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    San Diego, CA, USA
    Posts
    769

    Razor's edge and near clip plane

    I'm doing some global illumination stuff. For my final gather, I place a camera at various points in my scene and do a render.

    Here's the problem: The placement of my camera can be arbitrarily close to a corner (define for now as anywhere two planes meet at a right angle). Say I put the camera at the top of a wall. If it is close enough to the roof, the roof will be clipped by the near frustum plane and almost half my render will be black (incorrect, as the wall should pick up lighting from the roof and not see the black void beyond the roof).

    Question: Given a point on a planar surface and it's normal, is there a mathematical formula for _exactly_ where I would have to place the camera and _exactly_ what the near clip plane value should be to avoid having any of the ceiling clipped out? Is there some other trick to get around a problem like this? Can I put the near clip plane slightly behind the camera?

  2. #2
    Senior Member OpenGL Pro cass's Avatar
    Join Date
    Feb 2000
    Location
    Austin, TX, USA
    Posts
    1,058

    Re: Razor's edge and near clip plane

    Hi Zeno,

    On NVIDIA hardware (GeForce 3 and beyond), you can use NV_depth_clamp to avoid clipping stuff at the near plane.

    Other solutions would be a bit messier.

    Thanks -
    Cass
    Cass Everitt -- cass@xyzw.us

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Location
    San Diego, CA, USA
    Posts
    769

    Re: Razor's edge and near clip plane

    Originally posted by cass:
    On NVIDIA hardware (GeForce 3 and beyond), you can use NV_depth_clamp to avoid clipping stuff at the near plane.
    Thanks Cass, that extension is exactly what I was looking for.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •