Compositor: Always use AA on masks
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 6 Sep 2018 08:39:25 +0000 (10:39 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 6 Sep 2018 09:26:19 +0000 (11:26 +0200)
In a real world it is very weird to disable AA on a mask,
it will give ugly looking result. For some fast preview
passes (like in the node preview) the system can decide
to disable AA without asking user to do anything.

One thing we can consider doing is to remove Feather
option as well. If real compo becomes measurably slower
in cases when mask has no real feather, we can disable
feather internally, without user input. Disabling
feather in the interface is like making things faster
but giving a wrong result, which doesn't sound that
helpful either.

Reviewers: brecht

Reviewed By: brecht

Subscribers: hype, sebastian_k

Differential Revision: https://developer.blender.org/D3677

source/blender/compositor/nodes/COM_MaskNode.cpp
source/blender/compositor/operations/COM_MaskOperation.cpp
source/blender/compositor/operations/COM_MaskOperation.h
source/blender/editors/space_node/drawnode.c
source/blender/makesdna/DNA_node_types.h
source/blender/makesrna/intern/rna_nodetree.c

index be05840f601426f8afd20b1d74eaff7c87dfae5f..7e29674f9aa1e5eb6c3a694595ea360d1f602d7d 100644 (file)
@@ -62,7 +62,6 @@ void MaskNode::convertToOperations(NodeConverter &converter, const CompositorCon
 
        operation->setMask(mask);
        operation->setFramenumber(context.getFramenumber());
-       operation->setSmooth((bool)(editorNode->custom1 & CMP_NODEFLAG_MASK_AA) != 0);
        operation->setFeather((bool)(editorNode->custom1 & CMP_NODEFLAG_MASK_NO_FEATHER) == 0);
 
        if ((editorNode->custom1 & CMP_NODEFLAG_MASK_MOTION_BLUR) &&
index caafdfe8f0c36972b4489ae1b598d0b4ca549079..efc9f6edd5b65f95466dc1dc9271f6dc8e13252b 100644 (file)
@@ -54,7 +54,7 @@ void MaskOperation::initExecution()
 
                        BKE_maskrasterize_handle_init(this->m_rasterMaskHandles[0], this->m_mask,
                                this->m_maskWidth, this->m_maskHeight,
-                               true, this->m_do_smooth, this->m_do_feather);
+                               true, true, this->m_do_feather);
                }
                else {
                        /* make a throw away copy of the mask */
@@ -88,7 +88,7 @@ void MaskOperation::initExecution()
 
                                BKE_maskrasterize_handle_init(this->m_rasterMaskHandles[i], mask_temp,
                                                              this->m_maskWidth, this->m_maskHeight,
-                                                             true, this->m_do_smooth, this->m_do_feather);
+                                                             true, true, this->m_do_feather);
 
                                frame_iter += frame_step;
                        }
index a586a91682eac10248ed9f117fe70b3fd2db332f..02c0e61c31ed6d4c34884a0b18ce2c17c1db208f 100644 (file)
@@ -48,7 +48,6 @@ protected:
        float m_frame_shutter;
        int   m_frame_number;
 
-       bool m_do_smooth;
        bool m_do_feather;
 
        struct MaskRasterHandle *m_rasterMaskHandles[CMP_NODE_MASK_MBLUR_SAMPLES_MAX];
@@ -80,7 +79,6 @@ public:
                this->m_mask_px_ofs[1] = this->m_maskHeightInv * 0.5f;
        }
        void setFramenumber(int frame_number) { this->m_frame_number = frame_number; }
-       void setSmooth(bool smooth) { this->m_do_smooth = smooth; }
        void setFeather(bool feather) { this->m_do_feather = feather; }
 
        void setMotionBlurSamples(int samples) { this->m_rasterMaskHandleTot = min(max(1, samples), CMP_NODE_MASK_MBLUR_SAMPLES_MAX); }
index 6e52af2898ebedc638861b6dfd2c2f24f0209186..46172da6b047ff1ddd3055b384c890a177a5094e 100644 (file)
@@ -2411,7 +2411,6 @@ static void node_composit_buts_mask(uiLayout *layout, bContext *C, PointerRNA *p
        bNode *node = ptr->data;
 
        uiTemplateID(layout, C, ptr, "mask", NULL, NULL, NULL, UI_TEMPLATE_ID_FILTER_ALL);
-       uiItemR(layout, ptr, "use_antialiasing", 0, NULL, ICON_NONE);
        uiItemR(layout, ptr, "use_feather", 0, NULL, ICON_NONE);
 
        uiItemR(layout, ptr, "size_source", 0, "", ICON_NONE);
index 5c692cf85da2e9dfff7e3c8526770be5a8f0f4d1..91dc58ed1d43f4d080101834be832c70fae652bb 100644 (file)
@@ -500,7 +500,7 @@ enum {
 };
 
 enum {
-       CMP_NODEFLAG_MASK_AA          = (1 << 0),
+       /* CMP_NODEFLAG_MASK_AA          = (1 << 0), */  /* DEPRECATED */
        CMP_NODEFLAG_MASK_NO_FEATHER  = (1 << 1),
        CMP_NODEFLAG_MASK_MOTION_BLUR = (1 << 2),
 
index 847de75c604b08b31207bcc363c5f9fab2202c1c..68f0272c035f4352ba54982111bb511e77c6537c 100644 (file)
@@ -6327,11 +6327,6 @@ static void def_cmp_mask(StructRNA *srna)
        RNA_def_property_flag(prop, PROP_EDITABLE);
        RNA_def_property_ui_text(prop, "Mask", "");
 
-       prop = RNA_def_property(srna, "use_antialiasing", PROP_BOOLEAN, PROP_NONE);
-       RNA_def_property_boolean_sdna(prop, NULL, "custom1", CMP_NODEFLAG_MASK_AA);
-       RNA_def_property_ui_text(prop, "Anti-Alias", "Apply an anti-aliasing filter to the mask");
-       RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
-
        prop = RNA_def_property(srna, "use_feather", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "custom1", CMP_NODEFLAG_MASK_NO_FEATHER);
        RNA_def_property_ui_text(prop, "Feather", "Use feather information from the mask");