Cycles: add back control to render first N bounces with path termination
It's found in the Sampling > Advanced panel and 0 by default. This helps to reduce noise in some scenes, while making others slower.
This commit is contained in:
parent
4e8c5f4bc8
commit
c9238e638f
Notes:
blender-bot
2023-12-08 16:39:08 +01:00
Referenced by issue #66642, The rendering result of hair is diffirent in the diffirent version!!!
|
@ -291,6 +291,21 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
|
|||
default=0.01,
|
||||
)
|
||||
|
||||
min_light_bounces: IntProperty(
|
||||
name="Min Light Bounces",
|
||||
description="Minimum number of light bounces. Setting this higher reduces noise in the first bounces, "
|
||||
"but can also be less efficient for more complex geometry like hair and volumes",
|
||||
min=0, max=1024,
|
||||
default=0,
|
||||
)
|
||||
min_transparent_bounces: IntProperty(
|
||||
name="Min Transparent Bounces",
|
||||
description="Minimum number of transparnet bounces. Setting this higher reduces noise in the first bounces, "
|
||||
"but can also be less efficient for more complex geometry like hair and volumes",
|
||||
min=0, max=1024,
|
||||
default=0,
|
||||
)
|
||||
|
||||
caustics_reflective: BoolProperty(
|
||||
name="Reflective Caustics",
|
||||
description="Use reflective caustics, resulting in a brighter image (more noise but added realism)",
|
||||
|
|
|
@ -237,6 +237,8 @@ class CYCLES_RENDER_PT_sampling_advanced(CyclesButtonsPanel, Panel):
|
|||
layout.separator()
|
||||
|
||||
col = layout.column(align=True)
|
||||
col.prop(cscene, "min_light_bounces")
|
||||
col.prop(cscene, "min_transparent_bounces")
|
||||
col.prop(cscene, "light_sampling_threshold", text="Light Threshold")
|
||||
|
||||
if cscene.progressive != 'PATH' and use_branched_path(context):
|
||||
|
|
|
@ -235,6 +235,7 @@ void BlenderSync::sync_integrator()
|
|||
Integrator *integrator = scene->integrator;
|
||||
Integrator previntegrator = *integrator;
|
||||
|
||||
integrator->min_bounce = get_int(cscene, "min_light_bounces");
|
||||
integrator->max_bounce = get_int(cscene, "max_bounces");
|
||||
|
||||
integrator->max_diffuse_bounce = get_int(cscene, "diffuse_bounces");
|
||||
|
@ -242,6 +243,7 @@ void BlenderSync::sync_integrator()
|
|||
integrator->max_transmission_bounce = get_int(cscene, "transmission_bounces");
|
||||
integrator->max_volume_bounce = get_int(cscene, "volume_bounces");
|
||||
|
||||
integrator->transparent_min_bounce = get_int(cscene, "min_transparent_bounces");
|
||||
integrator->transparent_max_bounce = get_int(cscene, "transparent_max_bounces");
|
||||
|
||||
integrator->volume_max_steps = get_int(cscene, "volume_max_steps");
|
||||
|
|
|
@ -209,8 +209,8 @@ ccl_device_inline float path_state_continuation_probability(KernelGlobals *kg,
|
|||
return 0.0f;
|
||||
}
|
||||
else if (state->flag & PATH_RAY_TRANSPARENT) {
|
||||
/* Do at least one bounce without RR. */
|
||||
if (state->transparent_bounce <= 1) {
|
||||
/* Do at least specified number of bounces without RR. */
|
||||
if (state->transparent_bounce <= kernel_data.integrator.transparent_min_bounce) {
|
||||
return 1.0f;
|
||||
}
|
||||
#ifdef __SHADOW_TRICKS__
|
||||
|
@ -221,8 +221,8 @@ ccl_device_inline float path_state_continuation_probability(KernelGlobals *kg,
|
|||
#endif
|
||||
}
|
||||
else {
|
||||
/* Do at least one bounce without RR. */
|
||||
if (state->bounce <= 1) {
|
||||
/* Do at least specified number of bounces without RR. */
|
||||
if (state->bounce <= kernel_data.integrator.min_bounce) {
|
||||
return 1.0f;
|
||||
}
|
||||
#ifdef __SHADOW_TRICKS__
|
||||
|
|
|
@ -1271,6 +1271,7 @@ typedef struct KernelIntegrator {
|
|||
int portal_offset;
|
||||
|
||||
/* bounces */
|
||||
int min_bounce;
|
||||
int max_bounce;
|
||||
|
||||
int max_diffuse_bounce;
|
||||
|
@ -1281,6 +1282,7 @@ typedef struct KernelIntegrator {
|
|||
int ao_bounces;
|
||||
|
||||
/* transparent */
|
||||
int transparent_min_bounce;
|
||||
int transparent_max_bounce;
|
||||
int transparent_shadows;
|
||||
|
||||
|
@ -1325,7 +1327,7 @@ typedef struct KernelIntegrator {
|
|||
|
||||
int max_closures;
|
||||
|
||||
int pad1, pad2, pad3;
|
||||
int pad1;
|
||||
} KernelIntegrator;
|
||||
static_assert_align(KernelIntegrator, 16);
|
||||
|
||||
|
|
|
@ -32,6 +32,7 @@ NODE_DEFINE(Integrator)
|
|||
{
|
||||
NodeType *type = NodeType::add("integrator", create);
|
||||
|
||||
SOCKET_INT(min_bounce, "Min Bounce", 0);
|
||||
SOCKET_INT(max_bounce, "Max Bounce", 7);
|
||||
|
||||
SOCKET_INT(max_diffuse_bounce, "Max Diffuse Bounce", 7);
|
||||
|
@ -39,6 +40,7 @@ NODE_DEFINE(Integrator)
|
|||
SOCKET_INT(max_transmission_bounce, "Max Transmission Bounce", 7);
|
||||
SOCKET_INT(max_volume_bounce, "Max Volume Bounce", 7);
|
||||
|
||||
SOCKET_INT(transparent_min_bounce, "Transparent Min Bounce", 0);
|
||||
SOCKET_INT(transparent_max_bounce, "Transparent Max Bounce", 7);
|
||||
|
||||
SOCKET_INT(ao_bounces, "AO Bounces", 0);
|
||||
|
@ -100,6 +102,7 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
|
|||
KernelIntegrator *kintegrator = &dscene->data.integrator;
|
||||
|
||||
/* integrator parameters */
|
||||
kintegrator->min_bounce = min_bounce + 1;
|
||||
kintegrator->max_bounce = max_bounce + 1;
|
||||
|
||||
kintegrator->max_diffuse_bounce = max_diffuse_bounce + 1;
|
||||
|
@ -107,6 +110,7 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene
|
|||
kintegrator->max_transmission_bounce = max_transmission_bounce + 1;
|
||||
kintegrator->max_volume_bounce = max_volume_bounce + 1;
|
||||
|
||||
kintegrator->transparent_min_bounce = transparent_min_bounce + 1;
|
||||
kintegrator->transparent_max_bounce = transparent_max_bounce + 1;
|
||||
|
||||
if (ao_bounces == 0) {
|
||||
|
|
|
@ -31,6 +31,7 @@ class Integrator : public Node {
|
|||
public:
|
||||
NODE_DECLARE
|
||||
|
||||
int min_bounce;
|
||||
int max_bounce;
|
||||
|
||||
int max_diffuse_bounce;
|
||||
|
@ -38,6 +39,7 @@ class Integrator : public Node {
|
|||
int max_transmission_bounce;
|
||||
int max_volume_bounce;
|
||||
|
||||
int transparent_min_bounce;
|
||||
int transparent_max_bounce;
|
||||
|
||||
int ao_bounces;
|
||||
|
|
|
@ -396,7 +396,7 @@ void ImageTextureNode::compile(OSLCompiler &compiler)
|
|||
|
||||
if (slot == -1) {
|
||||
compiler.parameter_texture(
|
||||
"filename", filename, compress_as_srgb ? known_colorspace : u_colorspace_raw);
|
||||
"filename", filename, compress_as_srgb ? u_colorspace_raw : known_colorspace);
|
||||
}
|
||||
else {
|
||||
compiler.parameter_texture("filename", slot);
|
||||
|
@ -584,7 +584,7 @@ void EnvironmentTextureNode::compile(OSLCompiler &compiler)
|
|||
|
||||
if (slot == -1) {
|
||||
compiler.parameter_texture(
|
||||
"filename", filename, compress_as_srgb ? known_colorspace : u_colorspace_raw);
|
||||
"filename", filename, compress_as_srgb ? u_colorspace_raw : known_colorspace);
|
||||
}
|
||||
else {
|
||||
compiler.parameter_texture("filename", slot);
|
||||
|
|
Loading…
Reference in New Issue