From jit.gl.texture to gl_Position problem
For some reason I need to sample my vertex points with jit.gl.texture for further processing in my shader.
But when I assign my vertexTexture.xyz to gl_Position in my vertex shader I get wrong coords.
It seems that there is a constant in a plane or that I'm missing something.
This what I'm trying;
texdim0 = vec2 (abs(gl_TextureMatrix[0][0][0]),abs(gl_TextureMatrix[0][1][1]));
texcoord1 = vec2(gl_TextureMatrix[1] * gl_MultiTexCoord1);
vertexID = gl_VertexID;
dmap = texture2DRect(tex1, texcoord1);
gl_Position = dmap;
I can provide an example if needed but I guess that I'm missing something obvious here.
Any help will be much appreciated!
i think you have to use texture2D / sampler2D in the vertex program (at least that's the way i got it working, but maybe i'm missing something). this means you need to set @recangle 0 on your jit.gl.texture (or use the "sendoutput / sendinput rectangle 0" message to jit.gl.slab / pix.
post your patch if you can't get it working.
thanks Rob, got it working now with sampler2DRect. It works if you define the texcoords thru the array input of jit.gl.mesh.