Texture not affected by light

Hackslash

18-04-2009 20:02:48

I'm using ETM 2.3.1 and searched the forum for getting lighting work. I found the shaders of SongOfTheWeave which work perfectly for me but there is one issue which i can't figure out. The first texture in the materialfile of the lighting/splatting pass is not affected by the light shader. This texture is also the base texture when creating a terrain. There is no normal map on the texture as well. All other textures after the first one work as intended.

My Material file is:

material ETTerrainMaterial
{
technique
{
pass Ambient
{
vertex_program_ref ETAmbient_VS
{
}
}

pass Lighting
{
scene_blend add
iteration once_per_light
vertex_program_ref ET/Programs/VSDynLightingNM
{
}

fragment_program_ref ET/Programs/PSDynLightingNM
{
}
texture_unit
{
// first coverage map, dynamically managed
texture ETSplatting0
}
texture_unit
{
// second coverage map, dynamically managed
texture ETSplatting1
}
texture_unit
{
texture splatting0_norm.png // <- not working
}
texture_unit
{
texture splatting1_norm.png
}
texture_unit
{
texture splatting2_norm.png
}
texture_unit
{
texture splatting3_norm.png
}
texture_unit
{
texture splatting4_norm.png
}
texture_unit
{
texture splatting5_norm.png
}

}
pass
{
// splatting pass
scene_blend modulate
vertex_program_ref ET/Programs/VSLodMorph2
{

}

fragment_program_ref ET/Programs/PSSplat2
{
param_named splatScaleX float 20
param_named splatScaleZ float 20
}

texture_unit
{
// first coverage map, dynamically managed
texture ETSplatting0
}
texture_unit
{
// second coverage map, dynamically managed
texture ETSplatting1
}

// splatting textures
texture_unit
{
texture splatting0.png // <- not working
}
texture_unit
{
texture splatting1.png
}
texture_unit
{
texture splatting2.png
}
texture_unit
{
texture splatting3.png
}
texture_unit
{
texture splatting4.png
}
texture_unit
{
texture splatting5.png
}
}
}
}


The CG and Program file i copied from SongOfTheWeave.

So Anyone Know how to get the first texture (splatting0 and splatting0_norm) displayed with normal map and working with light?

Any help would be great :).

SongOfTheWeave

24-04-2009 03:29:55

I don't see any tips or diagnosis I can make from what you've posted...

My first response is, "Are you sure?" This sounds like an unlikely problem. Are you sure the image files exist with the proper names?

Is there a way you can take a screenshot that shows your problem?

Hackslash

24-04-2009 21:11:02

Well i could not find the problem, even the textures exist so i deleted the whole ET folder and recreated everything from scratch. I dont know what was wrong but now it works, thanks for your answere SOTW :).

One more odd thing with the light i have noticed. when the camera comes closer to terrain with normalmaps u can see ugly edged stripes of light with different strength depending on distance from camera. Why is that happening?

Dalon

25-11-2009 08:55:03

Probably you didn't create the normals and tangents when you created your terrain with ETM / ETL? I had the same problem