create depth texture , nearplane, question

Hello,
how can I render the depth values of the near plane into
a depth texture ? i need the z values to compare with
geometry.

regards,
lobbel

You can use an FBO, and attach a texture to the depth attachment point (glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, …).