Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NightMode Blockers #1909

Open
Beherith opened this issue Jan 20, 2025 · 0 comments
Open

NightMode Blockers #1909

Beherith opened this issue Jan 20, 2025 · 0 comments

Comments

@Beherith
Copy link
Contributor

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:

  1. when terrain changes force an update, a small area of the shadingTex is updated
  2. 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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant