Inverse square law for light range

This commit is contained in:
Nick J. Connors 2021-12-31 23:13:37 -05:00
parent 9638caefe1
commit ea721d2519

View File

@ -35,6 +35,7 @@ namespace NewHorizons.Builder.Body
var light = sunLight.AddComponent<Light>();
light.CopyPropertiesFrom(GameObject.Find("Sun_Body/Sector_SUN/Effects_SUN/SunLight").GetComponent<Light>());
light.intensity *= starModule.SolarLuminosity;
light.range *= Mathf.Sqrt(starModule.SolarLuminosity);
var faceActiveCamera = sunLight.AddComponent<FaceActiveCamera>();
faceActiveCamera.CopyPropertiesFrom(GameObject.Find("Sun_Body/Sector_SUN/Effects_SUN/SunLight").GetComponent<FaceActiveCamera>());