Ignoring the variants that support point lighting, only with directional lighting, I have the following terrain shaders:
- A simple 4 texture blending shader.
- A variant that adds normal mapping
- One that adds normal mapping for polygons facing away from the light
- One that does the same thing as the above one, but is a "hard" variant that adds a lot more pronounced normal mapping effect.
- One that is variant of the above one, but this time it reduces the tiling texture look a little. Heavy normal mapping, even with normal repeating texture compensation is still prone to repeating patterns and this shader tries to remedy this, but it produces somewhat brighter outputs. This was my preferred solution up to this point.
The third variant was a key progress, adding normal mapping to every inch of the map.
And the last two variants were again key, because the first 3 produced far too soft normal mapping effects. But these two methods were not perfect. I basically made them up based on practical observations after getting the hang of shaders and things that seemed like a good idea. There were hours of trial and error before I got acceptable results and even more hours before I arrived at variant 5.
But I am still not 100% happy. Time to fix this. But how? No more trial and error and monkey patching. This time I'll use science, maths and a lot of research. Why try stuff out when you can do maths? Let's see the preliminary results of this.
Here is a screenshot using method 5:
This was my best method. Now let's see one of the new methods (I have several variants and I can't tell which one I like better):
Fantastic! Another screen with method 5:
Without the bright texture this looks a lot better and the repeating normal mapping pattern is not that visible as it would be with method 4. Now let's try the new method:
Huge improvement, but I can't say I am in love the black parts of the mapping effect. another sample with method 5:
And the new method:
Again, some blackness, but still interesting results!
What do you think? Do you like the new shaders? Are the black parts disturbing? The number of variants is getting out of control so I would like to arrive at only a handful of variants.
But how about the point light. I am no longer computing it correctly because of the new method, but the results are passable:
I'll continue and experiment and try to finalize the new shaders. The terrain shader file is in bad need of a monster cleanup!
Oh, but before I go: not all the shaders were a success. Take a look at this one, that creates nice little swirly artifacts that have a surprisingly high amount of fake 3D popping effect: