Lighting #61
Labels
engine
enhancement
a new feature or improvement
experimental
a feature or idea that will require lots of experimentation
graphics
The game should have some flood-fill based ambient lighting.
Difficulties
Minecraft's lighting algorithm is fairly simple, however it is also fairly limited due to only having 16 different light values and 2 light channels. This means that the light is not colored and a torch can at most light 16 blocks in one direction.
In Cubyz I would like to have colored lighting (e.g. colored light sources and colored light absorption through glass).
Additionally I would like to have long range interactions. Especially for larger caves minecraft's lighting model looks wrong because torch light cannot reach the opposite wall.
Now bother of these come at a heavy performance cost. 3 more color channels would increase the cost by 3×
Increasing the light range by 2× would increase the cost by 2³ = 8×
Solution Idea 1
Rather than doing lighting on a per-block level, it should be done at a larger scale.
This can be done with a coarse graph structure of the transparent volumes, and traversing that graph on light updates.
Problems with that approach
Solution Idea 2
Store column-wise runlength-encoding data.
For each run we only need to store one light value, remaining values are inferred from the block properties and the distance to that light source.
When there is multiple lights that hit the run in different places, then the run should be split into 2 smaller runs.
Problems
The text was updated successfully, but these errors were encountered: