Handling 2 texture in fragment shader

How can I handle 2 texture in fragment shader?

There’s a good example here…
http://www.lighthouse3d.com/opengl/glsl/index.php?textureMulti

In a nutshell you assign as many as you need in the shaders, within your GPU’s specs.

uniform sampler2D tex1, tex2, tex3 etc…

Setup the textures in OpenGL as normal and then assign their texture ID to them when you setup the shader with single Integer Uniforms with the same name as you gave them in the shader.

don’t use the texture id for the sampler uniforms

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.