Sign in to follow this  
linyang

PBUFFER without Texture. PBUFFER

Recommended Posts

Hi, everybody. I am trying to save my depth buffer in a faster way. It seems that pbuffer is a kinda frame buffer which is stored on GPU. I read through several samples and found all the samples are using pbuffer with texture. They always have two texture ids and bind to both buffer and do glCopyTexSubImage2D(). However, my implementation is different. I am drwing objects such as triangles and lines directly on the screen but never use texture. Am I still able to utlize pbuffer in this situation? If so, how can I storage my stuff into pbuffer. I am using displaylist.:) Thank you all.

Share this post


Link to post
Share on other sites
No reply?

Is it a good way to do glDrawPixels with pbuffer?

How am I able to save the stuff into pbuffer? Is it using wglMakeCurrent() and then do rendering?

Thanks

Share this post


Link to post
Share on other sites
PBuffer is usually used in conjunction with textures to render scene and then copy to texture and then use texture for texture mapping. This is an alternative to rendering to the back buffer and copying the back buffer to the texture. The second method is slower, because the copying of the backbuffer needs to complete before any further rendering can happen. With Pbuffer, this is not necessary, because the data from pbuffer can be copied while a new scene starts rendering onto the backbuffer.

As for rendering scene directly to the screen, I clearly do not see how a pbuffer would be used to optimize.

SporadicFire

Share this post


Link to post
Share on other sites
Quote:
Original post by linyang
However, my implementation is different. I am drwing objects such as triangles and lines directly on the screen but never use texture. Am I still able to utlize pbuffer in this situation?

Yes, of course. A pbuffer is just an offscreen surface, and while many people use it for render-textures (awaiting a better solution), it doesn't have to be used that way. Pbuffers can be useful in many situations that don't involve textures at all.

Check out the WGL_ARB_make_current_read extension, which makes copying between different surfaces much easier and faster. Another way to store your screen to an offscreen buffer is the WGL_ARB_buffer_region extension.

Share this post


Link to post
Share on other sites
Quote:
Original post by Yann L
Quote:
Original post by linyang
However, my implementation is different. I am drwing objects such as triangles and lines directly on the screen but never use texture. Am I still able to utlize pbuffer in this situation?

Yes, of course. A pbuffer is just an offscreen surface, and while many people use it for render-textures (awaiting a better solution), it doesn't have to be used that way. Pbuffers can be useful in many situations that don't involve textures at all.

Check out the WGL_ARB_make_current_read extension, which makes copying between different surfaces much easier and faster. Another way to store your screen to an offscreen buffer is the WGL_ARB_buffer_region extension.


Followed your instruction, I used wglMakeContextCurrentARB and try to copy stuff between to DCs. However, even I just make a simple test program, I still cannot draw the stuff I rendered on 'off-screen' buffer to the screen.

Could you please help me out with some example code or something? Thank you so much.

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