chris clepper a écrit :
void main() { gl_TexCoord[0] = gl_MultiTexCoord0; gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}
uniform sampler2DRect MyTex;
void main (void) { vec4 color = texture2DRect(MyTex, gl_TexCoord[0].st); color = color* 0.5; gl_FragColor = color; }
Works on OSX.
with the pd patch i send to the list?
it does not work on my computer. did anyone tested this on linux?
i forget to say : when i send print to glsl_program, i have :
glsl_Program Hardware Info ============================
[glsl_program]: uvar#0: "MyTex": unknown (0x8B5E) [glsl_program]: uvar#1: "gl_ModelViewProjectionMatrixTranspose": GL_FLOAT_MAT4_ARB
with sampler2DRect and texture2DRect : the shader does not compile. I use sampler2D and texture2D.
anyway, i'll have to find informations about arb_fragments.
thanks Cyrille
Change use sampler2D and texture2D for non-rectangle textures. Or use arb_fragment program which is more straightforward and performs better.
cgc
On 8/25/06, *cyrille henry* <cyrille.henry@la-kitchen.fr mailto:cyrille.henry@la-kitchen.fr> wrote:
This does not change anything : my primitive is still black. thanks Cyrille chris clepper a écrit : > Add > > gl_TexCoord[0] = gl_MultiTexCoord0; > > To your vertex program. > > > On 8/25/06, *cyrille henry* < cyrille.henry@la-kitchen.fr <mailto:cyrille.henry@la-kitchen.fr> > <mailto:cyrille.henry@la-kitchen.fr <mailto:cyrille.henry@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@iem.at <mailto:GEM-dev@iem.at> <mailto: GEM-dev@iem.at <mailto:GEM-dev@iem.at>> > http://lists.puredata.info/listinfo/gem-dev > > > > ------------------------------------------------------------------------ > > _______________________________________________ > GEM-dev mailing list > GEM-dev@iem.at <mailto:GEM-dev@iem.at> > http://lists.puredata.info/listinfo/gem-dev <http://lists.puredata.info/listinfo/gem-dev>