I started building out a terrain project and got a bit hooked into doing it with shaders and pushing performance.
The Terrain is currently very repetative, and poor quality, partly due to the source image I found on the internet. My next step is to generate nicer heightfields and also allow mapping large area rather than just repeating the height map.
Anyway, for performance triangles get bigger in the distance, it does frustum culling and it pre cooks lighting and texture lookups (actually it’s just color not textured at the moment).
Sooopeeerbbb!!! This will take me months to digest and understand. Thanks for including the references. Got a small project that may use a teeny bit of this.
I’ve started working on procedurally generating the heightfields to 1) get away from a fixed image and 2) be able to generate much bigger heightfields to get away from the current repeating terrain.
It’s interesting stuff, but currently my terrains are very ugly and unrealistic…
@SkyTheCoder thanks for the offer, but I’ve got something working that’s not too ugly, now gonna work through trying to tile it up so I don’t get the repeating terrains on the rendering side… I can always come back to terrain generation techniques later.
The shadows here are a total cheat that I got inspired off from the web. Proper shadow mapping is tricky, and also slow if you are doing it real time, what I do in the light shader here is just step across the heightfield texture looking for high points and cooking it in during setup. The big cheat is shadows only fall across the x axis which makes the lookups dead easy
I found a terrain map online that works ok but the colors are pretty ugly. Still I think it shows the project working, and so I’ve attached a zip. Would love to find a better map though.