   FBO for Shadow Map
  I just need to know how to put the damn thing into a texture unit to be used for the depth comparison during shadow mapping.http://pastebin.com/m553f8f78View ActivateTexture().If FBO is not supported I fall back on glCopyTexSubImage2D(), which is shown in BeginRender() and EndRender() at the bottom.  I included these functions simply to illustrate the difference between binding the FBO to be a render target and binding it to be a texture.When using the fallback glCopyTexSubImage2D() method, I get results such as these:http://img188.imageshack.us/img188/1673/screen9k.pnghttp://img5.imageshack.us/img5/8361/screen11q.pngIt all works fine.  But the depth texture is jagged because I am limited to window dimensions for depth texture size.I need FBO to surpass this limitation, and all that remains is to get the damn thing into the texture unit.Thank you,L. Spiro   
  You need to attach a Render attachment, which acts like a Texture.Phantoms fantastic tutorial Framebuffer Objects 101 will show you how to do this:http://www.gamedev.net/reference/programming/features/fbo1/;  That is the tutorial I used to make my FBO implementation.In my code you can see I use a regular texture for the color buffer and my depth is a render buffer (that is what they do in the tutorial).Are you saying I need to make a depth texture (::glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, _ui32Width, _ui32Height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL );) and bind that in addition to the depth buffer I already gave it?  Or do I replace my existing depth buffer with the one shown above?L. Spiro   ;  Many apologies, didn't realise it was the Depth component that you were needing. I haven't tried it but instead of rendering the texture as colour, if you use GL_DEPTH_COMPONENT as your parameter, as in your last post, this should give you the texture you need.   ;http://www.opengl.org/wiki/GL_EXT_framebuffer_object_More_about_FBOs#Depth_only;  Thank you.http://img8.imageshack.us/img8/5706/screen12ood.pngL. Spiro   