PDA

View Full Version : Can I output my buffer to the screen faster?



03-14-2002, 01:41 PM
I want to make an animation using my ray tracer. In order to speed up my ray traced scene, I store each pixel in a float array(RGB). When all of the frames have been stored, I write them out to the screen one pixel at a time with GLColor3f(...)and then call SwapBuffers() (since I'm using double buffering) at the end of each frame rendering.
Is there a faster way to push the array into GLColor? Does anyone have a better way to do this?

Osku
03-14-2002, 03:24 PM
Hello

Upload your frames as textures instead, and then just display the textures one after another when you're done. This should be _much_ faster.

Osku

witcomb
03-14-2002, 03:27 PM
Yes, first convert that to a normal unsigned byte image, this alone will make for an improvement. Second, try using glDrawPixels with the entire image on an orthographic viewport. The other option is to create trianglar mesh that uses the image as a texture and you just update the texture and rerender the mesh for the next frame.

I don't use any of these methods, I have instead choose to either use X in linux or DirectDraw in windows, but these should help for sure.

Neil Witcomb

03-14-2002, 06:14 PM
Originally posted by witcomb:
Yes, first convert that to a normal unsigned byte image, this alone will make for an improvement. Second, try using glDrawPixels with the entire image on an orthographic viewport. The other option is to create trianglar mesh that uses the image as a texture and you just update the texture and rerender the mesh for the next frame.

I don't use any of these methods, I have instead choose to either use X in linux or DirectDraw in windows, but these should help for sure.

Neil Witcomb

Thanks. I used glDrawPixels and my scenes are drawing faster than I had even hoped.
- Kwan