[PD] GEM: multitexturing in GEM

cyrille henry cyrille.henry at la-kitchen.fr
Thu Jul 12 11:00:29 CEST 2007


hello,

thanks a lot for this exemple.
it work great.

do you know a good online or printed resource for learning ARB fragments?

thanks
Cyrille


chris clepper a écrit :
> I have attached a very simple patch and shader for adding two textures 
> together.
> 
> The shader needs to be loaded after window creation and rendering
> starts to work correctly.  The shader has some basic comments about
> what the commands do.  You can replace the ADD with MUL to get a
> different effect to get started.
> 
> 
> ------------------------------------------------------------------------
> 
> !!ARBfp1.0
> 
> #basic multi-texture shader
> #adds two textures together
> 
> #Declarations
> TEMP tmp, tmp1;
> TEMP curr;
> 
> 
> #grab the texture coords
> ATTRIB tex = fragment.texcoord[0];
> ATTRIB tex1 = fragment.texcoord[0];
> 
> #set output
> OUTPUT out = result.color;
> 
> #pick which texture unit to get the pixels from
> #texture[x] selects the texunit
> TEX tmp, tex, texture[0], RECT;
> TEX tmp1, tex1, texture[1], RECT;
> 
> #simple addition of the pixels
> ADD out, tmp, tmp1;
> 
> END




More information about the Pd-list mailing list