Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: OpenGL Depth buffer  (Read 1926 times)

0 Members and 1 Guest are viewing this topic.

DEElekgolo

  • Newbie
  • *
  • Posts: 2
    • AOL Instant Messenger - DEElekgolo
    • View Profile
OpenGL Depth buffer
« on: June 30, 2011, 05:54:02 am »
I realize that the openGL context is created for me but how would I manage getting the depth buffer out of it so I pass it to my GLSL shader?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
OpenGL Depth buffer
« Reply #1 on: July 02, 2011, 10:33:11 pm »
To do what you want, you must use Frame Buffer Objects (FBO). Copying the back buffer to a texture manually would be very very slow.
Laurent Gomila - SFML developer

DEElekgolo

  • Newbie
  • *
  • Posts: 2
    • AOL Instant Messenger - DEElekgolo
    • View Profile
OpenGL Depth buffer
« Reply #2 on: July 02, 2011, 11:38:33 pm »
So I should be binding my own frame buffer/render buffer rather than getting the buffers that the window context already uses?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
OpenGL Depth buffer
« Reply #3 on: July 03, 2011, 09:31:55 am »
If you want to use them as textures, yes.
Laurent Gomila - SFML developer