• Advertisement
Sign in to follow this  

GLSL max number of texture units per pass

This topic is 3039 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

Hi, just wondering how to query the maximum amount of textures that can be bound and used for rendering. For some reason it looks i can only use 5 tex units when i actually need 6. I just wanna find out if its a hardware limitation or if there is anything else that's wrong. For some reason the 6th unit just returns all white in my shader. Right now I have
projective_texturing_shader_.sendUniform1i("tex5", 5);
in my C++ code which yields the white texture i described. If i put
projective_texturing_shader_.sendUniform1i("tex5", 0);
the unit does have a valid (non white) texture which obviously equals the one from texture unit 0. I just don't get what's wrong there

Share this post


Link to post
Share on other sites
Advertisement
If used more than 5 (perhaps 8)
I dont know if theres a fast limit, check the back of the opengl spec for the tables to see how to query the number of texture units u can use in a shader.
IIRC most hardware supports 16

So I assume youre doing something incorrect in your code

Share this post


Link to post
Share on other sites
Quote:
Original post by AndyEsser
glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB,&value);

This will return the number of texture units (which differs from card to card).


Thanks, this one returns me a 32 so the hardware should support it (as I already imagined).

The textures I bind are the 6 color attachments of a single framebuffer object (I already queried that my hardware supports 8 attachments, so thats not the problem). Anybody knows of any limitations with this specific set-up?

Share this post


Link to post
Share on other sites
Are you certain that the 6th colour attachment is correctly set up? Are you able to see it if you apply it if you don't use the Shader approach?

Share this post


Link to post
Share on other sites
Quote:
Original post by AndyEsser
Are you certain that the 6th colour attachment is correctly set up? Are you able to see it if you apply it if you don't use the Shader approach?


I can use the texture from the 6th colour attachment just fine in my shader if i bind it to texture unit 0.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement