this.sunSkyLightName = UUID.randomUUID().toString();
this.sunflow.light(this.sunSkyLightName, "sunsky");
}
// Retrieve sun color
SunSkyLight sunSkyLight = new SunSkyLight();
ParameterList parameterList = new ParameterList();
parameterList.addVectors("up", InterpolationType.NONE, new float [] {0, 1, 0});
parameterList.addVectors("east", InterpolationType.NONE,
new float [] {(float)Math.sin(compass.getNorthDirection()), 0, (float)Math.cos(compass.getNorthDirection())});
parameterList.addVectors("sundir", InterpolationType.NONE,
new float [] {sunDirection [0], sunDirection [1], sunDirection [2]});
sunSkyLight.update(parameterList, this.sunflow);
float [] sunColor = sunSkyLight.getSunColor().getRGB();
// Simulate additional Sun with a faraway sphere light of a color depending of the hour of the day
int sunPower = this.useAmbientOcclusion ? 40 : 10;
this.sunflow.parameter("radiance", null,
(this.homeLightColor >> 16) * sunPower * (float)Math.sqrt(sunColor [0]),