Original Post
I'm trying to develop an app that approximates radiosity. The main ideas are taken from a SIGGRAPH '97 paper called "Instant Radiosity". But I think that the framerate I'm getting is too slow for what I'm rendering. I get about 8fps and I'm only rendering a Cornell Box. I'm running on a Radeon 9600 Pro. The algorithm works like this:
Starting at your main light source, you do some voodoo sampling and you generate a bunch of point light sources scattered throughout your scene to approximate radiosity. This part only needs to be done when the scene changes. The way I'm sampling right now, the algorithm uses 33 lights (1 main light + 32 generated lights).
Rendering happens like this:
for( each light source )
{
// Generate shadow map
RenderLightView
// Render scene with shadows
RenderCameraView
// Basically the same as glAccum
AccumulateImage
}
RenderAccumulatedImageToBackbuffer
I am using shaders for everything in the app. Not using the fixed funciton pipeline at all. I am using floating point render targets for the shadow map and also for accumulating the individual images because I don't want to suffer from precision issues.
What I'm worried about is that constantly changing render targets and shaders could be killing my performance. Each of the functions in the pseudo-code above use a different set of shaders and each of them has to set a rendertarget and possibly a depth buffer and viewport. Also, some of these steps require me to set different vertex and index buffers.
I know that I could render the scene using multiple light sources in each pass and I plan on doing that, but I still don't think that the performance should be that bad when I render a single light source per pass.
If anyone has any ideas, please let me know. I need to try to make this as fast as possible.
Thanks,
neneboricua
[edited by - neneboricua19 on September 10, 2003 2:41:29 AM]