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

Thread: Reflection using frame buffer

  1. #1
    Junior Member Newbie
    Join Date
    May 2013
    Posts
    12

    Reflection using frame buffer

    water reflection just using scaling glScalef(1, 1, -1) is being blocked by terrain under water.
    So i think it would be better if reflection is first stored in framebuffer.
    but how can i project the rendered texture on the water

  2. #2
    Junior Member Newbie
    Join Date
    Jun 2013
    Posts
    25
    If you wanted to do things the first way that you tried you might temporarily disable depth testing. If the reflection is drawn after the terrain that was hiding it, it should now still be visible. You could also try glScalef(1, 1, -0.7), instead, this might keep the reflection above the underwater terrain as well.

    If you want to render to an FBO, then you'd draw the reflection to an FBO. Once that's done, the FBO texture should behave like any other texture. Apply it to the water as a texture just like you normally would.

Posting Permissions

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