How to use multiple UV layers with glsl shaders in GE?

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 to use multiple UV layers with glsl shaders in GE?

Post by grzybu » Tue Jun 10, 2008 2:44 pm

Hi,

I can't get multiple UV layers work with glsl shaders. I can only get access to first layer and it works fine. But if I want to multiple lightmap with diffuse layer it don't work.
I thought that instead of using gl_TexCoord[0].xy I should call gl_TexCoord[1].xy but then I have white object.
When I don't use glsl shader, GE renders diffusemap + lightmap correctly with different UV layers. But I need normalmapping and everything works fine but lightmap with second UV layer.

OTO
Posts: 60
Joined: Wed Oct 16, 2002 8:51 pm
Contact:

Post by OTO » Tue Jun 10, 2008 11:27 pm

Hello
have you read the "light map" tutorial?
http://www.continuousphysics.com/lightm ... orial.html
Bye

grzybu
Posts: 0
Joined: Wed Aug 04, 2004 8:40 am
Contact:

Post by grzybu » Tue Jun 10, 2008 11:54 pm

Sure, but I want to use lightmap in glsl shader. It works fine with default blender shading like in this tutorial. I just can't get second UV layer coordinates for lightmap in glsl shader.

grzybu
Posts: 0
Joined: Wed Aug 04, 2004 8:40 am
Contact:

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

OK, I've found solution. I just forgot to add line:
gl_TexCoord[1] = gl_MultiTexCoord1;

Post Reply