Skip to content

Commit

Permalink
disable most imagepipeline plugins in viewport when viewport denoisin…
Browse files Browse the repository at this point in the history
…g is enabled
  • Loading branch information
Theverat committed Jun 2, 2019
1 parent 11f0c2a commit e991faa
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
37 changes: 19 additions & 18 deletions export/imagepipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,32 @@ def convert_defs(context, scene, definitions, plugin_index, define_radiancescale
if pipeline.tonemapper.enabled:
index = convert_tonemapper(definitions, index, pipeline.tonemapper)

# Note: Blender expects the alpha to be NOT premultiplied, so we only
# premultiply it when the backgroundimage plugin is used
if use_backgroundimage(context, scene):
index = _premul_alpha(definitions, index)
if not (context and scene.luxcore.viewport.denoise):
# Note: Blender expects the alpha to be NOT premultiplied, so we only
# premultiply it when the backgroundimage plugin is used
if use_backgroundimage(context, scene):
index = _premul_alpha(definitions, index)

if use_backgroundimage(context, scene):
index = _backgroundimage(definitions, index, pipeline.backgroundimage, scene)
if use_backgroundimage(context, scene):
index = _backgroundimage(definitions, index, pipeline.backgroundimage, scene)

if pipeline.mist.enabled:
index = _mist(definitions, index, pipeline.mist, scene)
if pipeline.mist.enabled:
index = _mist(definitions, index, pipeline.mist, scene)

if pipeline.bloom.enabled:
index = _bloom(definitions, index, pipeline.bloom)
if pipeline.bloom.enabled:
index = _bloom(definitions, index, pipeline.bloom)

if pipeline.coloraberration.enabled:
index = _coloraberration(definitions, index, pipeline.coloraberration)
if pipeline.coloraberration.enabled:
index = _coloraberration(definitions, index, pipeline.coloraberration)

if pipeline.vignetting.enabled:
index = _vignetting(definitions, index, pipeline.vignetting)
if pipeline.vignetting.enabled:
index = _vignetting(definitions, index, pipeline.vignetting)

if pipeline.camera_response_func.enabled:
index = _camera_response_func(definitions, index, pipeline.camera_response_func, scene)
if pipeline.camera_response_func.enabled:
index = _camera_response_func(definitions, index, pipeline.camera_response_func, scene)

if pipeline.contour_lines.enabled:
index = _contour_lines(definitions, index, pipeline.contour_lines)
if pipeline.contour_lines.enabled:
index = _contour_lines(definitions, index, pipeline.contour_lines)

if use_filesaver:
# Needs gamma correction (Blender applies it for us,
Expand Down
4 changes: 3 additions & 1 deletion properties/viewport.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ class LuxCoreViewportSettings(bpy.types.PropertyGroup):
"the RT Path engine is used in the viewport, which is optimized "
"for quick feedback but can't handle complex light paths")

denoise = BoolProperty(name="Denoise", default=True)
denoise = BoolProperty(name="Denoise", default=True,
description="Denoise the viewport render once the halt time is reached. "
"Note that this disables most imagepipeline plugins in the viewport")
3 changes: 3 additions & 0 deletions ui/camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ def draw(self, context):
msg = name + " and multiple renderlayers will cause brightness difference!"
box.label(msg, icon=icons.WARNING)

if context.scene.luxcore.viewport.denoise:
layout.label("Plugins below disabled in viewport because of viewport denoising", icon=icons.INFO)

# Bloom settings
bloom = pipeline.bloom
box = self.draw_plugin_box(bloom)
Expand Down

0 comments on commit e991faa

Please sign in to comment.