void main()<br>{<br> gl_TexCoord[0] = gl_MultiTexCoord0;<br> gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;<br><br>}<br><br>uniform sampler2DRect MyTex;<br><br>void main (void)<br>{<br> vec4 color = texture2DRect(MyTex, gl_TexCoord[0].st);
<br> color = color* 0.5;<br> gl_FragColor = color;<br>}<br><br>Works on OSX.<br><br>Change use sampler2D and texture2D for non-rectangle textures. Or use arb_fragment program which is more straightforward and performs better.
<br><br>cgc<br><br><div><span class="gmail_quote">On 8/25/06, <b class="gmail_sendername">cyrille henry</b> <<a href="mailto:cyrille.henry@la-kitchen.fr">cyrille.henry@la-kitchen.fr</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This does not change anything : my primitive is still black.<br>thanks<br>Cyrille<br><br><br>chris clepper a écrit :<br>> Add<br>><br>> gl_TexCoord[0] = gl_MultiTexCoord0;<br>><br>> To your vertex program.<br>
><br>><br>> On 8/25/06, *cyrille henry* < <a href="mailto:cyrille.henry@la-kitchen.fr">cyrille.henry@la-kitchen.fr</a><br>> <mailto:<a href="mailto:cyrille.henry@la-kitchen.fr">cyrille.henry@la-kitchen.fr
</a>>> wrote:<br>><br>> hello,<br>><br>> i'm trying to learn glsl.<br>> I can't find how to use texture in the fragment shader.<br>> does anyone have an exemple how to load texture with GEM glsl?
<br>><br>> thanks<br>> Cyrille<br>><br>> _______________________________________________<br>> GEM-dev mailing list<br>> <a href="mailto:GEM-dev@iem.at">GEM-dev@iem.at</a> <mailto:
<a href="mailto:GEM-dev@iem.at">GEM-dev@iem.at</a>><br>> <a href="http://lists.puredata.info/listinfo/gem-dev">http://lists.puredata.info/listinfo/gem-dev</a><br>><br>><br>><br>> ------------------------------------------------------------------------
<br>><br>> _______________________________________________<br>> GEM-dev mailing list<br>> <a href="mailto:GEM-dev@iem.at">GEM-dev@iem.at</a><br>> <a href="http://lists.puredata.info/listinfo/gem-dev">http://lists.puredata.info/listinfo/gem-dev
</a><br></blockquote></div><br>