[GEM-dev] glsl and texture
cyrille henry
cyrille.henry at la-kitchen.fr
Fri Aug 25 18:00:03 CEST 2006
i still don't understand how to load a jpg file to MyTex.
attachement is my test patch.
it does not render any texture.
thanks
Cyrille
chris clepper a écrit :
> Use a texture sampler in your shader. GLSL has a sampler for 2D and
> RECT texutres, so make sure you have the right one for the texture type
> (OSX defaults to RECT while Win/Linux are probably 2D).
>
> uniform sampler2D MyTex;
>
> void main (void)
> {
> vec4 color = texture2D(MyTex, gl_TexCoord[0].st);
> color = color * 0.5;
> gl_FragColor = color;
> }
>
> That is untested but it should result in something.
>
> cgc
>
> On 8/25/06, *cyrille henry* <cyrille.henry at la-kitchen.fr
> <mailto:cyrille.henry at la-kitchen.fr>> wrote:
>
> hello,
>
> i'm trying to learn glsl.
> I can't find how to use texture in the fragment shader.
> does anyone have an exemple how to load texture with GEM glsl?
>
> thanks
> Cyrille
>
> _______________________________________________
> GEM-dev mailing list
> GEM-dev at iem.at <mailto:GEM-dev at iem.at>
> http://lists.puredata.info/listinfo/gem-dev
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> GEM-dev mailing list
> GEM-dev at iem.at
> http://lists.puredata.info/listinfo/gem-dev
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.vert
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20060825/9d8cdb12/attachment.asc>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.frag
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20060825/9d8cdb12/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: glsl_texture.pd
URL: <http://lists.puredata.info/pipermail/gem-dev/attachments/20060825/9d8cdb12/attachment-0001.asc>
More information about the GEM-dev
mailing list