A problem with normals and lighting

Hi;

I'm using vb.net express and the june 2005 sdk.

I've created a simple landscape mesh in the x-z plane with a light directly overhead pointing down (vector(0,-1,0) like the sun.

I generate the normals by using mesh.computenormals.

The problem is, when I display the mesh, everything is completely lit -- there are no variations of brightness on the hills as you'd expect. So it's hard to see anything at all; the only way you know it's not completely flat is by looking at the edges.

I know the normals are there, because if I comment out mesh.computenormals the mesh is very faint, just lit by ambient light.

It's as if each normal is set to (0,1,0) -- yet I know they're not. (I examined the values; they're computed correctly. In fact I'm even calculating weighted vertex normals for very accurate lighting.)

Am I misunderstanding lighting somehow? If I change the light direction to (0,0,1) (along the +Z axis )suddenly I can see hills and valleys. But surely even directly overhead there should be some variation?

I'm really puzzled by this ....

[1498 byte] By [ImagineNation] at [2007-12-23]
# 1

My material for this mesh was diffuse=color.white and ambient=color.white

I've discovered that if I change that to diffuse=color.white and ambient=color.fromargb(&h202020) suddenly everything looks better (Though the colours still aren't as varied as I expected but I guess that's subjective.)

But in all tutorials, don;t they tell you for materials to set the ambient color to be equal to the diffuse colour? (In fact in the mesh tutorial they specifically tell you to do this, saying "Because Directx doesn;t do it for ypu.")

So I'm still a bit confused. It looks ok now, but is this really what I'm supposed to do?

ImagineNation at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 2
Your lights are probably too bright. You should set your material ambient colour back to match your diffuse colour and then lower your ambient and "sun" light sources.
RossRidge at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...
# 3
Ok thanks I'll try that ...
ImagineNation at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,Game Technologies: DirectX 101...