Sign in to follow this  

texture lookup indirection problem

This topic is 2840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I reformulated my problem because it evolves since the begin of my last thread: I want to do a simple thing: I have a simple texturedquad wich i write texcoords st to an RGBA image in RG components using this simple shader and render to texture: uniform sampler2D unusedTexture; void main(){ gl_FragColor=vec4(gl_TexCoord[0].st,0,1); } it gives me that after that i modify my prog in order to take this image as input texture and modify the shader: uniform sampler2D indexTexture; //texcoord texture void main(){ vec4 pos = texture2D(indexTexture, gl_TexCoord[0].st); take //first indirection: pos has expected values as i tried to output it vec4 col= texture2D(indexTexture,pos.xy); // second indirection: bad lookup output } What I want is the same image as inputTexture since i take pos in a texcoordtexture data that must be the same as gl_TexCoord[0].st but the resulting render is: can you help with this problem? Is this a hardware problem or limitation ? ( I'm working with a Quadro1500M... :( )

Share this post


Link to post
Share on other sites
I tried the exact same thing on my hardware (nvidia 8800GTS) with your gradient and it works as expected (final image looks exactly like the gradient).


vec2 testuv = texture2D(S_tex[i],uv).rg;
layercolor = texture2D(S_tex[i],testuv).rgb;


My guess is an issue with your hardware. Maybe doesn't support multiple lookups to same texture? But I have no idea.

Share this post


Link to post
Share on other sites
You can try querying these values with glGetProgramiv. Not totally clear on what is the difference between a tex_indirection and a native_tex_indirection, but this might give info for you.

PROGRAM_TEX_INDIRECTIONS_ARB 0x8807
MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810

It might not end up being a hardware thing after all, looking at this article it says minimum number of tex indirections for implementation must be greater than 4.

http://www.nvidia.com/dev_content/nvopenglspecs/GL_ARB_fragment_program.txt

Share this post


Link to post
Share on other sites

This topic is 2840 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this