Merge remote-tracking branch 'origin/master'

This commit is contained in:
Anuken
2023-04-24 23:59:51 -04:00
3 changed files with 3 additions and 59 deletions

View File

@@ -82,12 +82,11 @@ public class Universe{
}
}
if(state.hasSector() && state.getSector().planet.updateLighting){
boolean disable = state.getSector().preset != null && state.getSector().preset.noLighting;
if(state.hasSector() && state.getSector().planet.updateLighting && !(state.getSector().preset != null && state.getSector().preset.noLighting)){
var planet = state.getSector().planet;
//update sector light
float light = state.getSector().getLight();
float alpha = disable ? 1f : Mathf.clamp(Mathf.map(light, planet.lightSrcFrom, planet.lightSrcTo, planet.lightDstFrom, planet.lightDstTo));
float alpha = Mathf.clamp(Mathf.map(light, planet.lightSrcFrom, planet.lightSrcTo, planet.lightDstFrom, planet.lightDstTo));
//assign and map so darkness is not 100% dark
state.rules.ambientLight.a = 1f - alpha;