Commit: dec2431d3622c99b4ec84e6ab453d9bef2252d93 Author: Kévin Dietrich Date: Wed Oct 28 12:53:52 2020 +0100 Branches: cycles_procedural_api https://developer.blender.org/rBdec2431d3622c99b4ec84e6ab453d9bef2252d93
avoid infinite loops in the viewport when synchronizing the Integrator =================================================================== M intern/cycles/blender/blender_sync.cpp =================================================================== diff --git a/intern/cycles/blender/blender_sync.cpp b/intern/cycles/blender/blender_sync.cpp index 931bbb509b1..7df57392fb3 100644 --- a/intern/cycles/blender/blender_sync.cpp +++ b/intern/cycles/blender/blender_sync.cpp @@ -299,9 +299,6 @@ void BlenderSync::sync_integrator() integrator->set_seed(seed); - integrator->set_sampling_pattern((SamplingPattern)get_enum( - cscene, "sampling_pattern", SAMPLING_NUM_PATTERNS, SAMPLING_PATTERN_SOBOL)); - integrator->set_sample_clamp_direct(get_float(cscene, "sample_clamp_direct")); integrator->set_sample_clamp_indirect(get_float(cscene, "sample_clamp_indirect")); if (!preview) { @@ -320,16 +317,22 @@ void BlenderSync::sync_integrator() integrator->set_sample_all_lights_indirect(get_boolean(cscene, "sample_all_lights_indirect")); integrator->set_light_sampling_threshold(get_float(cscene, "light_sampling_threshold")); + SamplingPattern sampling_pattern = (SamplingPattern)get_enum( + cscene, "sampling_pattern", SAMPLING_NUM_PATTERNS, SAMPLING_PATTERN_SOBOL); + + int adaptive_min_samples = INT_MAX; + if (RNA_boolean_get(&cscene, "use_adaptive_sampling")) { - integrator->set_sampling_pattern(SAMPLING_PATTERN_PMJ); - integrator->set_adaptive_min_samples(get_int(cscene, "adaptive_min_samples")); + sampling_pattern = SAMPLING_PATTERN_PMJ; + adaptive_min_samples = get_int(cscene, "adaptive_min_samples"); integrator->set_adaptive_threshold(get_float(cscene, "adaptive_threshold")); } else { - integrator->set_adaptive_min_samples(INT_MAX); integrator->set_adaptive_threshold(0.0f); } + integrator->set_sampling_pattern(sampling_pattern); + int diffuse_samples = get_int(cscene, "diffuse_samples"); int glossy_samples = get_int(cscene, "glossy_samples"); int transmission_samples = get_int(cscene, "transmission_samples"); @@ -346,8 +349,7 @@ void BlenderSync::sync_integrator() integrator->set_mesh_light_samples(mesh_light_samples * mesh_light_samples); integrator->set_subsurface_samples(subsurface_samples * subsurface_samples); integrator->set_volume_samples(volume_samples * volume_samples); - integrator->set_adaptive_min_samples(min( - integrator->get_adaptive_min_samples() * integrator->get_adaptive_min_samples(), INT_MAX)); + adaptive_min_samples = min(adaptive_min_samples * adaptive_min_samples, INT_MAX); } else { integrator->set_diffuse_samples(diffuse_samples); @@ -359,6 +361,8 @@ void BlenderSync::sync_integrator() integrator->set_volume_samples(volume_samples); } + integrator->set_adaptive_min_samples(adaptive_min_samples); + if (b_scene.render().use_simplify()) { if (preview) { integrator->set_ao_bounces(get_int(cscene, "ao_bounces")); _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs