diff options
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r-- | intern/cycles/blender/CMakeLists.txt | 5 | ||||
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 20 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 24 | ||||
-rw-r--r-- | intern/cycles/blender/curves.cpp | 4 | ||||
-rw-r--r-- | intern/cycles/blender/display_driver.cpp | 2 | ||||
-rw-r--r-- | intern/cycles/blender/mesh.cpp | 6 | ||||
-rw-r--r-- | intern/cycles/blender/python.cpp | 8 | ||||
-rw-r--r-- | intern/cycles/blender/sync.cpp | 19 | ||||
-rw-r--r-- | intern/cycles/blender/util.h | 4 |
9 files changed, 66 insertions, 26 deletions
diff --git a/intern/cycles/blender/CMakeLists.txt b/intern/cycles/blender/CMakeLists.txt index 149967ad331..f0540486656 100644 --- a/intern/cycles/blender/CMakeLists.txt +++ b/intern/cycles/blender/CMakeLists.txt @@ -138,11 +138,6 @@ endif() blender_add_lib(bf_intern_cycles "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") -# avoid link failure with clang 3.4 debug -if(CMAKE_C_COMPILER_ID MATCHES "Clang" AND NOT ${CMAKE_C_COMPILER_VERSION} VERSION_LESS '3.4') - string(APPEND CMAKE_CXX_FLAGS_DEBUG " -gline-tables-only") -endif() - add_dependencies(bf_intern_cycles bf_rna) delayed_install(${CMAKE_CURRENT_SOURCE_DIR} "${ADDON_FILES}" ${CYCLES_INSTALL_PATH}) diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 19580914f19..0de936ddb11 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -218,6 +218,12 @@ enum_denoising_prefilter = ( ('ACCURATE', "Accurate", "Prefilter noisy guiding passes before denoising color. Improves quality when guiding passes are noisy using extra processing time", 3), ) +enum_direct_light_sampling_type = ( + ('MULTIPLE_IMPORTANCE_SAMPLING', "Multiple Importance Sampling", "Multiple importance sampling is used to combine direct light contributions from next-event estimation and forward path tracing", 0), + ('FORWARD_PATH_TRACING', "Forward Path Tracing", "Direct light contributions are only sampled using forward path tracing", 1), + ('NEXT_EVENT_ESTIMATION', "Next-Event Estimation", "Direct light contributions are only sampled using next-event estimation", 2), +) + def update_render_passes(self, context): scene = context.scene view_layer = context.view_layer @@ -325,6 +331,13 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): default=1024, ) + sample_offset: IntProperty( + name="Sample Offset", + description="Number of samples to skip when starting render", + min=0, max=(1 << 24), + default=0, + ) + time_limit: FloatProperty( name="Time Limit", description="Limit the render time (excluding synchronization time)." @@ -415,6 +428,13 @@ class CyclesRenderSettings(bpy.types.PropertyGroup): default=0, ) + direct_light_sampling_type: EnumProperty( + name="Direct Light Sampling", + description="The type of strategy used for sampling direct light contributions", + items=enum_direct_light_sampling_type, + default='MULTIPLE_IMPORTANCE_SAMPLING', + ) + min_light_bounces: IntProperty( name="Min Light Bounces", description="Minimum number of light bounces. Setting this higher reduces noise in the first bounces, " diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 397823103c8..6fd21db38ae 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -290,6 +290,9 @@ class CYCLES_RENDER_PT_sampling_advanced(CyclesButtonsPanel, Panel): col.active = not (cscene.use_adaptive_sampling and cscene.use_preview_adaptive_sampling) col.prop(cscene, "sampling_pattern", text="Pattern") + col = layout.column(align=True) + col.prop(cscene, "sample_offset") + layout.separator() heading = layout.column(align=True, heading="Scrambling Distance") @@ -1816,37 +1819,38 @@ class CYCLES_RENDER_PT_debug(CyclesDebugButtonsPanel, Panel): def draw(self, context): layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False # No animation. scene = context.scene cscene = scene.cycles - col = layout.column() + col = layout.column(heading="CPU") - col.label(text="CPU Flags:") row = col.row(align=True) row.prop(cscene, "debug_use_cpu_sse2", toggle=True) row.prop(cscene, "debug_use_cpu_sse3", toggle=True) row.prop(cscene, "debug_use_cpu_sse41", toggle=True) row.prop(cscene, "debug_use_cpu_avx", toggle=True) row.prop(cscene, "debug_use_cpu_avx2", toggle=True) - col.prop(cscene, "debug_bvh_layout") + col.prop(cscene, "debug_bvh_layout", text="BVH") col.separator() - col = layout.column() - col.label(text="CUDA Flags:") + col = layout.column(heading="CUDA") col.prop(cscene, "debug_use_cuda_adaptive_compile") + col = layout.column(heading="OptiX") + col.prop(cscene, "debug_use_optix_debug", text="Module Debug") col.separator() - col = layout.column() - col.label(text="OptiX Flags:") - col.prop(cscene, "debug_use_optix_debug") + col.prop(cscene, "debug_bvh_type", text="Viewport BVH") col.separator() - col = layout.column() - col.prop(cscene, "debug_bvh_type") + import _cycles + if _cycles.with_debug: + col.prop(cscene, "direct_light_sampling_type") class CYCLES_RENDER_PT_simplify(CyclesButtonsPanel, Panel): diff --git a/intern/cycles/blender/curves.cpp b/intern/cycles/blender/curves.cpp index a704b803cb0..65a02d041cc 100644 --- a/intern/cycles/blender/curves.cpp +++ b/intern/cycles/blender/curves.cpp @@ -199,7 +199,7 @@ static bool ObtainCacheParticleUV(Hair *hair, b_mesh->uv_layers.begin(l); float2 uv = zero_float2(); - if (b_mesh->uv_layers.length()) + if (!b_mesh->uv_layers.empty()) b_psys.uv_on_emitter(psmd, *b_pa, pa_no, uv_num, &uv.x); CData->curve_uv.push_back_slow(uv); @@ -261,7 +261,7 @@ static bool ObtainCacheParticleVcol(Hair *hair, b_mesh->vertex_colors.begin(l); float4 vcol = make_float4(0.0f, 0.0f, 0.0f, 1.0f); - if (b_mesh->vertex_colors.length()) + if (!b_mesh->vertex_colors.empty()) b_psys.mcol_on_emitter(psmd, *b_pa, pa_no, vcol_num, &vcol.x); CData->curve_vcol.push_back_slow(vcol); diff --git a/intern/cycles/blender/display_driver.cpp b/intern/cycles/blender/display_driver.cpp index d5f6d85251e..abf421983b3 100644 --- a/intern/cycles/blender/display_driver.cpp +++ b/intern/cycles/blender/display_driver.cpp @@ -334,7 +334,7 @@ bool BlenderDisplayDriver::update_begin(const Params ¶ms, /* Update PBO dimensions if needed. * - * NOTE: Allocate the PBO for the the size which will fit the final render resolution (as in, + * NOTE: Allocate the PBO for the size which will fit the final render resolution (as in, * at a resolution divider 1. This was we don't need to recreate graphics interoperability * objects which are costly and which are tied to the specific underlying buffer size. * The downside of this approach is that when graphics interoperability is not used we are diff --git a/intern/cycles/blender/mesh.cpp b/intern/cycles/blender/mesh.cpp index b69bf88c213..bb17cfdcb45 100644 --- a/intern/cycles/blender/mesh.cpp +++ b/intern/cycles/blender/mesh.cpp @@ -555,7 +555,7 @@ static void attr_create_vertex_color(Scene *scene, Mesh *mesh, BL::Mesh &b_mesh, /* Create uv map attributes. */ static void attr_create_uv_map(Scene *scene, Mesh *mesh, BL::Mesh &b_mesh) { - if (b_mesh.uv_layers.length() != 0) { + if (!b_mesh.uv_layers.empty()) { for (BL::MeshUVLoopLayer &l : b_mesh.uv_layers) { const bool active_render = l.active_render(); AttributeStandard uv_std = (active_render) ? ATTR_STD_UV : ATTR_STD_NONE; @@ -619,7 +619,7 @@ static void attr_create_uv_map(Scene *scene, Mesh *mesh, BL::Mesh &b_mesh) static void attr_create_subd_uv_map(Scene *scene, Mesh *mesh, BL::Mesh &b_mesh, bool subdivide_uvs) { - if (b_mesh.uv_layers.length() != 0) { + if (!b_mesh.uv_layers.empty()) { BL::Mesh::uv_layers_iterator l; int i = 0; @@ -951,7 +951,7 @@ static void create_mesh(Scene *scene, N = attr_N->data_float3(); /* create generated coordinates from undeformed coordinates */ - const bool need_default_tangent = (subdivision == false) && (b_mesh.uv_layers.length() == 0) && + const bool need_default_tangent = (subdivision == false) && (b_mesh.uv_layers.empty()) && (mesh->need_attribute(scene, ATTR_STD_UV_TANGENT)); if (mesh->need_attribute(scene, ATTR_STD_GENERATED) || need_default_tangent) { Attribute *attr = attributes.add(ATTR_STD_GENERATED); diff --git a/intern/cycles/blender/python.cpp b/intern/cycles/blender/python.cpp index bb9b0a74424..012122cf9e3 100644 --- a/intern/cycles/blender/python.cpp +++ b/intern/cycles/blender/python.cpp @@ -1054,5 +1054,13 @@ void *CCL_python_module_init() Py_INCREF(Py_False); } +#ifdef WITH_CYCLES_DEBUG + PyModule_AddObject(mod, "with_debug", Py_True); + Py_INCREF(Py_True); +#else /* WITH_CYCLES_DEBUG */ + PyModule_AddObject(mod, "with_debug", Py_False); + Py_INCREF(Py_False); +#endif /* WITH_CYCLES_DEBUG */ + return (void *)mod; } diff --git a/intern/cycles/blender/sync.cpp b/intern/cycles/blender/sync.cpp index 43625a2e479..949b7cb1b3b 100644 --- a/intern/cycles/blender/sync.cpp +++ b/intern/cycles/blender/sync.cpp @@ -392,6 +392,12 @@ void BlenderSync::sync_integrator(BL::ViewLayer &b_view_layer, bool background) integrator->set_ao_bounces(0); } +#ifdef WITH_CYCLES_DEBUG + DirectLightSamplingType direct_light_sampling_type = (DirectLightSamplingType)get_enum( + cscene, "direct_light_sampling_type", DIRECT_LIGHT_SAMPLING_NUM, DIRECT_LIGHT_SAMPLING_MIS); + integrator->set_direct_light_sampling_type(direct_light_sampling_type); +#endif + const DenoiseParams denoise_params = get_denoise_params(b_scene, b_view_layer, background); integrator->set_use_denoise(denoise_params.use); @@ -835,18 +841,25 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine &b_engine, /* samples */ int samples = get_int(cscene, "samples"); int preview_samples = get_int(cscene, "preview_samples"); + int sample_offset = get_int(cscene, "sample_offset"); if (background) { params.samples = samples; + params.sample_offset = sample_offset; } else { params.samples = preview_samples; - if (params.samples == 0) + if (params.samples == 0) { params.samples = INT_MAX; + } + params.sample_offset = 0; } + /* Clamp sample offset. */ + params.sample_offset = clamp(params.sample_offset, 0, Integrator::MAX_SAMPLES); + /* Clamp samples. */ - params.samples = min(params.samples, Integrator::MAX_SAMPLES); + params.samples = clamp(params.samples, 0, Integrator::MAX_SAMPLES - params.sample_offset); /* Viewport Performance */ params.pixel_size = b_engine.get_preview_pixel_size(b_scene); @@ -865,7 +878,7 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine &b_engine, /* Time limit. */ if (background) { - params.time_limit = get_float(cscene, "time_limit"); + params.time_limit = (double)get_float(cscene, "time_limit"); } else { /* For the viewport it kind of makes more sense to think in terms of the noise floor, which is diff --git a/intern/cycles/blender/util.h b/intern/cycles/blender/util.h index 33fd2c416c8..be36bcdaaa8 100644 --- a/intern/cycles/blender/util.h +++ b/intern/cycles/blender/util.h @@ -303,7 +303,7 @@ static inline string image_user_file_path(BL::ImageUser &iuser, string filepath_str = string(filepath); if (load_tiled && ima.source() == BL::Image::source_TILED) { string udim; - if (ima.tiles.length() > 0) { + if (!ima.tiles.empty()) { udim = to_string(ima.tiles[0].number()); } string_replace(filepath_str, udim, "<UDIM>"); @@ -647,7 +647,7 @@ static inline Mesh::SubdivisionType object_subdivision_type(BL::Object &b_ob, { PointerRNA cobj = RNA_pointer_get(&b_ob.ptr, "cycles"); - if (cobj.data && b_ob.modifiers.length() > 0 && experimental) { + if (cobj.data && !b_ob.modifiers.empty() && experimental) { BL::Modifier mod = b_ob.modifiers[b_ob.modifiers.length() - 1]; bool enabled = preview ? mod.show_viewport() : mod.show_render(); |