diff options
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 13 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 32 | ||||
-rw-r--r-- | intern/cycles/blender/addon/version_update.py | 9 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.cpp | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_blender_version.h | 2 |
5 files changed, 50 insertions, 8 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index dc4437bdc52..cda1355eb2d 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -801,17 +801,22 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): items=enum_texture_limit ) + use_fast_gi: BoolProperty( + name="Fast GI Approximation", + description="Approximate diffuse indirect light with background tinted ambient occlusion. This provides fast alternative to full global illumination, for interactive viewport rendering or final renders with reduced quality", + default=False, + ) ao_bounces: IntProperty( name="AO Bounces", - default=0, - description="Approximate indirect light with background tinted ambient occlusion at the specified bounce, 0 disables this feature", + default=1, + description="After this number of light bounces, use approximate global illumination. 0 disables this feature", min=0, max=1024, ) ao_bounces_render: IntProperty( name="AO Bounces Render", - default=0, - description="Approximate indirect light with background tinted ambient occlusion at the specified bounce, 0 disables this feature", + default=1, + description="After this number of light bounces, use approximate global illumination. 0 disables this feature", min=0, max=1024, ) diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 4e8527387c0..28fc48f33d3 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -526,6 +526,35 @@ class CYCLES_RENDER_PT_light_paths_caustics(CyclesButtonsPanel, Panel): col.prop(cscene, "caustics_refractive", text="Refractive") +class CYCLES_RENDER_PT_light_paths_fast_gi(CyclesButtonsPanel, Panel): + bl_label = "Fast GI Approximation" + bl_options = {'DEFAULT_CLOSED'} + bl_parent_id = "CYCLES_RENDER_PT_light_paths" + + def draw_header(self, context): + scene = context.scene + cscene = scene.cycles + + self.layout.prop(cscene, "use_fast_gi", text="") + + def draw(self, context): + scene = context.scene + cscene = scene.cycles + world = scene.world + + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False + + col = layout.column(align=True) + col.prop(cscene, "ao_bounces", text="Viewport Bounces") + col.prop(cscene, "ao_bounces_render", text="Render Bounces") + + if world: + light = world.light_settings + layout.prop(light, "distance", text="AO Distance") + + class CYCLES_RENDER_PT_motion_blur(CyclesButtonsPanel, Panel): bl_label = "Motion Blur" bl_options = {'DEFAULT_CLOSED'} @@ -2041,7 +2070,6 @@ class CYCLES_RENDER_PT_simplify_viewport(CyclesButtonsPanel, Panel): col.prop(rd, "simplify_subdivision", text="Max Subdivision") col.prop(rd, "simplify_child_particles", text="Child Particles") col.prop(cscene, "texture_limit", text="Texture Limit") - col.prop(cscene, "ao_bounces", text="AO Bounces") col.prop(rd, "simplify_volumes", text="Volume Resolution") @@ -2067,7 +2095,6 @@ class CYCLES_RENDER_PT_simplify_render(CyclesButtonsPanel, Panel): col.prop(rd, "simplify_subdivision_render", text="Max Subdivision") col.prop(rd, "simplify_child_particles_render", text="Child Particles") col.prop(cscene, "texture_limit_render", text="Texture Limit") - col.prop(cscene, "ao_bounces_render", text="AO Bounces") class CYCLES_RENDER_PT_simplify_culling(CyclesButtonsPanel, Panel): @@ -2245,6 +2272,7 @@ classes = ( CYCLES_RENDER_PT_light_paths_max_bounces, CYCLES_RENDER_PT_light_paths_clamping, CYCLES_RENDER_PT_light_paths_caustics, + CYCLES_RENDER_PT_light_paths_fast_gi, CYCLES_RENDER_PT_volumes, CYCLES_RENDER_PT_subdivision, CYCLES_RENDER_PT_hair, diff --git a/intern/cycles/blender/addon/version_update.py b/intern/cycles/blender/addon/version_update.py index aeecc265399..7c57bdf453c 100644 --- a/intern/cycles/blender/addon/version_update.py +++ b/intern/cycles/blender/addon/version_update.py @@ -217,6 +217,15 @@ def do_versions(self): baov.name = caov.get("name", "AOV") baov.type = "COLOR" if caov.get("type", 1) == 1 else "VALUE" + if version <= (2, 93, 16): + cscene = scene.cycles + if scene.render.use_simplify and \ + (cscene.ao_bounces or cscene.ao_bounces_render): + cscene.use_fast_gi = True + else: + cscene.ao_bounces = 1 + cscene.ao_bounces_render = 1 + # Lamps for light in bpy.data.lights: if light.library not in libraries: diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index 0e61f4f2615..bbeb6858b76 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -358,7 +358,7 @@ void BlenderSync::sync_integrator() integrator->set_adaptive_min_samples(adaptive_min_samples); - if (b_scene.render().use_simplify()) { + if (get_boolean(cscene, "use_fast_gi")) { if (preview) { integrator->set_ao_bounces(get_int(cscene, "ao_bounces")); } diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 3d57d55af2a..7d5b12cea6d 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -39,7 +39,7 @@ extern "C" { /* Blender file format version. */ #define BLENDER_FILE_VERSION BLENDER_VERSION -#define BLENDER_FILE_SUBVERSION 16 +#define BLENDER_FILE_SUBVERSION 17 /* Minimum Blender version that supports reading file written with the current * version. Older Blender versions will test this and show a warning if the file |