Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


OpenGL Radiosity and OpenGL

This topic is 5371 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I''m doing a Radiosity engine, and using OpenGL to take advantage of the hardware. What I do is to calculate the light maps rendering the entire scene from the point of view of each patch, read the frame buffer with glReadPixels, and finally show the result. This operation use to take several minutes, but when my window is not shown or when there''s another window over it, it ends up almost instantly, and the light maps are not properly calculated. Do I need to set up the pixel format with PFD_DRAW_TO_BITMAP? Does anybody know what''s going on?

Share this post

Link to post
Share on other sites
my pixle format is:

INT pixelformat;

pfd.nSize = sizeof( PIXELFORMATDESCRIPTOR );

pfd.nVersion = 1;
pfd.dwLayerMask = PFD_MAIN_PLANE;
pfd.iPixelType = PFD_TYPE_RGBA;
pfd.cColorBits = m_ScreenDepth;
pfd.cDepthBits = m_ScreenDepth;
pfd.cAccumBits = 0;
pfd.cStencilBits = 0;

and i dont have the same problem youre talking about.

Share this post

Link to post
Share on other sites
Bits of the frame buffer that are not visible on the screen have "undefined" contents. This usually means "junk".

If you set PFD_DRAW_TO_BITMAP you will get Microsoft''s software OpenGL version 1.1. That''s not very fast, nor capable.

The solution is to use pbuffers, which are offscreen, and "almost always" valid (there''s a query for when you need to re-establish them).

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!