feat: add additional render options (noise threshold, denoising, max bounces)
This commit is contained in:
BIN
__pycache__/operators.cpython-311.pyc
Normal file
BIN
__pycache__/operators.cpython-311.pyc
Normal file
Binary file not shown.
BIN
__pycache__/panel.cpython-311.pyc
Normal file
BIN
__pycache__/panel.cpython-311.pyc
Normal file
Binary file not shown.
BIN
__pycache__/properties.cpython-311.pyc
Normal file
BIN
__pycache__/properties.cpython-311.pyc
Normal file
Binary file not shown.
12
operators.py
12
operators.py
@@ -111,7 +111,13 @@ class SCENERENDERER_OT_render_all(bpy.types.Operator):
|
||||
|
||||
c = scene.cycles
|
||||
c.samples = 1 if settings["test_mode"] else settings["samples"]
|
||||
|
||||
c.use_adaptive_sampling = settings["use_noise_threshold"]
|
||||
if c.use_adaptive_sampling:
|
||||
c.adaptive_threshold = settings["noise_threshold"]
|
||||
c.use_denoising = settings["use_denoising"]
|
||||
if hasattr(c, 'max_bounces'):
|
||||
c.max_bounces = settings["max_bounces"]
|
||||
|
||||
if settings["exposure"] != 0.0:
|
||||
scene.view_settings.exposure = settings["exposure"]
|
||||
scene.cycles.film_exposure = 2.0 ** settings["exposure"]
|
||||
@@ -180,6 +186,10 @@ class SCENERENDERER_OT_render_all(bpy.types.Operator):
|
||||
"skip_existing": settings.skip_existing,
|
||||
"use_cpu": settings.use_cpu,
|
||||
"samples": settings.samples,
|
||||
"use_noise_threshold": settings.use_noise_threshold,
|
||||
"noise_threshold": settings.noise_threshold,
|
||||
"use_denoising": settings.use_denoising,
|
||||
"max_bounces": settings.max_bounces,
|
||||
"exposure": settings.exposure,
|
||||
"look": settings.look,
|
||||
}
|
||||
|
||||
13
panel.py
13
panel.py
@@ -17,7 +17,18 @@ class SCENERENDERER_PT_panel(bpy.types.Panel):
|
||||
row.prop(settings, "skip_existing", toggle=True)
|
||||
|
||||
layout.prop(settings, "use_cpu")
|
||||
layout.prop(settings, "samples")
|
||||
box = layout.box()
|
||||
box.label(text="Cycles Render", icon='SCENE_DATA')
|
||||
box.prop(settings, "samples")
|
||||
|
||||
row = box.row()
|
||||
row.prop(settings, "use_noise_threshold", text="Noise Threshold")
|
||||
sub = row.row()
|
||||
sub.active = settings.use_noise_threshold
|
||||
sub.prop(settings, "noise_threshold", text="")
|
||||
|
||||
box.prop(settings, "use_denoising")
|
||||
box.prop(settings, "max_bounces")
|
||||
|
||||
box = layout.box()
|
||||
box.label(text="Color", icon='SHADING_RENDERED')
|
||||
|
||||
@@ -22,6 +22,26 @@ class SceneRendererSettings(bpy.types.PropertyGroup):
|
||||
description="Cycles render samples",
|
||||
default=4096, min=1, max=65536,
|
||||
)
|
||||
use_noise_threshold: bpy.props.BoolProperty(
|
||||
name="Use Noise Threshold",
|
||||
description="Stop sampling when the noise is below this threshold",
|
||||
default=True,
|
||||
)
|
||||
noise_threshold: bpy.props.FloatProperty(
|
||||
name="Noise Threshold",
|
||||
description="Noise threshold for adaptive sampling",
|
||||
default=0.01, min=0.0001, max=1.0, precision=4,
|
||||
)
|
||||
use_denoising: bpy.props.BoolProperty(
|
||||
name="Use Denoising",
|
||||
description="Enable denoising for final render",
|
||||
default=True,
|
||||
)
|
||||
max_bounces: bpy.props.IntProperty(
|
||||
name="Max Bounces",
|
||||
description="Total maximum number of light bounces",
|
||||
default=12, min=0, max=1024,
|
||||
)
|
||||
exposure: bpy.props.FloatProperty(
|
||||
name="Exposure",
|
||||
description="Exposure boost in stops",
|
||||
|
||||
Reference in New Issue
Block a user