hello,
i will, but i don't have time yet.
can you try this exemple and tell me if both texturing mode work?
cyrille
vade a écrit :
can you change the shader and patch I posted to use rectangular
textures? I tried and only had a single texel mapped.Maybe its an OS X thing?
On Jan 2, 2008, at 12:18 PM, cyrille henry wrote:
using coordinate mode 0 : texture coordinate goes from (0,0) to
(size.x,size.y), so it's easier to get the size of the texture (with
pix_info), send it to the shader to make the correction.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
// Cyrille Henry 2007
//#extension GL_ARB_texture_rectangle : enable //uniform sampler2DRect MyTex; uniform sampler2D MyTex;
void main (void) { // vec4 color = texture2DRect(MyTex, gl_TexCoord[0].st); vec4 color = texture2D(MyTex, gl_TexCoord[0].st); color = color* 0.5; gl_FragColor = color; }
// Cyrille Henry 2007
void main() { gl_TexCoord[0] = gl_MultiTexCoord0; gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}
// Cyrille Henry 2007
#extension GL_ARB_texture_rectangle : enable uniform sampler2DRect MyTex; //uniform sampler2D MyTex;
void main (void) { vec4 color = texture2DRect(MyTex, gl_TexCoord[0].st); // vec4 color = texture2D(MyTex, gl_TexCoord[0].st); color = color* 0.5; gl_FragColor = color; }