On Fri, Apr 2, 2010 at 6:39 AM, Asacolips <[email protected]> wrote: > I was curious as to how I might be able to use different blending > modes in pyglet. I'm assuming it's possible, since OpenGl seems to > have the functionality and pyglet uses that for transparency, I'm just > not sure how to approach it at the moment. The main use I would have > for this would be for various graphical situations such as fire, > particles, 2d hdr-like graphics, etc. An example of the some of the > modes I might be using would be additive, subtractive, multiply, etc.
If you're using pyglet sprites, this is the blend_dest and blend_src arguments to the Sprite constructor (which sadly just appear as integers in the documentation, but do have human-readable names in the code). If you're not using sprites, you can just call glBlendFunc manually. http://www.glprogramming.com/red/chapter06.html#name1 has details on GL's fixed-function blending via glBlendFunc. It's pretty flexible but if you need other kinds of blending you can use a pixel shader. -- You received this message because you are subscribed to the Google Groups "pyglet-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pyglet-users?hl=en.
