Getting textures from P-Buffers for use as cube maps

I was wondering how people generate dynamic cube maps. I understand how to do it. You just render six orthogonal views and bind them into the respective GL_ARB_CUBE_MAP_* and there she be. The situation is that I am using a P-Buffer for rendering the six views and then I use the WGL_ARB_RENDER_TO_TEXTURE extension (wglBindTexImageARB()). But obviously this doesn’t really work because i need to do this six times. And of course you need all 6 of the cube maps at once. So how I see it no matter what I somehow have to do some form of glGetImage2d() between each orthogonal pass in the p-buffer and then I bind the 6 textures and then I draw the cube mapped object. Basically I want to know what is the best way to generate dynamic cube maps. The P-buffer is nice and render to texture works great. The P-Buffer allows me to use low res textures (compared to the screen res anyway) which is good because as we all know glReadPixels is just inherently slow. (Its a lot of data to copy).

Whats everyone’s experience with this.

Thanks, I am quite curious.

Happy Coding.

There is a function in that extension for setting which face to render to, I think that’s what you need. You may want to look into my RenderTexture class, source is at my site:

There’s an example of how to do this in the WGL_ARB_render_texture specification (a paragraph titled something like “intended use”).

– Tom

Ahhhhhhh that helps a lot. I have looked through that spec sheet on nvidia’s website before (OK OK browsed) and I never got that far down to where then mention intended use.

Thanks a lot.

Happy Coding.