   How to render to texture with opengl
  I finally got around to trying to implement shadow mapping on opengl just as a learning exercise and I found that I have no idea how to set render targets in OpenGL. I know in GLSL, you can write to gl_FragData[n] but how do you set what texture corresponds to that? I read up a little on FBO (Frame Buffer Objects) and it seems to do what I'm looking for. But it surprised me that it's still an EXT extension since DirectX seemed to have had the ability to set render targets for a while now and one would assume that OpenGL would have had this important feature put in the spec by now. So I tried leafing through the OpenGL 2.1 specifications and I couldn't find any standardised way of setting render targets aside from using extensions like FBO or pbuffers. Am I missing something? Is there really no standard method in OpenGL to set render targets or even multiple render targets?   
  Look at the Texture Buffer Object 201 Article in the OpenGL Section on this site. There is cleary explanied how to render to multiple targets.   ;  You can look at my examplehttp://steps3d.narod.ru/downloads/msrt-src.zip - it shows how to render to serveral render targets and uses FBO's to render to.   