diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-06-13 15:44:48 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-06-13 15:44:48 +0400 |
commit | 4ba456d1754c29b488b8304c8546af45078e8536 (patch) | |
tree | 49649b7442d58aa835a7428043130f158613521d /intern/cycles/blender/addon | |
parent | dcda234a3d93ed44189fac3716a694f4f75f366e (diff) |
Cycles: first step for implementation of non-progressive sampler that handles
direct and indirect lighting differently. Rather than picking one light for each
point on the path, it now loops over all lights for direct lighting. For indirect
lighting it still picks a random light each time.
It gives control over the number of AA samples, and the number of Diffuse, Glossy,
Transmission, AO, Mesh Light, Background and Lamp samples for each AA sample.
This helps tuning render performance/noise and tends to give less noise for renders
dominated by direct lighting.
This sampling mode only works on the CPU, and still needs proper tile rendering
to show progress (will follow tommorrow or so), because each AA sample can be quite
slow now and so the delay between each update wil be too long.
Diffstat (limited to 'intern/cycles/blender/addon')
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 61 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 74 |
2 files changed, 118 insertions, 17 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 3ade04c4658..7ce3b949bb1 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -57,6 +57,12 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): default='GPU_COMPATIBLE', ) + cls.progressive = BoolProperty( + name="Progressive", + description="Use progressive sampling of lighting", + default=True, + ) + cls.samples = IntProperty( name="Samples", description="Number of samples to render for each pixel", @@ -80,6 +86,49 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): default=False, ) + cls.aa_samples = IntProperty( + name="AA Samples", + description="Number of antialiasing samples to render for each pixel", + min=1, max=10000, + default=4, + ) + cls.preview_aa_samples = IntProperty( + name="AA Samples", + description="Number of antialiasing samples to in viewport, unlimited if 0", + min=1, max=10000, + default=4, + ) + cls.diffuse_samples = IntProperty( + name="Diffuse Samples", + description="Number of diffuse bounce samples to render for each AA sample", + min=1, max=10000, + default=1, + ) + cls.glossy_samples = IntProperty( + name="Glossy Samples", + description="Number of glossy bounce samples to render for each AA sample", + min=1, max=10000, + default=1, + ) + cls.transmission_samples = IntProperty( + name="Transmission Samples", + description="Number of transmission bounce samples to render for each AA sample", + min=1, max=10000, + default=1, + ) + cls.ao_samples = IntProperty( + name="Ambient Occlusion Samples", + description="Number of ambient occlusion samples to render for each AA sample", + min=1, max=10000, + default=1, + ) + cls.mesh_light_samples = IntProperty( + name="Mesh Light Samples", + description="Number of mesh emission light samples to render for each AA sample", + min=1, max=10000, + default=1, + ) + cls.no_caustics = BoolProperty( name="No Caustics", description="Leave out caustics, resulting in a darker image with less noise", @@ -340,6 +389,12 @@ class CyclesLampSettings(bpy.types.PropertyGroup): description="Lamp casts shadows", default=True, ) + cls.samples = IntProperty( + name="Samples", + description="Number of light samples to render for each AA sample", + min=1, max=10000, + default=1, + ) @classmethod def unregister(cls): @@ -365,6 +420,12 @@ class CyclesWorldSettings(bpy.types.PropertyGroup): min=4, max=8096, default=256, ) + cls.samples = IntProperty( + name="Samples", + description="Number of light samples to render for each AA sample", + min=1, max=10000, + default=4, + ) @classmethod def unregister(cls): diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 3b906bb4bdf..6f2b33b2815 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -44,8 +44,48 @@ class CyclesButtonsPanel(): return rd.engine == 'CYCLES' -class CyclesRender_PT_integrator(CyclesButtonsPanel, Panel): - bl_label = "Integrator" +class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel): + bl_label = "Sampling" + bl_options = {'DEFAULT_CLOSED'} + + def draw(self, context): + layout = self.layout + + scene = context.scene + cscene = scene.cycles + + split = layout.split() + + col = split.column() + sub = col.column(align=True) + sub.active = cscene.device == 'CPU' + sub.prop(cscene, "progressive") + + sub = col.column(align=True) + sub.prop(cscene, "seed") + sub.prop(cscene, "sample_clamp") + + if cscene.progressive or cscene.device != 'CPU': + col = split.column(align=True) + col.label(text="Samples:") + col.prop(cscene, "samples", text="Render") + col.prop(cscene, "preview_samples", text="Preview") + else: + sub = col.column(align=True) + sub.label(text="AA Samples:") + sub.prop(cscene, "aa_samples", text="Render") + sub.prop(cscene, "preview_aa_samples", text="Preview") + + col = split.column(align=True) + col.label(text="Samples:") + col.prop(cscene, "diffuse_samples", text="Diffuse") + col.prop(cscene, "glossy_samples", text="Glossy") + col.prop(cscene, "transmission_samples", text="Transmission") + col.prop(cscene, "ao_samples", text="AO") + col.prop(cscene, "mesh_light_samples", text="Mesh Light") + +class CyclesRender_PT_light_paths(CyclesButtonsPanel, Panel): + bl_label = "Light Paths" bl_options = {'DEFAULT_CLOSED'} def draw(self, context): @@ -62,12 +102,6 @@ class CyclesRender_PT_integrator(CyclesButtonsPanel, Panel): split = layout.split() col = split.column() - sub = col.column(align=True) - sub.label(text="Samples:") - sub.prop(cscene, "samples", text="Render") - sub.prop(cscene, "preview_samples", text="Preview") - sub.prop(cscene, "seed") - sub.prop(cscene, "sample_clamp") sub = col.column(align=True) sub.label("Transparency:") @@ -75,6 +109,11 @@ class CyclesRender_PT_integrator(CyclesButtonsPanel, Panel): sub.prop(cscene, "transparent_min_bounces", text="Min") sub.prop(cscene, "use_transparent_shadows", text="Shadows") + col.separator() + + col.prop(cscene, "no_caustics") + col.prop(cscene, "blur_glossy") + col = split.column() sub = col.column(align=True) @@ -83,16 +122,10 @@ class CyclesRender_PT_integrator(CyclesButtonsPanel, Panel): sub.prop(cscene, "min_bounces", text="Min") sub = col.column(align=True) - sub.label(text="Light Paths:") sub.prop(cscene, "diffuse_bounces", text="Diffuse") sub.prop(cscene, "glossy_bounces", text="Glossy") sub.prop(cscene, "transmission_bounces", text="Transmission") - col.separator() - - col.prop(cscene, "no_caustics") - col.prop(cscene, "blur_glossy") - class CyclesRender_PT_motion_blur(CyclesButtonsPanel, Panel): bl_label = "Motion Blur" @@ -467,6 +500,7 @@ class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel): lamp = context.lamp clamp = lamp.cycles + cscene = context.scene.cycles layout.prop(lamp, "type", expand=True) @@ -485,6 +519,9 @@ class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel): sub.prop(lamp, "size", text="Size X") sub.prop(lamp, "size_y", text="Size Y") + if not cscene.progressive and cscene.device == 'CPU': + col.prop(clamp, "samples") + col = split.column() col.prop(clamp, "cast_shadow") @@ -604,13 +641,16 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel): world = context.world cworld = world.cycles + cscene = context.scene.cycles col = layout.column() col.prop(cworld, "sample_as_light") - row = col.row() - row.active = cworld.sample_as_light - row.prop(cworld, "sample_map_resolution") + sub = col.row(align=True) + sub.active = cworld.sample_as_light + sub.prop(cworld, "sample_map_resolution") + if not cscene.progressive and cscene.device == 'CPU': + sub.prop(cworld, "samples") class CyclesMaterial_PT_surface(CyclesButtonsPanel, Panel): |