Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 14 Aug 2011
Offline Last Active Mar 04 2012 07:06 AM

Posts I've Made

In Topic: Rendering the depth buffer?

04 March 2012 - 05:16 AM

You should just just be able to allocate a texture with an internal format of GL_DEPTH_COMPONENT, and call glCopyTexSubImage2D to copy the contents of the depth buffer into that texture. After that, you can render a fullscreen quad with the texture, or whatever else you want...

This looks like exactly what I was thinking. However, I cannot find the proper code for it, and I fear guessing it from scratch will end in utter failure (I am not a veteran). Is there an example or perhaps even a tutorial of this exact method somewhere?

However, unless you are restricted to an ancient version of OpenGL, I would recommend using an FBO (Frame Buffer Object), to render the depth buffer directly to a texture in the first place. Or even a shader, to render the z coordinate into the colour buffer, and save having to render multiple passes at all.

Partly due to my not being veteran, but also because of a long and boring story about what I'm doing (which I'll spare you), I would like to at least try without FBOs or shaders first, if there is a way?

In Topic: Rendering the depth buffer?

03 March 2012 - 05:34 PM

The buffer copy or swap is something I've looked at, but found no syntax on. If anyone has the slightest thread on this, I'm all ears!

The fog is not going to do it, since it is not just to fake the look, it's an actual depiction of distances that I need :-/ However, the basic idea miiiight have something to it, if I can find no other option...

In Topic: Rendering the depth buffer?

03 March 2012 - 03:07 PM

I'm not using shaders. I thought that since the Z-buffer exists somewhere (I assume, or things would overlap, and my clearing the depth buffer would affect nothing), I should be able to simply(??) swap it for the color buffer. I clear the two things in the same line (glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)), so they should be using similar logic... or am I making wild assumptions?

In Topic: Small problem with the lessons (all of them, I think)

21 August 2011 - 11:19 AM

Great, I am sure it will many happy :D And don't worry about the hovers, they are not a matter of life and death, the site is fantastic both with and without. But they are indeed icing on the yummy cake ;)

Thank you for a marvelous site, keep up the excellent work!!!