Landscape Engine

Landscape engine with lambertian shadingI finallly found the time to implement per-vertex precalculated lightning in the landscape engine. I’m quite satisfied with the result and it gives the landscape a less boring look.. The reflection method I use is called Lambertian reflection, but you might now it better by the more common name diffuse reflection. Anyway, whatever you call it it’s easy to implement – all you need is the vector from the vertex to the sun and the vertex normal.I’ve also written a new function for the octree system that tests whether a ray intersects any of the triangles in the octree, at first I used that function along with the reflection technique above to make sure that the points could “see” the rays from the sun. I removed that however since the check of the thousands of verts took several minutes on a large heightmap :). Instead I moved the sun far away so that all rays has become almost parallel ensuring that all points on the landscape are hit (I have no overhangs and such).

Shot of landscape engine with lambertian shadingA completely new logging system has also been added to the engine, the old one was rather clumsy and way to simple. It’s still simple, but at least it looks like OOP now :).
You can download the new engine, and the source, right here:

Tommorow I’m going 250km by car to my aunts birthday, we’ll be sleeping in our Compi-Camp (some kind of tent wagon) so don’t expect any updates tomorrow . And about the move to the new server, I expect that I can be finished with all the uploading and stuff by the weekend, then I need a “hosted by” image which Scorpion will supply, and then It’ll be up and running. See you there :).

Leave a Reply

Your email address will not be published.