Realtime vertex lighting?

Blitz3D Forums/Blitz3D Programming/Realtime vertex lighting?

Yeah, first do a distance check, and don't light the mesh if it is out of range.

Second, just calculate the distance between the light and mesh for the light intensity. Don't check distance for every vertex.

Finally, take the crossproduct of the normal of the vertex and the vector between the mesh and the light, and multiply that by the distance intensity from step 2 to get the color for each vertex.

This is the method I am using in my engine, and it's very fast.