Page MenuHome

Convert ID Mask node AntiAliasing to SMAA
ClosedPublic

Authored by Aidan Haile (tactical_fluke) on Jul 11 2021, 1:22 PM.

Details

Summary

Intended as a fix for https://developer.blender.org/T49944

This patch takes @Jeroen Bakker (jbakker) 's suggestion to switch the anti-aliasing on an ID mask node to use the pre-existing SMAA operations.

using the blend file attached to the issue, we get the following:

Before:

After:

I have run and confirmed the automated tests still pass.

Diff Detail

Repository
rB Blender

Event Timeline

Aidan Haile (tactical_fluke) requested review of this revision.Jul 11 2021, 1:22 PM
Aidan Haile (tactical_fluke) created this revision.

hey @Jeroen Bakker (jbakker) would you okay to or have the time to review this?

@Manuel Castilla (manzanilla) can you review this patch? Also check if the aa operation can be removed

Look good to me. It does fix issue. Only a few changes to follow our code style guidelines:

  • We prefer to always use C-style comments, starting with a capital letter and ending with a full stop. (/* Comment. */)
source/blender/compositor/nodes/COM_IDMaskNode.cc
48

As these values are used more than once, please define them in "node_composite_util.h" with names CMP_* and replace them in "node_composite_antialiasing.c" too.

@Jeroen Bakker (jbakker) The AA operation can be removed if we do the same on ZCombineNode and DilateErodeNode. It won't affect tests either because they don't reach the code path where it's used.
Don't see a reason why not, only downside is performance, but result is far better. I can create a "Good First Issue" task for doing it. Just need your ok.

Manuel Castilla (manzanilla) requested changes to this revision.Jul 12 2021, 8:45 PM
This revision now requires changes to proceed.Jul 12 2021, 8:45 PM
source/blender/compositor/nodes/COM_IDMaskNode.cc
48

Call the setters on SMAA operations constructors with these default values, so we don't need to set them on all future nodes that may use SMAA.

source/blender/compositor/nodes/COM_IDMaskNode.cc
48

As these values are used more than once, please define them in "node_composite_util.h" ...

Sorry, not in "node_composite_util.h" but in "BKE_node.h".

I believe I have addressed your review actions @Manuel Castilla (manzanilla) , could I get a re-review when you've got the time?

All good on my part :). I'll commit it tomorrow, if there are no objections.

This revision is now accepted and ready to land.Jul 13 2021, 1:17 PM