diff --git a/scripts/startup/bl_ui/properties_object.py b/scripts/startup/bl_ui/properties_object.py index dec3768ed95..cd0f6f373ee 100644 --- a/scripts/startup/bl_ui/properties_object.py +++ b/scripts/startup/bl_ui/properties_object.py @@ -395,6 +395,14 @@ class OBJECT_PT_visibility(ObjectButtonsPanel, Panel): col = layout.column(heading="Ray Visibility") col.prop(ob, "visible_shadow", text="Shadow", toggle=False) + if ob.type in {'LIGHT'}: + layout.separator() + col = layout.column(heading="Ray Visibility") + col.prop(ob, "visible_diffuse", text="Diffuse", toggle=False) + col.prop(ob, "visible_glossy", text="Glossy", toggle=False) + col.prop(ob, "visible_transmission", text="Transmission", toggle=False) + col.prop(ob, "visible_volume_scatter", text="Volume Scatter", toggle=False) + if ob.type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT', 'CURVES', 'POINTCLOUD', 'VOLUME'}: layout.separator() col = layout.column(heading="Light Probes") diff --git a/source/blender/draw/engines/eevee_next/eevee_light.cc b/source/blender/draw/engines/eevee_next/eevee_light.cc index 52ac68cd992..d1750b620b7 100644 --- a/source/blender/draw/engines/eevee_next/eevee_light.cc +++ b/source/blender/draw/engines/eevee_next/eevee_light.cc @@ -70,12 +70,17 @@ void Light::sync(ShadowModule &shadows, const Object *ob, float threshold) shape_parameters_set(la, scale, threshold); + const bool diffuse_visibility = (ob->visibility_flag & OB_HIDE_DIFFUSE) == 0; + const bool glossy_visibility = (ob->visibility_flag & OB_HIDE_GLOSSY) == 0; + const bool transmission_visibility = (ob->visibility_flag & OB_HIDE_TRANSMISSION) == 0; + const bool volume_visibility = (ob->visibility_flag & OB_HIDE_VOLUME_SCATTER) == 0; + float shape_power = shape_radiance_get(); float point_power = point_radiance_get(); - this->power[LIGHT_DIFFUSE] = la->diff_fac * shape_power; - this->power[LIGHT_SPECULAR] = la->spec_fac * shape_power; - this->power[LIGHT_TRANSMISSION] = la->transmission_fac * shape_power; - this->power[LIGHT_VOLUME] = la->volume_fac * point_power; + this->power[LIGHT_DIFFUSE] = la->diff_fac * shape_power * diffuse_visibility; + this->power[LIGHT_SPECULAR] = la->spec_fac * shape_power * glossy_visibility; + this->power[LIGHT_TRANSMISSION] = la->transmission_fac * shape_power * transmission_visibility; + this->power[LIGHT_VOLUME] = la->volume_fac * point_power * volume_visibility; this->pcf_radius = la->shadow_filter_radius;