Planet lighting parameters
This commit is contained in:
@@ -52,6 +52,8 @@ public class Planets implements ContentList{
|
|||||||
tidalLock = true;
|
tidalLock = true;
|
||||||
orbitSpacing = 0.45f;
|
orbitSpacing = 0.45f;
|
||||||
totalRadius += 2.6f;
|
totalRadius += 2.6f;
|
||||||
|
lightSrcTo = 0.5f;
|
||||||
|
lightDstFrom = 0.2f;
|
||||||
}};
|
}};
|
||||||
|
|
||||||
float[] offsets = {40, 0, 0, 20};
|
float[] offsets = {40, 0, 0, 20};
|
||||||
|
|||||||
@@ -83,9 +83,10 @@ public class Universe{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(state.hasSector() && state.getSector().planet.updateLighting){
|
if(state.hasSector() && state.getSector().planet.updateLighting){
|
||||||
|
var planet = state.getSector().planet;
|
||||||
//update sector light
|
//update sector light
|
||||||
float light = state.getSector().getLight();
|
float light = state.getSector().getLight();
|
||||||
float alpha = Mathf.clamp(Mathf.map(light, 0f, 0.8f, 0.3f, 1f));
|
float alpha = Mathf.clamp(Mathf.map(light, planet.lightSrcFrom, planet.lightSrcTo, planet.lightDstFrom, planet.lightDstTo));
|
||||||
|
|
||||||
//assign and map so darkness is not 100% dark
|
//assign and map so darkness is not 100% dark
|
||||||
state.rules.ambientLight.a = 1f - alpha;
|
state.rules.ambientLight.a = 1f - alpha;
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ public class Planet extends UnlockableContent{
|
|||||||
public boolean accessible = true;
|
public boolean accessible = true;
|
||||||
/** If true, a day/night cycle is simulated. */
|
/** If true, a day/night cycle is simulated. */
|
||||||
public boolean updateLighting = true;
|
public boolean updateLighting = true;
|
||||||
|
/** Day/night cycle parameters. */
|
||||||
|
public float lightSrcFrom = 0f, lightSrcTo = 0.8f, lightDstFrom = 0.3f, lightDstTo = 1f;
|
||||||
/** The default starting sector displayed to the map dialog. */
|
/** The default starting sector displayed to the map dialog. */
|
||||||
public int startSector = 0;
|
public int startSector = 0;
|
||||||
/** Whether the bloom render effect is enabled. */
|
/** Whether the bloom render effect is enabled. */
|
||||||
|
|||||||
Reference in New Issue
Block a user