beyond-all-reason / beyond-all-reason/RecoilEngine

NightMode Blockers

Open
#1,909 0 comments 0 reactions 1 assignee Claimed by @lhog View on GitHub
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 2h
Merged PRs (30d)
40

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.