On Dec 21, 2007 2:46 PM, Alexandre Quessy <<a href="mailto:listes@sourcelibre.com">listes@sourcelibre.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br><br>2007/12/21, chris clepper <<a href="mailto:cgclepper@gmail.com">cgclepper@gmail.com</a>>:<br><div class="Ih2E3d">> Please stop saying this. These features do work apart from reading texture<br>> coordinates from units other than zero.
<br><br></div>Hmm, I have to dig a bit into this. Any example of a GLSL shader with<br>mutlitexturing ?<br></blockquote><div><br>Several have been posted to the list. But below is a very basic one:<br> </div>varying vec2 texcoord1;
<br>varying vec2 texcoord2;<br><br>void main()<br>{<br> <br> texcoord1 = gl_MultiTexCoord0.st;<br> // texcoord2 = gl_MultiTexCoord1.st;<br> // gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;<br><br> gl_Position = ftransform();
<br><br>}<br><br><br>uniform sampler2DRect MyTex;<br>uniform sampler2DRect MyTex1;<br><br>varying vec2 texcoord1;<br>varying vec2 texcoord2;<br><br>void main (void)<br>{<br><br> vec4 color = texture2DRect(MyTex, texcoord1);
<br> vec4 color2 = texture2DRect(MyTex1, texcoord1);<br> vec4 temp = color * color2;<br> gl_FragColor = temp;<br><br>}<br><br>Obviously, this only works correctly if the textures are the same dimensions. <br><br><br><br>
</div><br>