diff options
author | Martijn Versteegh <Baardaap> | 2022-01-17 20:00:35 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2022-01-17 21:36:13 +0300 |
commit | 449db0ab1e34976f3936310b846ab38cc2d6467d (patch) | |
tree | a0eb26c834c1a6b89e5461d219c042abde200b5f /intern/cycles | |
parent | 8af22719d0c98e24104d01089ecb0cff840df7e8 (diff) |
Baking: new method to generate margin, based on adjacent faces
This significantly reduces discontinuities on UV seams, by giving a better
match of the texture filtered colors on both sides of the seam. It works by
using pixels from adjacent faces across the UV seam.
This new option is called "Adjacent Faces" and is the default. The old option
is called "Extend", and extends border pixels outwards.
Differential Revision: https://developer.blender.org/D13303
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 36 |
1 files changed, 32 insertions, 4 deletions
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index e4fbc898070..ddef3f63641 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -1803,18 +1803,45 @@ class CYCLES_RENDER_PT_bake_output(CyclesButtonsPanel, Panel): rd = scene.render if rd.use_bake_multires: - layout.prop(rd, "bake_margin") layout.prop(rd, "use_bake_clear", text="Clear Image") - if rd.bake_type == 'DISPLACEMENT': layout.prop(rd, "use_bake_lores_mesh") else: layout.prop(cbk, "target") - if cbk.target == 'IMAGE_TEXTURES': - layout.prop(cbk, "margin") layout.prop(cbk, "use_clear", text="Clear Image") +class CYCLES_RENDER_PT_bake_output_margin(CyclesButtonsPanel, Panel): + bl_label = "Margin" + bl_context = "render" + bl_parent_id = "CYCLES_RENDER_PT_bake_output" + COMPAT_ENGINES = {'CYCLES'} + + @classmethod + def poll(cls, context): + scene = context.scene + cbk = scene.render.bake + return cbk.target == 'IMAGE_TEXTURES' + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + layout.use_property_decorate = False # No animation. + + scene = context.scene + cscene = scene.cycles + cbk = scene.render.bake + rd = scene.render + + if rd.use_bake_multires: + layout.prop(rd, "bake_margin_type", text="Type") + layout.prop(rd, "bake_margin", text="Size") + else: + if cbk.target == 'IMAGE_TEXTURES': + layout.prop(cbk, "margin_type", text="Type") + layout.prop(cbk, "margin", text="Size") + + class CYCLES_RENDER_PT_debug(CyclesDebugButtonsPanel, Panel): bl_label = "Debug" @@ -2183,6 +2210,7 @@ classes = ( CYCLES_RENDER_PT_bake_influence, CYCLES_RENDER_PT_bake_selected_to_active, CYCLES_RENDER_PT_bake_output, + CYCLES_RENDER_PT_bake_output_margin, CYCLES_RENDER_PT_debug, node_panel(CYCLES_MATERIAL_PT_settings), node_panel(CYCLES_MATERIAL_PT_settings_surface), |