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
grzybu
Posts: 0
Joined: Wed Aug 04, 2004 8:40 am
Contact:

How many texture channels can I access from glsl shader?

Post by grzybu » Mon Jun 16, 2008 4:53 pm

Hi,

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?

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

Post by Chaser » Mon Sep 01, 2008 2:22 am

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.
-Chaser.

Post Reply