Replace DirectionalLight3D's use_in_sky_only with sky_mode enum

3 options are available:

- Light and Sky (default)
- Light Only (new)
- Sky Only (equivalent to `use_in_sky_only = true`)

Co-authored by: clayjohn <claynjohn@gmail.com>
This commit is contained in:
Hugo Locurcio 2021-10-20 00:40:46 +02:00 committed by clayjohn
parent 6228063972
commit c45d2c242b
18 changed files with 84 additions and 43 deletions

View file

@ -3286,7 +3286,7 @@ void RendererSceneRenderRD::_setup_lights(const PagedArray<RID> &p_lights, const
RS::LightType type = storage->light_get_type(base);
switch (type) {
case RS::LIGHT_DIRECTIONAL: {
if (r_directional_light_count >= cluster.max_directional_lights || storage->light_directional_is_sky_only(base)) {
if (r_directional_light_count >= cluster.max_directional_lights || storage->light_directional_get_sky_mode(base) == RS::LIGHT_DIRECTIONAL_SKY_MODE_SKY_ONLY) {
continue;
}