Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PBuffer questions



Hi Cyril,

I think that these are different cases...you'd use glCopyTexSubImage2D to get data from the frame buffer to a texture...copying the frame buffer depth component to a depth texture and copying RGB pixels to an RGB texture both work.

When using a pbuffer, the pbuffer can only have one texture format, so it can only be color or depth by API limitation, but in this case you wouldn't call glCopyTexSubImage2D at all.

In other words (if I have understood all of this) if you need to have access to color and depth data from a buffer, you need to use glCopyTexSubImage2D and the framebuffer, not a pbuffer.

(For what it's worth, glCopyTexSubImage2D seems to be real fast when the formats line up. :-)

*Cheers*
Ben


Cyril Kardassevitch wrote:
Yes, and yes. For the former, as long as the pixel format for the context attaching to the pixel format has the attributes for a depth buffer, the pixel buffer itself will have a depth buffer. For the latter, make sure that you set the internalFormat argument for CGLCreatePBuffer to GL_DEPTH. That will ensure that any textures created from the PBuffer are depth textures. There is a limitation in the PBuffer API right now that means you can't use the PBuffer as both a color and depth texture.


Do you mean that it is impossible to copy (via glCopyTexSubImage2D...) both the color and the depth components into 2 different textures ?
In this case how can we do transparent (colored) shadows for exemple ?



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden

This email sent to email@hidden
References: 
 >PBuffer questions (From: bsupnik <email@hidden>)
 >Re: PBuffer questions (From: "Kenneth C. Dyke" <email@hidden>)
 >Re: PBuffer questions (From: Cyril Kardassevitch <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.