[PD] My project at IEM

chris clepper cgclepper at gmail.com
Fri Dec 21 22:19:32 CET 2007


On Dec 21, 2007 2:46 PM, Alexandre Quessy <listes at sourcelibre.com> wrote:

> Hi,
>
> 2007/12/21, chris clepper <cgclepper at gmail.com>:
> > Please stop saying this.  These features do work apart from reading
> texture
> > coordinates from units other than zero.
>
> Hmm, I have to dig a bit into this. Any example of a GLSL shader with
> mutlitexturing ?
>

Several have been posted to the list.  But below is a very basic one:

varying vec2 texcoord1;
varying vec2 texcoord2;

void main()
{

    texcoord1 = gl_MultiTexCoord0.st;
   // texcoord2 = gl_MultiTexCoord1.st;
   // gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;

    gl_Position = ftransform();

}


uniform sampler2DRect MyTex;
uniform sampler2DRect MyTex1;

varying vec2 texcoord1;
varying vec2 texcoord2;

void main (void)
{

 vec4 color = texture2DRect(MyTex, texcoord1);
 vec4 color2 = texture2DRect(MyTex1, texcoord1);
 vec4 temp = color * color2;
 gl_FragColor = temp;

}

Obviously, this only works correctly if the textures are the same
dimensions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20071221/8f902e2f/attachment.htm>


More information about the Pd-list mailing list