Jump to content
  • Advertisement

Archived

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

dslprog

OpenGL Radiosity and OpenGL

This topic is 5293 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
Advertisement
my pixle format is:

PIXELFORMATDESCRIPTOR pfd;
INT pixelformat;

pfd.nSize = sizeof( PIXELFORMATDESCRIPTOR );

pfd.nVersion = 1;
pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!