Results 1 to 5 of 5

Thread: OpenGL : Clipping GL_FOG to a region...

  1. #1

    OpenGL : Clipping GL_FOG to a region...

    Hi all,
    Does anyone out there have a simple demo that shows how to clip GL_FOG to a rectangular region? Or point me in the right direction.

    Thanks.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  2. #2

    OpenGL : Clipping GL_FOG to a region...

    You could create a stencil mask revealing the "clipped" area.

    Then you render two times, with and without FOG using the correct
    stecil mode.

  3. #3

    OpenGL : Clipping GL_FOG to a region...

    Thanks for the reply.

    Unfortunately I just realised that the problem is actually the difference between DirectX and OpenGL near/far values.

    Do you, or anyone else, know how to convert from DirectX near/far fog values to OpenGL start/end values?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  4. #4

    OpenGL : Clipping GL_FOG to a region...

    The calculations for fog in D3D and OGL are exactly the same when it comes to the fixed function pipeline. I use the exact same values for both the d3d and ogl at work.

  5. #5

    OpenGL : Clipping GL_FOG to a region...

    Do the same values for for LINEAR FOG? Do you have to set things up differently in OpengL compared to Direct3D? In the Mac Port I'm working on, the D3D values just don't look right on the Mac.

    How do you hanlde Fog Density across both APIs then?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

Bookmarks

Posting Permissions

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