Commit 7110d908

– Change the height map from a tile based to a vertex based approach
– Refactor the get/setElevation in various classes accordingly
– Refactor the tile drawing code accordingly (and have it generate actual normals)
– Move more elevation related code from the World to the HeightMap class
– Add stubs for some of the more high-level elevation functions
– Fix usage of the ambient light direction in model and wall shaders

Resolves #9

Hello! This commit gives us quite a bit to talk about. It was a bit dragged out as some of it was quick and interesting to do, other parts of it boiled down to extremely annoying off-by-one bugs, but in the end it worked itself out.

To give this whole endeavour (once again, a “milestone” in GitLab parlance) some context, the idea and partial implementation of a height map happened more or less exactly three years ago. Ever since then the whole topic was not exactly very high on my priority list, so it remained in its half implemented limbo.
In preparation for some upcoming topics it was probably for the best to finally elevate (get it? get it?) its priority and get down to it, which included touching some code which, at this point, was basically as old as it gets in OLives.

So far, the only thing that is working is actually drawing (and hard coded manipulating) the vertices, while stubs for higher level methods do exist, they’re unimplemented as yet, let alone being exposed through a UI. To give you a better idea where this is at, check out this screenshot:


The astute reader might also notice that the “human” model is now looking a bit more three dimensional. This is due to a fix to in some shaders for a regression that was introduced during the “le there be light” milestone, so with this commit the couch model is no longer an amorphous blob, but once again recognisable as an actual object. Small victories and all that.

Next up will be properly handling these elevations when placing objects, walls and build markers. After that, the UI will be built and finally the code to actually do those manipulations.
Hopefully the next few tasks will bring a bit more visual fidelity, so stay tuned. Byeee 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *