diff options
author | Stefan Werner <stefan.werner@tangent-animation.com> | 2020-05-05 14:55:24 +0300 |
---|---|---|
committer | Stefan Werner <stefan.werner@tangent-animation.com> | 2020-06-02 08:27:14 +0300 |
commit | c7280ce65b856d26d6807c1b7a081ffc6311bfdc (patch) | |
tree | f1dc9453d24b0352cc87cf45bf7b5848da86d6d4 /intern/cycles/blender/addon | |
parent | 18cda8be8768b1e4ad9c359295142272e7aac6bf (diff) |
Cycles: Added shadow terminator offset parameter.
A new user parameter can be used to shift the shadow terminator
towards the light source. With it, one can hide some of the
artifacts that appear on coarse meshes with smooth shading.
Note that this technique is not engery conserving.
This is based on the work by the Appleseed renderer team.
Differential Revision: https://developer.blender.org/D7634
Diffstat (limited to 'intern/cycles/blender/addon')
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 7 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 22 |
2 files changed, 29 insertions, 0 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index c91e210bbd8..da18ac7c693 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -1205,6 +1205,13 @@ class CyclesObjectSettings(bpy.types.PropertyGroup): default=1.0, ) + shadow_terminator_offset: FloatProperty( + name="Shadow Terminator Offset", + description="Push the shadow terminator towards the light to hide artifacts on low poly geometry", + min=0.0, max=1.0, + default=0.0, + ) + is_shadow_catcher: BoolProperty( name="Shadow Catcher", description="Only render shadows on this object, for compositing renders into real footage", diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index a15daee706f..7a339e71197 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -1209,6 +1209,27 @@ def has_geometry_visibility(ob): return ob and ((ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META', 'LIGHT'}) or (ob.instance_type == 'COLLECTION' and ob.instance_collection)) +class CYCLES_OBJECT_PT_shading(CyclesButtonsPanel, Panel): + bl_label = "Shading" + bl_context = "object" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + return CyclesButtonsPanel.poll(context) and (context.object) + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + + flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False) + layout = self.layout + ob = context.object + cob = ob.cycles + + if has_geometry_visibility(ob): + col = flow.column() + col.prop(cob, "shadow_terminator_offset") class CYCLES_OBJECT_PT_visibility(CyclesButtonsPanel, Panel): bl_label = "Visibility" @@ -2268,6 +2289,7 @@ classes = ( CYCLES_CAMERA_PT_dof_aperture, CYCLES_PT_context_material, CYCLES_OBJECT_PT_motion_blur, + CYCLES_OBJECT_PT_shading, CYCLES_OBJECT_PT_visibility, CYCLES_OBJECT_PT_visibility_ray_visibility, CYCLES_OBJECT_PT_visibility_culling, |