Skip to content

Commit

Permalink
expose resolutionreduction parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Theverat committed Dec 14, 2018
1 parent 3a66d89 commit e506c80
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 4 additions & 2 deletions export/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,15 @@ def _convert_opencl_settings(scene, definitions, is_final_render):
def _convert_viewport_engine(scene, definitions, config):
_convert_path(config, definitions)

use_cpu = scene.luxcore.viewport.device == "CPU"
viewport = scene.luxcore.viewport

use_cpu = viewport.device == "CPU"
if not use_cpu and not utils.is_opencl_build():
msg = "Config: LuxCore was built without OpenCL support, can't use OpenCL engine in viewport"
scene.luxcore.errorlog.add_warning(msg)
use_cpu = True

resolutionreduction = 4 if scene.luxcore.viewport.reduce_resolution_on_edit else 1
resolutionreduction = viewport.resolution_reduction if viewport.reduce_resolution_on_edit else 1

if use_cpu:
luxcore_engine = "RTPATHCPU"
Expand Down
3 changes: 3 additions & 0 deletions properties/viewport.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class LuxCoreViewportSettings(bpy.types.PropertyGroup):
reduce_resolution_on_edit = BoolProperty(name="Reduce first sample resolution", default=True,
description="Render the first sample after editing the scene "
"with reduced resolution to provide a quicker response")
resolution_reduction = IntProperty(name="Block Size", default=4, min=2,
description="Size of the startup blocks in pixels. A size of 4 means that "
"one sample is spread over 4x4 pixels on startup")

use_bidir = BoolProperty(name="Use Bidir in Viewport", default=True,
description="Enable if your scene requires Bidir for complex light paths and "
Expand Down
7 changes: 6 additions & 1 deletion ui/viewport.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ def draw(self, context):
viewport = context.scene.luxcore.viewport

layout.prop(viewport, "halt_time")
layout.prop(viewport, "reduce_resolution_on_edit")

split = layout.split(percentage=0.6)
split.prop(viewport, "reduce_resolution_on_edit")
sub = split.row()
sub.active = viewport.reduce_resolution_on_edit
sub.prop(viewport, "resolution_reduction")

col = layout.column()
col.prop(viewport, "pixel_size")
Expand Down

0 comments on commit e506c80

Please sign in to comment.