forked from blender/blender
2
1
Fork 0

EEVEE-Next: Light: Add ray visbility support #1

Closed
Clément Foucault wants to merge 1 commits from eevee-next-light-ray-visibility into eevee-next-transmission-slider

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 17 additions and 4 deletions

View File

@ -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")

View File

@ -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;