Jump to content
  • Advertisement
Sign in to follow this  
Ingrater

use more than 4 Textures with GLSL

This topic is 4167 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, I wrote an GLSL shader in RenderMonkey and used 5 Textures. It works fine in RenderMonkey but I'm not able to get the fifth texture into the shader with my own code. AFAIK the fixed function pipeline has only support for 4 textures, so mabye that's the problem? I'm using a gf7800 GTX.
glActiveTexture(GL_TEXTURE4);
glBindTexture(GL_TEXTURE_2D,gluiTextureId);

Share this post


Link to post
Share on other sites
Advertisement
Read here:
http://oss.sgi.com/projects/ogl-sample/registry/ARB/fragment_shader.txt

Quote:

The maximum available multi-texture stages (to the fixed-function
pipeline) are MAX_TEXTURE_UNITS. A fragment shader has access to at
least MAX_TEXTURE_UNITS texture image units, and possibly more, up to
MAX_TEXTURE_IMAGE_UNITS_ARB. Where MAX_TEXTURE_IMAGE_UNITS_ARB is equal
or greater than MAX_TEXTURE_UNITS.


The fixed-function pipeline may report MAX_TEXTURE_UNITS as 4, while in a shader the MAX_TEXTURE_IMAGE_UNITS_ARB may be 16 and MAX_TEXTURE_COORDS_ARB may be 8. So your shader should have access to more than 4 textures.

Make sure that you set the values of the uniform samplers to the correct texture units as well.

[Edited by - nmi on April 22, 2007 8:43:49 AM]

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!