Sign in to follow this  
zhugeLiuyun2003

Problem with VBO when rendered to bitmap

Recommended Posts

Hi folks, I am currently experimenting on the use of VBOs. I managed to render to window using VBOs. However, when I changed my display surface to a bitmap (i.e. render_to_bitmap), I can't get the function address for the necessary VBO functions. For eg, glGenBuffers = (PFNGLGENBUFFERSPROC) wglGetProcAddress( "glGenBuffers" ); Failed to get a valid address to the function. Does that mean VBO only work if I render to a window?? Please advice. Regards, Sky.

Share this post


Link to post
Share on other sites
udaykv    126
No, no such thing. The wglGetProcAddress is requesting an address to a function, and is doing just that, and has no knowledge of where you'd be rendering your scene to. Put up some code where you're getting this problem.

Share this post


Link to post
Share on other sites
Kalidor    1087
It is probably because no hardware supports PFD_DRAW_TO_BITMAP so you are getting a software implementation which doesn't support VBOs. Are you checking if VBOs are supported before trying to use them?

Share this post


Link to post
Share on other sites
Hi udaykv,

You are right! If I select my display surface to be PFD_DRAW_TO_BITMAP, software renderer by microsoft is used instead of the hardware renderer by Nvidia..and so VBO is not supported.

So what kind of card supports PFD_DRAW_TO_BITMAP? Is this the same as pBuffer?

What other options do I have to achieve accelerated off-screen rendering? pBuffer, FrameBuffer Objects?

Casting all these aside, I actually turned to the use of our good old-time display lists and realize something is also wrong with rendering to bitmap.
Take a look at the images rendered using display lists below:

Image captured when rendered to window
Above image is captured when rendered to window. Nothing wrong.

Rendered to bitmap
Above image is the one using render to bitmap. Notice the artifacts.

Rendered to bitmap from a nearer view
Above image is the one using render to bitmap when I go nearer. Notice the artifacts are gone.

Are those artifacts due to some resolution limitations when doing software rendering? How can I resolve these?

Thanks n regards,
Sky.

Share this post


Link to post
Share on other sites
bpoint    464
I ran into the same problem a few weeks ago.

Basically, PFD_DRAW_TO_BITMAP means no hardware acceleration. Period.

Your images are broken links (they point to your local drive :) ), but you're probably right at assuming that the artifacts are caused by Microsoft's software renderer.

Your only two options are pbuffers or FBOs. For me, I needed it to work on older hardware (Geforce 2), so I had to go with pbuffers. Even still, implementing pbuffers was easy since wglShareLists did all of the hard work for me.

Good luck!

Share this post


Link to post
Share on other sites
Thanks bpoint for your suggestion. I've implemented pBuffer (with quite an effort for the setting up!) and as expected, those artifacts are gone. Though I still don't understand how come software renderer can cause those artifacts, but I guess I can safely assume that nowadays, no one would wanna use PFD_DRAW_TO_BITMAP given any simple decent graphics card.


Regards,
Sky.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this