The quad is completely white. Ok, maybe I'm setting up the texture wrong. Check some examples, tweak things a bit, check some of my old code, everything looks good for another try.
Now the depth texture looks like its full of random stuff. It never gets updated, but the actual scene is updating quite nicely.
What am I doing wrong? *bangs head against wall for an hour or two*
I just needed to to:
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
before rendering the depth. That's all I was missing.
I don't think it matters what the clear color is. Either way, the depth buffer is cleared. But what if I want to clear it to zero and not infinity? Hmmm.
ReplyDelete