Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new post-processing stages #524

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
250 changes: 212 additions & 38 deletions properties/scene.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ def update_stamp(self, context):
self.render_stamp += self.render_stamp_patterns

def update_name(self, context):
mapping = {'render_stamp_post_processing_stage': "Render Stamp",
mapping = {'bloom_post_processing_stage': "Bloom",
'chromatic_aberration_post_processing_stage': "Chromatic Aberration",
'color_map_post_processing_stage': "Color Map",
'render_stamp_post_processing_stage': "Render Stamp",
'tone_map_post_processing_stage': "Tone Map",
'vignette_post_processing_stage': "Vignette",
# FIXME there's no other reference of this.. should it still be here?
'isolines_post_processing_stage': "Isolines"}
self.name = mapping[self.model]

Expand All @@ -54,59 +59,74 @@ def update_name(self, context):

model: bpy.props.EnumProperty(name="model",
items=[
('bloom_post_processing_stage',
"Bloom", ""),
('chromatic_aberration_post_processing_stage',
"Chromatic Aberration", ""),
('color_map_post_processing_stage',
"Color Map", ""),
('render_stamp_post_processing_stage',
"Render Stamp", ""),
('color_map_post_processing_stage', "Color Map", "")],
('tone_map_post_processing_stage',
"Tone Map", ""),
('vignette_post_processing_stage',
"Vignette", "")],
default='render_stamp_post_processing_stage',
update=update_name)

# Render stamp
render_stamp: bpy.props.StringProperty(name="render_stamp",
description="Render stamp text",
default="appleseed {lib-version} | Time: {render-time}")
# Bloom
iterations: bpy.props.IntProperty(name="iterations",
default=4,
min=1,
soft_max=5)

render_stamp_patterns: bpy.props.EnumProperty(name="render_stamp_patterns",
description="Variables to insert into the render stamp",
items=[
('{lib-version}',
"Library Version", ""),
('{lib-name}',
"Library Name", ""),
('{lib-variant}',
"Library Variant", ""),
('{lib-config}',
"Library Configuration", ""),
('{lib-build-date}',
"Library Build Date", ""),
('{lib-build-time}',
"Library Build Time", ""),
('{render-time}',
"Render Time", ""),
('{peak-memory}', "Peak Memory", "")],
default="{render-time}",
update=update_stamp)
intensity: bpy.props.FloatProperty(name="intensity",
default=0.1,
min=0.0,
soft_max=1.0)

# Color map
threshold: bpy.props.FloatProperty(name="threshold",
default=1.0,
min=0.0,
soft_max=10.0)

soft_knee: bpy.props.FloatProperty(name="soft_knee",
default=0.5,
min=0.0,
soft_max=1.0)

debug_blur: bpy.props.BoolProperty(name="debug_blur",
default=False)

# Chromatic Aberration
strength: bpy.props.FloatProperty(name="line_thickness",
default=0.4,
min=0.0,
max=1.0)

fringe_smoothness: bpy.props.IntProperty(name="fringe_smoothness",
default=6,
min=1,
soft_max=20)

# Color Map
color_map: bpy.props.EnumProperty(name="color_map",
items=[('inferno', "Inferno", ""),
('jet', "Jet", ""),
('magma', "Magma", ""),
('plasma', "Plasma", ""),
('viridis', "Viridis", ""),
('turbo', "Turbo", ""),
('custom', "Custom", "")],
default='inferno')

color_map_file_path: bpy.props.StringProperty(name="color_map_file_path",
default="",
subtype='FILE_PATH')

auto_range: bpy.props.BoolProperty(name="auto_range",
default=True)

add_legend_bar: bpy.props.BoolProperty(name="add_legend_bar",
default=True)

legend_bar_ticks: bpy.props.IntProperty(name="legend_bar_ticks",
default=8,
min=2,
soft_max=64)

range_min: bpy.props.FloatProperty(name="range_min",
default=0.0,
soft_min=0.0,
Expand All @@ -117,9 +137,13 @@ def update_name(self, context):
soft_min=0.0,
soft_max=1.0)

color_map_file_path: bpy.props.StringProperty(name="color_map_file_path",
default="",
subtype='FILE_PATH')
add_legend_bar: bpy.props.BoolProperty(name="add_legend_bar",
default=True)

legend_bar_ticks: bpy.props.IntProperty(name="legend_bar_ticks",
default=8,
min=2,
soft_max=64)

render_isolines: bpy.props.BoolProperty(name="render_isolines",
default=False)
Expand All @@ -128,6 +152,156 @@ def update_name(self, context):
default=1.0,
min=0.5,
soft_max=5.0)
# Render Stamp
render_stamp: bpy.props.StringProperty(name="render_stamp", # TODO rename to `format_string` (?)
description="Render stamp text",
default="appleseed {lib-version} | Time: {render-time}")

render_stamp_patterns: bpy.props.EnumProperty(name="render_stamp_patterns",
description="Variables to insert into the render stamp",
items=[
('{lib-name}',
"Library Name", ""),
('{lib-version}',
"Library Version", ""),
('{lib-variant}', # NOTE this could probably be deleted as it was updated to
"Library Variant", ""), # `{lib-cpu-features}` (see projectfileupdater.cpp#L1962).
('{lib-cpu-features}',
"Library CPU Features", ""),
('{lib-config}',
"Library Configuration", ""),
('{lib-build-date}',
"Library Build Date", ""),
('{lib-build-time}',
"Library Build Time", ""),
('{render-time}',
"Render Time", ""),
('{peak-memory}',
"Peak Memory", "")],
default="{render-time}",
update=update_stamp)

scale_factor: bpy.props.FloatProperty(name="scale_factor",
default=1.0,
min=0.1,
max=20.0)

# Tone Map
tone_map_operator: bpy.props.EnumProperty(name="tone_map_operator",
description="Operator that defines the tone mapping curve.",
items=[
('linear',
"Linear", ""),
('aces_narkowicz',
"ACES (Narkowicz)", ""),
('aces_unreal',
"ACES (Unreal)", ""),
('filmic_hejl',
"Filmic (Hejl)", ""),
('filmic_piecewise',
"Filmic (Piecewise)", ""),
('filmic_uncharted',
"Filmic (Uncharted)", ""),
('reinhard',
"Reinhard", ""),
('reinhard_extended',
"Reinhard (Extended)", "")],
default='linear')

clamp_colors: bpy.props.BoolProperty(name="clamp_colors",
default=True)

aces_narkowicz_exposure_bias: bpy.props.FloatProperty(name="aces_narkowicz_exposure_bias",
default=0.8,
min=0.0,
max=10.0)

filmic_uncharted_A: bpy.props.FloatProperty(name="filmic_uncharted_A",
default=0.22,
min=0.0,
max=1.0)

filmic_uncharted_B: bpy.props.FloatProperty(name="filmic_uncharted_B",
default=0.30,
min=0.0,
max=1.0)

filmic_uncharted_C: bpy.props.FloatProperty(name="filmic_uncharted_C",
default=0.10,
min=0.0,
max=1.0)

filmic_uncharted_D: bpy.props.FloatProperty(name="filmic_uncharted_D",
default=0.20,
min=0.0,
max=1.0)

filmic_uncharted_E: bpy.props.FloatProperty(name="filmic_uncharted_E",
default=0.01,
min=0.0,
max=1.0)

filmic_uncharted_F: bpy.props.FloatProperty(name="filmic_uncharted_F",
default=0.30,
min=0.0,
max=1.0)

filmic_uncharted_W: bpy.props.FloatProperty(name="filmic_uncharted_W",
default=1.2,
min=0.0,
max=1.0)

filmic_uncharted_exposure_bias: bpy.props.FloatProperty(name="filmic_uncharted_exposure_bias",
default=2.0,
min=0.0,
max=10.0)

filmic_piecewise_toe_strength: bpy.props.FloatProperty(name="filmic_piecewise_toe_strength",
default=0.0,
soft_min=0.0,
soft_max=1.0)

filmic_piecewise_toe_length: bpy.props.FloatProperty(name="filmic_piecewise_toe_length",
default=0.5,
soft_min=0.0,
soft_max=1.0)

filmic_piecewise_shoulder_strength: bpy.props.FloatProperty(name="filmic_piecewise_shoulder_strength",
default=0.0,
soft_min=0.0,
soft_max=1.0)

filmic_piecewise_shoulder_length: bpy.props.FloatProperty(name="filmic_piecewise_shoulder_length",
default=0.5,
min=0.0001,
soft_max=32.0)

filmic_piecewise_shoulder_angle: bpy.props.FloatProperty(name="filmic_piecewise_shoulder_angle",
default=0.0,
soft_min=0.0,
soft_max=1.0)

reinhard_use_luminance: bpy.props.BoolProperty(name="reinhard_use_luminance",
default=True)

reinhard_extended_max_white: bpy.props.FloatProperty(name="reinhard_extended_max_white",
default=1.0,
min=0.0,
soft_max=10000.0)

reinhard_extended_use_luminance: bpy.props.BoolProperty(name="reinhard_extended_use_luminance",
default=True)

# Vignette
intensity: bpy.props.FloatProperty(name="intensity",
default=0.5,
min=0.0,
max=1.0)

anisotropy: bpy.props.FloatProperty(name="anisotropy",
default=0.0,
min=0.0,
max=1.0)


class AppleseedTextureConvertProps(bpy.types.PropertyGroup):
Expand Down
Loading