How many texture channels can I access from glsl shader?

Game Engine, Players & Web Plug-in, Virtual Reality, support for other engines

Moderators: jesterKing, stiv

Post Reply
Posts: 0
Joined: Wed Aug 04, 2004 8:40 am

How many texture channels can I access from glsl shader?

Post by grzybu »


I wonder if there is limit to 3 texture channels in glsl shaders.
I can access texture channels from 0 to 2 without any problem and I can see colors without any problem. But when I do i.e. :

Code: Select all

shader.setSampler('lightmap', 3)
then I have black color instead of texture. If I move this texture to channel 3 and use 2 instead of 3 in glsl shader code then everything works fine.
But I need four textures: diffuse, normalmap, displacemap and lightmap and only have access to 3 at once.
Is this a bug or some limitation I don't know?

Posts: 0
Joined: Mon May 19, 2008 8:35 am

Post by Chaser »

Hey, I'm having the same problem.

I've got three textures working to do what I want, and now I just want to multiply a lightmap on top. Unfortunately, any texture I put on the fourth channel just turns up black.

If anybody knows how to fix/get around this, any tips would be great.

Post Reply