diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-11-15 16:44:45 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-11-15 20:16:30 +0300 |
commit | 516e000aa9762c6b19c64ce46e5dd458cd04a1fb (patch) | |
tree | daef7a7f7e8211e212aa24bc9a8a8322d7eef25f /release/scripts/startup | |
parent | d082b18d877f2da661ee2a48fdf3c69d67406e86 (diff) |
Eevee: Add Light Threshold value
This is an important change. Starting from now, all lights have a finite
influence radius (similar to the old sphere option for BI).
In order to avoid costly setup time, this distance is first computed
automatically based on a light threshold. The distance is computed
at the light origin and using the inverse square falloff. The setting
can be found inside the render settings panel > shadow tab.
This light threshold does not take the light shape into account an may not
suit every case. That's why we provide a per lamp override where you can
just set the cutt off distance (Light Properties Panel > Light >
Custom Distance).
The influence distance is also used as shadow far clip distance.
This influence distance does not concerns sun lights that still have a
far clip distance.
---
This change is important because it makes it possible to cull lights
an improve performance drastically in the future.
Diffstat (limited to 'release/scripts/startup')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_light.py | 34 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_render.py | 1 |
2 files changed, 34 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_light.py b/release/scripts/startup/bl_ui/properties_data_light.py index 8aa70d1e05f..7d21ecb99b3 100644 --- a/release/scripts/startup/bl_ui/properties_data_light.py +++ b/release/scripts/startup/bl_ui/properties_data_light.py @@ -105,6 +105,36 @@ class DATA_PT_EEVEE_light(DataButtonsPanel, Panel): sub.prop(light, "size_y", text="Y") +class DATA_PT_EEVEE_light_distance(DataButtonsPanel, Panel): + bl_label = "Custom Distance" + bl_parent_id = "DATA_PT_EEVEE_light" + bl_options = {'DEFAULT_CLOSED'} + COMPAT_ENGINES = {'BLENDER_EEVEE'} + + @classmethod + def poll(cls, context): + light = context.light + engine = context.engine + + return (light and light.type != 'SUN') and (engine in cls.COMPAT_ENGINES) + + def draw_header(self, context): + light = context.light + + layout = self.layout + layout.active = light.use_shadow + layout.prop(light, "use_custom_distance", text="") + + def draw(self, context): + layout = self.layout + light = context.light + layout.use_property_split = True + + col = layout.column() + + col.prop(light, "cutoff_distance", text="Distance") + + class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel): bl_label = "Shadow" bl_options = {'DEFAULT_CLOSED'} @@ -131,7 +161,8 @@ class DATA_PT_EEVEE_shadow(DataButtonsPanel, Panel): col = layout.column() sub = col.column(align=True) sub.prop(light, "shadow_buffer_clip_start", text="Clip Start") - sub.prop(light, "shadow_buffer_clip_end", text="End") + if light.type == 'SUN': + sub.prop(light, "shadow_buffer_clip_end", text="End") col.prop(light, "shadow_buffer_soft", text="Softness") @@ -281,6 +312,7 @@ classes = ( DATA_PT_preview, DATA_PT_light, DATA_PT_EEVEE_light, + DATA_PT_EEVEE_light_distance, DATA_PT_EEVEE_shadow, DATA_PT_EEVEE_shadow_contact, DATA_PT_EEVEE_shadow_cascaded_shadow_map, diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index bbb1a067dd7..61804bae9d8 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -390,6 +390,7 @@ class RENDER_PT_eevee_shadows(RenderButtonsPanel, Panel): col.prop(props, "shadow_cascade_size", text="Cascade Size") col.prop(props, "use_shadow_high_bitdepth") col.prop(props, "use_soft_shadows") + col.prop(props, "light_threshold") class RENDER_PT_eevee_sampling(RenderButtonsPanel, Panel): |