How does this work?
DarkShadow44 opened this issue ยท 3 comments
Can you give a short technical explanation on how this works, please?
It's very simple actually. You can check the most important part herehttps://github.com/USS-Shenzhou/brighter/blob/master/src/main/java/cn/ussshenzhou/brighter/mixin/MixinBlockLightEngine.java#L57.
This is how the light spread in a simple model:
[light source]-> ... ->[ previous block ] ->[ start block ]->[ end block ]
(End block is where we want to calculate block light for.)
(The light level, mentioned in the calculation progress, is contrary to the block light in game. 0 means the brightest and 15 means the darkest.)
Generally, in a vanilla situation, [end block] = [start block] + 1 (remember, +1 means going darker!).
In the modded situation, to get the 2-blocks-darker-1-level instead of 1-block-darker-1-level, the [end block] would get darker(+1) only when [previous block] is as bright as [start block], for example:
The 3rd block is where we want to calculate for, the 4th block is the next we want.
vanilla: ...->[10]->[11]->[12]->[13]
brighter: ...->[10]->[11]->[11]->[12]
(Since 10 != 11, 11 would repeat.) (Since 11==11, next would be 11+1=12.)
I'm not a English native speaker. So do tell me if there is any confusion.
Perfectly understandable and pretty clever approach, thanks! The lighting engine in Minecraft is still so complicated to me, I appreciate the explanation.
I hoped that maybe you could enable the "super bright" light only for certain lightsources, but I guess this is not possible?