Since I first noticed it I’ve been bothered by the uniform ambient lighting in the game that can turn whole mountain sides into flat blobs of a single color, as soon as they’re not in direct sunlight. I had some ides of how to change it and yesterday I finally tried messing with the shaders. I must say I’m quite happy with the results.
Even more crucial without SSAO.
I made the changes directly in the main code, so no mixins or other proper modding methods. I still know too little about that and I’m not even sure if .glsl and .shader can be changed that way.
Anyway, it’s a small change if anyone wants to try it and I’m posting this as a suggestion because I think it (or something similar) should be in the actual game.
In the file “stonehearth\data\horde\shaders\utilityLib\fragLighting.glsl” I added this function:
float calcDirectionalAmbientShade(const vec3 normal)
float shade = dot( normal, -lightDir.xyz );
return (shade * 0.25) + 0.75;
In the file “stonehearth\data\horde\shaders\voxel\deferred_lighting.shader” I replaced the last line with:
float ambientShade = calcDirectionalAmbientShade(normal.xyz);
gl_FragColor = vec4(lightColor.rgb + ambientShade * lightAmbientColor, lightColor.a);
With the current settings the range of the ambiant lighting is 0.5 to 1 of the uniform ambient. This can be changed by changing the 0.25 and 0.75. Just make sure that the new values still add up to 1.
The ambient range 0.75 to 1 is on the side of objects that are facing the light. This may seam strange but it is used to see details in shadows.
No noticeable change in performance on my 6 year old laptop.