From ade35bac9355679f0966249b7d65992ef024eb04 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 20 Nov 2015 14:42:34 +0500 Subject: Cycles: Implement rolling shutter effect This is an attempt to emulate real CMOS cameras which reads sensor by scanlines and hence different scanlines are sampled at a different moment in time, which causes so called rolling shutter effect. This effect will, for example, make vertical straight lines being curved when doing horizontal camera pan. This is controlled by the Shutter Type option in the Motion Blur panel. Additionally, since scanline sampling is not instantaneous it's possible to have motion blur on top of rolling shutter. This is controlled by the Rolling Shutter Time slider which controls balance between pure rolling shutter effect and pure motion blur effect. Reviewers: brecht, juicyfruit, dingto, keir Differential Revision: https://developer.blender.org/D1624 --- intern/cycles/blender/addon/properties.py | 18 ++++++++++++++++++ intern/cycles/blender/addon/ui.py | 6 ++++++ 2 files changed, 24 insertions(+) (limited to 'intern/cycles/blender/addon') diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index cbd1a8b1922..f48bc93cabf 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -531,6 +531,24 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): ), ) + cls.rolling_shutter_type = EnumProperty( + name="Shutter Type", + default='NONE', + description="Type of rolling shutter effect matching CMOS-based cameras", + items=( + ('NONE', "None", "No rolling shutter effect used"), + ('TOP', "Top-Bottom", "Sensor is being scanned from top to bottom") + # TODO(seergey): Are there real cameras with different scanning direction? + ), + ) + + cls.rolling_shutter_duration = FloatProperty( + name="Rolling Shutter Duration", + description="Scanline \"exposure\" time for the rolling shutter effect", + default = 0.1, + min=0.0, max=1.0, + ) + @classmethod def unregister(cls): del bpy.types.Scene.cycles diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index e2aa266d53b..495b2f21f7b 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -281,6 +281,12 @@ class CyclesRender_PT_motion_blur(CyclesButtonsPanel, Panel): row.operator("render.shutter_curve_preset", icon='LINCURVE', text="").shape = 'LINE' row.operator("render.shutter_curve_preset", icon='NOCURVE', text="").shape = 'MAX' + col = layout.column() + col.prop(cscene, "rolling_shutter_type") + row = col.row() + row.active = cscene.rolling_shutter_type != 'NONE' + row.prop(cscene, "rolling_shutter_duration") + class CyclesRender_PT_film(CyclesButtonsPanel, Panel): bl_label = "Film" -- cgit v1.2.3