Mailing Lists: Apple Mailing Lists

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

Alpha blending issue



This is more a general OpenGL question, but it is for a Mac project, so I'm hopeful it is permissible here: I'm drawing a number of textures with alpha to context 1 using (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA), and in context 1 things look great.  But then I'm using context 1 as a source texture for drawing to context 2, and am getting some artifacts where the original drawing in context 1 involved alpha values other than 1 or 0.  I assume this is because, as the spec says, blending affects the alpha component of the destination pixels as well as the color components, so that when context 1 becomes a texture, it has non-1.0 alpha values in it.  And indeed, if I turn off blending for the draw from context 1 -> context 2, everything is OK.  But for a variety of reasons (I'm simplifying the situation to describe it here) I can't adopt that solution.  So, my question is: once drawing into context 1 is complete, is there a way to force all of the alpha values in context 1 to be 1.0 before drawing it into context 2, so that it will draw correctly even with blending enabled?

Many thanks for any thoughts.

Mark Batten

 _______________________________________________
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



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.