View Full Version : Fast rendering to texture.
09-12-2000, 12:40 PM
I'm doing some real time cube mapping, and currently the production of the cube map is very slow. I'm doing a loop 6 times, that clears the buffers, renders everything, does a glFinish, and uses glCopyTexImage2D to copy the framebuffer into the texture. Because the buffers aren't swapped, the user sees none of this. Any ideas how to speed it up?
09-12-2000, 02:00 PM
The current pipeline to fetch a framebuffer is too SLOW, and when i say SLOW, i mean really slow (on an AGP 4x, you could get 10 fps doing cubemapping), because transmitting a complete 640x480 (low resolution image) through the AGP or PCI bus is a real bandwidth hog, and in the current state of drivers of general consumer 3d accelerators, the fetching of a complete image isn't very optimized. Maybe in a near future we all have NV-30 (!!) integrated to our motherboards, using system memory, and then, the bus transfers would be blazingly fast.
NOTE: If you try the cube mapping technique (or just try to fetch the framebuffer) on an SGI Cobalt, you will see the difference between a GeForce and a real Workstation 3D accelerator
09-13-2000, 12:32 AM
So I assume to make it faster I have to do much smaller renders for the textures. Wonder how fast it is to setup the viewport each frame, to say do a 128x128 render instead.
Anyone else got any speedup tricks?
09-13-2000, 02:38 AM
Right, I'm using glViewport(0, 0, 128, 128);
prior to generating the 6 images for the cube map, and I'm getting around 40 to 50 frames per second, on 2 dynamic cube map generations per frame. I Also took out clearing the frame buffer, as there shouldn't be any pixels left unrendered to.
09-13-2000, 11:30 AM
You can use for every iteration of the loop a different glViewport, say:
and so on, but, be careful..
Fetching the a part of the framebuffer in some cards don't just take only the part you specify, but rather, take the whole screen and then crop it.... too bad for me, i have a 3d accelerator that does this technique...
09-14-2000, 05:12 AM
Yup that would be good, eliminating all those glFinish's and clear z buffers.
What card do you have? Which takes the entire screen and crops it?
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.