Fast terrain self-shadowing

Blitz3D Forums/Blitz3D Programming/Fast terrain self-shadowing

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I did one for terrains and it's pretty fast. The shading is generated by calculating the normals direction in relation to the sun. The shadows are generated by checking to see if the point is occluded. As I say I use terrains (Bitmaps) to provide the height information, there is no reason why you could not use a mesh terrain and use vertex positions - you may need some interpolation if your terrain is not in a grid format. And for the normals use the VertexNX() etc... commands.

Here is the link : http://www.blitzbasic.com/codearcs/codearcs.php?code=1004