[PD] Blending mode directly on objects, not pixes?

IOhannes m zmölnig zmoelnig at iem.at
Sat Nov 28 23:53:18 CET 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Matteo Sisti Sette wrote:
> Hi,
> 
> Now, I don't know if this is possible at all.
> 
> Suppose I have a [rectangle] (or whatever primitive indeed) with a
> texture, and something behind the rectangle.
> Is it possible to have the rectangle "blend" with the background with
> some blending mode (such as add, multiply, etc)?
> (without having to render all the rest of the scene except the rectangle
> into a texture via gemframebuffer, and then blending the two textures
> with pix_add and friends)???
> 

there's [env $1( (with $1=0..5 or so) to [pix_texture] which will give
you a number of different blending modes.

there's a bug in the released versions of Gem, that will set the
blending mode for all texture blendings. so you might want to reset it
after you changed it.
should be fixed in svn/trunk.


then you can (in a very limited way) change the general blending
function (no tex involved) by sending a number to the 2nd inlet to [alpha].
if you want more control, use [GEMglBlendFunc] (and get a copy of the
openGL red book to see what it does and what you can do)



> Isn't it a matter of shaders? I guess it could be achieved using openGL
> functions... but is there a "simple" way?

that will give you all the flexibility in the world.


fgamsdr
IOhannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksRqd4ACgkQkX2Xpv6ydvTutwCfWX7iJbhbfUQeJ7qhOOh+FBgL
clEAoONVjuv9vXSP4BCWRQvR7XpPspRl
=rdbt
-----END PGP SIGNATURE-----




More information about the Pd-list mailing list