Lights: change sun light size to be specified as angle

This is the angular diameter as seen from earth, which is between 0.526° and
0.545° in reality. Sharing the size with other light types did not make much
sense and meant the unit was unclear.

Differential Revision: https://developer.blender.org/D4819
This commit is contained in:
Tim Stullich
2019-05-15 14:45:33 +02:00
committed by Brecht Van Lommel
parent 2497ee31ec
commit 5ba1a6bee0
12 changed files with 52 additions and 11 deletions

View File

@@ -672,6 +672,9 @@ static void light_shape_parameters_set(EEVEE_Light *evli, const Light *la, float
evli->sizey = max_ff(0.003f, la->area_size * scale[1] * 0.5f);
}
}
else if (la->type == LA_SUN) {
evli->radius = max_ff(0.001f, tanf(la->sun_angle / 2.0f));
}
else {
evli->radius = max_ff(0.001f, la->area_size);
}