Looking over the shaders

After reworking the Material Editor, I thought it may be time to recheck the games shaders. It was reported, that the game overall looks too dark and I wasnt fully satisfied with how some textures look and there seems to be an issue with the parallax mapping.

So the game uses a quite complicated system for sun light effects, so it will render basically in blueish tinted monochrome during night and ambient have to be refactored in a way, so the details on each material stay preserved even in dark conditions. This all works in combination of the actual light value for each field on the map (light distribution is simulated) So I reworked all of that and also added Half-Lambert to ease down the harsh contrasts, fixed the parallax mapping things and recoded the whole math around getting the final illumination value for each pixel.

For that to have all needed information I reworked the Sun Class itself to deliver several values to give the shader enough data to work on.

Talking about the Sun - currently the day is split into 12h day and 12h night. Which is basically alright, considering the game plays on a tropical islands which most supposely sit on the equator. The wrong thing about it was that the day started at 09:00 so I corrected that to 06:00

Another problem was, that the sun currently was treated as a single point - so whenever it came over the horizon it wasnt lit before that single point came over - in reality the sun is a body, and we can already see it, when it's center has nopt passed the horizon yet - so I added this and also factored in the curvature of the planet, so while the sun will not rise before 06:00 the world will see light before that happens - and maintains light until the sun is fully gone.

This had some issues, as until know, whenever the sun was gone it was switched to "a moon" and gave some moon shading together with slight shadows from the moon, which does not work any longer, as now the sun is "active" more than 12h and therefore cannot be switched to the moon in terms of shadow mapping .. indeed I would either make the moon move faster and be its own entity or stop rendering shadows during night.

I opted for the later, so shadows will fade out together with the sun and will not reappear until sun comes back again - this also gives some nive dawn with very long shadows, slowly fading in (and hide some of the flickers due to shadow mapping inprecisions in situations like that)

Will see upon user feedback when this update goes live if people like it - but I also want to rework some of th existing materials, as some of them does not look too good. Some materials just wont look nice in a coarse texture so. This is a bit of work to make more high res textures but I think its worth it