Jump to content

  • Log In with Google      Sign In   
  • Create Account

GLSL max number of texture units per pass


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Grazer2   Members   -  Reputation: 127

Like
0Likes
Like

Posted 24 September 2009 - 08:18 AM

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

Sponsor:

#2 zedz   Members   -  Reputation: 291

Like
0Likes
Like

Posted 24 September 2009 - 08:47 AM

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

#3 AndyEsser   GDNet+   -  Reputation: 386

Like
0Likes
Like

Posted 24 September 2009 - 08:54 AM

glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB,&value);

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

#4 Grazer2   Members   -  Reputation: 127

Like
0Likes
Like

Posted 24 September 2009 - 09:10 AM

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?

#5 AndyEsser   GDNet+   -  Reputation: 386

Like
0Likes
Like

Posted 24 September 2009 - 09:58 AM

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?

#6 Grazer2   Members   -  Reputation: 127

Like
0Likes
Like

Posted 24 September 2009 - 10:08 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS