You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to be able to publish Night Mode, we have a few things that are minor issues:
Minimap shadingTex
Minimap shadingTex is not updated frequently enough, and when the lighting changes, then the shadingTex cant really keep up. This results in two different artefacts:
when terrain changes force an update, a small area of the shadingTex is updated
shadingTex is updated gradually as the lighting changes, so a gradient appears on the shadingTex
shadingTex is calculated based on the heightmap and a really simple 4 color gradient lookup.
Solution 1
Expose engine uniform buffers to cont/base/springcontent/shaders/GLSL/MiniMapFragProg.glsl
Rewrite shader to calculate the shading from engine uniform buffers and heightmap every frame.
Solution 2
The engine already updates shadingTex at a regular rate, just slowly. It does it in for_mt, allow the toggling of an update manually at a higher rate would be a solution to the gradient and most of the lighting changes problems.
Solution 3 (best)
Have a shader render-to-texture the shadingTex, instead of using cpu to do so, as all the data required to do this is available in engine uniform buffer.
Sky rendering does not obey sun changes.
And obviously this doesnt look very good when we try to make it look like night.
In order to be able to publish Night Mode, we have a few things that are minor issues:
Minimap shadingTex
Minimap shadingTex is not updated frequently enough, and when the lighting changes, then the shadingTex cant really keep up. This results in two different artefacts:
shadingTex is calculated based on the heightmap and a really simple 4 color gradient lookup.
Solution 1
Expose engine uniform buffers to cont/base/springcontent/shaders/GLSL/MiniMapFragProg.glsl
Rewrite shader to calculate the shading from engine uniform buffers and heightmap every frame.
Solution 2
The engine already updates shadingTex at a regular rate, just slowly. It does it in
for_mt
, allow the toggling of an update manually at a higher rate would be a solution to the gradient and most of the lighting changes problems.Solution 3 (best)
Have a shader render-to-texture the shadingTex, instead of using cpu to do so, as all the data required to do this is available in engine uniform buffer.
Sky rendering does not obey sun changes.
And obviously this doesnt look very good when we try to make it look like night.
cont/base/springcontent/shaders/GLSL/ModernSkyFS.glsl
Because it uses
const vec3 sunColor = vec3(0.992, 0.985, 0.827);
Could use a lua replacement as well like the infotexture shaders that are semi-customizeable by games.
The semi customizability is actually a little bit limited, because they can only access Spring.GetConfigString stuff.
Skybox cannot be darkened easily
cont/base/springcontent/shaders/GLSL/CubeMapFS.glsl
Could use a lua replacement as well like the infotexture shaders that are semi-customizeable by games.
Bumpwater shader issues
I now forget what these were, outside of the shores being too light and not affected enough by sun changes.
The text was updated successfully, but these errors were encountered: