1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

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

@@ -1167,7 +1167,7 @@ void RendererSceneSkyRD::setup(RendererSceneEnvironmentRD *p_env, RID p_render_b
ERR_CONTINUE(base.is_null());
RS::LightType type = storage->light_get_type(base);
if (type == RS::LIGHT_DIRECTIONAL) {
if (type == RS::LIGHT_DIRECTIONAL && storage->light_directional_get_sky_mode(base) != RS::LIGHT_DIRECTIONAL_SKY_MODE_LIGHT_ONLY) {
SkyDirectionalLightData &sky_light_data = sky_scene_state.directional_lights[sky_scene_state.ubo.directional_light_count];
Transform3D light_transform = li->transform;
Vector3 world_direction = light_transform.basis.xform(Vector3(0, 0, 1)).normalized();