Skip to main content
GameDev.net gamedev.net
🔒 Locked

use more than 4 Textures with GLSL

Started by Ingrater Apr 22, 2007 at 7:36 AM 0 replies 1.3k views
Original Post
Ingrater
Ingrater
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);

http://3d.benjamin-thaut.de
nmi
nmi
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]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.