No light on terrain?

geniephics

17-11-2008 12:06:06

Hi,

I've applied VertexTextureBlend method on my terrain. After that i've export .mesh and .material, i've put inside my game coding. But, the terrain inside my coding is totally very dark. no light at all.

Did i miss out anything?

Below is my .material


material VertexTextureBlending
{
technique
{
pass
{
ambient 0.7 0.7 0.7 1
diffuse 0.7 0.7 0.7 1
specular 0.9 0.9 0.9 1 20

vertex_program_ref vertexTextureBlendVS
{
param_named scale float 1
param_named_auto worldViewProj worldviewproj_matrix
}

fragment_program_ref vertexTextureBlend
{
param_named scale_tex1 float 10
param_named scale_tex2 float 10
param_named scale_tex3 float 27
}

texture_unit
{
texture_alias Sand
texture Terrain_Sand.jpg
}

texture_unit
{
texture_alias Dirt
texture Terrain_Dirt.jpg
}

texture_unit
{
texture_alias Grass
texture Terrain_Grass.png
}
}

}

}

Lioric

18-11-2008 00:29:06

Is this the VertexTextureBlend shader that uses a shadow map texture to produce the terrain light?

Usually if it is correct in the preview viewport and not in your application is because you are using a different Render System (OpenGL and D3D9) in your application or the shader is not supported (you have not loaded the Cg library), if this is on another machine is usually drivers