After recently complaining to Matt Craighead on this forum about OpenGL’s absent but oft-rumored “Render-To-Texture” extension, i ran some benchmarks comparing GL’s glCopyTexSubImage2D vs DX8’s SetRenderTarget.
Using both our D3D and GL graphics engines, i benchmarked the FPS in a room with 12 curved mirrors and 20 spinning teapots (~10k triangles total). Each mirror used its own rendered-on-the-fly texture at 512x512.
Test machines were the same (768meg, 1ghz P3). I used a GeForce2GTS and Radeon64DDR with the latest public drivers. Both the GL and DX demos scored roughly the same frame-rate.
Average Framerates at 640x480
GL DX8
GeForce 31.4 29.8
Radeon 19.4 24.3
GL was higher on GeForce and DX was higher on Radeon. No GL extensions were used and the vertex buffers for DX8 were updated each frame so as to pair evenly with GL’s per frame vertex array.
Considering that a 512x512 RGBA 32bit texture is exactly 1meg, and the internal bandwidth of this generation of video cards is rather enormous (memory clock * bandwidth >= several gig, ex 200mhz SDR * 128bits = 6.4gig ), it is reasonable to assume that the overhead of the copying in CopySubTexImage is actually minimal. (Minimal when compared to serious bottlenecks such as the AGP issues of moving your verts to the card)-
Anyways, thought this may be of use to those who ponder/question DX8 render-to-texture advantages-