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 4 of 4

Thread: ambiant occlusion (obscurances)

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2004
    Posts
    1

    ambiant occlusion (obscurances)

    Hi,
    hello, has anybody implemented the ambiant occlusion in opengl?. can somebody send me a sample code as how to implement it.

    It would be greatful if somebody help me out. I will be most thankful.

    regards and thanks in adwance,
    srinivas reddy

  2. #2
    Member Regular Contributor
    Join Date
    Feb 2002
    Location
    Hamburg, Germany
    Posts
    415

    Re: ambiant occlusion (obscurances)

    the NVIDIA SDK has an example.

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Oct 2000
    Location
    Belgium
    Posts
    857

    Re: ambiant occlusion (obscurances)

    Not a very practical approach, though, unless you just want to render still images.

    To make the technique useful for realtime rendering, you'd need to precompute the ambient occlusion term. You can do this by shooting rays in random directions away from the surface, and counting the percentage of them that are occluded by the surface itself. You could store this information per vertex, but you'd need very fine tessellation to make this look good. It's better to store it in a texture, but that implies that you need a unique UV mapping on your mesh.

    If you go this route, the actual rendering part is just simple texture mapping, so it's very fast.

    -- Tom

  4. #4
    Junior Member Newbie
    Join Date
    May 2004
    Location
    Italy
    Posts
    11

    Re: ambiant occlusion (obscurances)

    If you need a piece of code that computes a static per-vertex ambient occlusion term using Opengl, you can look at the sources of ShadeVis tool that is available under GPL at

    http://vcg.sourceforge.net/tiki-index.php?page=ShadeVis

    As explained by Tom Nuydens the most common techniques to compute ambient occlusion is based on shooting rays from each surface element to evaluate the quantity of light that reach it. Shadevis tools use OpenGL to accellerate this process by simply rendering the scene ortographically from a set of uniformely distributed directions and checking against the zbuffer if each vertex is occluded or not.

    The Shadevis tool is oriented to handle rather large, finely tessalated, meshes; we have successfully used it on a 8M triangle mesh of the David on a 512Mb machine.

    P.

Posting Permissions

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