Setting vertex normals

Blitz3D Forums/Blitz3D Programming/Setting vertex normals

big10p(Posted 2006) [#1]
I'm currently building a mesh from scratch each frame and am setting the vertex normals 'by hand' (using a few tricks), as UpdateNormals is far too slow.

Currently, I'm ensuring my normals are unit length, as is the norm, but it seems to me that Blitz3D (or is it DX?) doesn't care about the length of normals e.g. giving a normal a length of 100 still seems to light the vertex exactly the same as if the length was 1.

I'm trying to optimize building the mesh as much as possible, so not having to bother setting the normals to unit length means I could probably save a millisec or two.

Do you think doing this is OK, or should I always set my normals to unit length?

As I say, it doesn't seem to make any difference on my machine, but I'm not sure if this can vary between different GFX cards, or even different versions of DX.

Any insights greatly appreciated.


DJWoodgate(Posted 2006) [#2]
I have not noticed any lighting problems. I think blitz tells DX to normalize them. Having said that I have not tried Lightmesh with big normals. But I think you can try that out pretty quickly by scaling a mesh non uniformly. If you remember there was a post about this a while back and Floyd explained how scalemesh recalculates the normals after non uniform scaling. It does not normalise them. So I guess it is ok to leave them unnormalized.


Shambler(Posted 2006) [#3]
AFAIR DX does not need normalised normals to calculate lighting.


big10p(Posted 2006) [#4]
OK, thanks.