On Thu, Nov 20, 2008 at 2:40 PM, Steve <[EMAIL PROTECTED]> wrote:

>
> I would like to grab an arbitrarily shaped area of the color buffer,
> or draw an image to the screen with a separately rendered mask.
> Accomplishing either task would help solve my problem. Can anyone
> point me in the right direction? I wish I could make my question more
> specific, but I don't think I will be able to until I have a general
> idea of what I need to implement.


For a really simple approach, you can use multi-texturing with
multiplicative blending against a mask texture. This will mask any areas
where the mask texture is 0, and leave any areas where it is 1, but it may
not be the most flexible approach.

If you are using shaders, you can use a mask texture and a pixel shader to
render only the unmasked portion of another texture (use the discard
instruction for masked pixels).

If you aren't using shaders, you may be able to work something out with the
stencil buffer, although this wont be as straightforward.

I may come back later asking about ways to speed up a flood fill
> algorithm. I have some ideas already, but I think I will probably end
> up having to either live with a slow algorithm or write a C extension,
> which I hear is a pain on OS X.


C extensions are pretty much identical on OS X to linux, although you do
need to pass the compiler a few different options. If you need help
constructing a makefile for a C extension, I have several extension modules
building cross-platform, so I can probably explain the process.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to