Terrain?

BlitzMax Modules Forums/MiniB3D/Terrain?

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.

Here's one small optimization :

Instead of calling TriangleVertex() which creates a array of ints and copies values into it before returning one of those, perhaps this is faster (and more GC friendly)...
' before
Local v=surf.TriangleVertex(t,c)

' after
Local v=surf.tris[(t + 1)*3 - (c + 1)]

Saves one method call too...

Not sure how much faster it is to pull "(t + 1)*3" out of the inner loop and put it in a var, even. But there are lots of those around I see, do I guess it's not important.