Announcement

Collapse
No announcement yet.

Multimatte object ID edge borders

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multimatte object ID edge borders

    I'm fairly to V-Ray, so forgive me if this is an obvious thing. I'm sure the answer is in the Googleverse, I just couldn't find it.

    I'm trying to mask objects using object IDs with multimatte, but the masks don't line up exactly right--there is an apparently-1-pixel border between them, meaning I have to do some mask dilation to get them to work (and leading to imperfect edges). What am I doing wrong/how can I get clean edges?

    A simple three-object example (the black and gold parts are actually different meshes) attached--the RGB beauty, the multimatte, and then the three mattes layered where you can see the edges (and then a closeup of the edging).

    (These images are just screenshots from Nuke, by the way--the resolution of the image is 720x720.)

    Thanks!



  • #2
    Be sure you are ADDing your mattes, not “merging” or “compositing.”

    That might be the issue.

    Comment


    • #3
      The combined mattes was just to show the border issues--I'm shuffling out the channels to use as masks for grading the individual objects (adding them does eliminate the border, but since I'm using them individually that doesn't help in this case). The difference is obvious when grading the ground plane--when it gets darkened that one-pixel row at the top positively glows, and I can't safely dilate that without eating into the other objects--picture attached.

      Click image for larger version

Name:	line.JPG
Views:	355
Size:	24.5 KB
ID:	1077218
      Last edited by bentway23; 05-07-2020, 05:09 PM.

      Comment


      • #4
        Not sure in this case. Is it only where there is also an edge in the alpha? Perhaps ignoring the alpha in the multi matte file would fix it. Like your comp software is multiplying Or dividing the RGB off the multi matte by the alpha.

        Other issues I have experienced in the past included things like comping software assuming the wrong gamma for an image (like for an EXR that is often linear).

        Comment


        • #5
          Neither of those work--there's still that border. It's a multipass .exr interpreted as linear. I made a copy of that interpreted as sRGB just in case it was a gamma issue--same problem. Also I wasn't using the alpha, just the color channels, as the masks (I've done this by calling on the individual channels of the multimatte pass as well as by shuffling them to the alpha and using just the alpha). I've tried both premulting and unpremulting. There is always that border. Could it be that multimatte passes aren't anti-aliased, and there's a setting I missed somewhere to make them behave in the same way as the beauty?

          Anyone who wants to play or dig is welcome--the original file is at
          www.bentwayproductions.com/noisePlayin.exr
          (It's six-odd MB, too big to attach.)

          Thanks for help and suggestions!

          Comment


          • #6
            Hi bentway23, those borders are caused by anti-aliasing between different objects and represents their contribution for current pixel. That is why you should ADD them not compositing them with other math operations. I've tried it on my side and f I use ADD operation the borders does not exist.
            Georgy Chakarov | QA
            www.chaosgroup.com
            georgy.chakarov@chaosgroup.com

            Comment


            • #7
              But I'm not adding them or using them with any other operations--I'm shuffling out/isolating the channels to isolate elements.

              It seems, then, the issue is that the multimatte passes use a different anti-aliasing method than the beauty/RGB passes, correct? So there's a setting somewhere I need to use to get them to use the same anti-aliasing?

              Comment


              • #8
                Can you post s as simple scene?

                I know I have to spread or choke mattes here and there, but you are describing something where the Amount of spread or choke (erode/ dilate) required is not consistent. It looked like that inconsistency was along an alpha border.

                Just as a test, does putting a plane behind your scene so that you have no black in your alpha fix that disparity?

                Comment


                • #9
                  Adding a plane and getting rid of the background alpha would defeat the purpose of having a transparent background--in the comp'd version I added a 2D background behind the image--so I'm afraid that won't work. I'll try to compile it into a simple scene later tonight--perhaps it's simply a render setting. Or perhaps matte dilation is just an evil we have to live with--which is certainly doable, I just would have thought it would be possible to get exactly-matching edges from the multimatte. (Of course, with a moving scene, dilation artifacts are less easy to simply roto around.)

                  Comment


                  • #10
                    Well, they are never going to match perfectly with things like motion blur or depth of field (soft edges). I generally find the normal anti-alised edges match well enough for most corrections. It's kind of like try to adjust an already comped FG over BG with a matte rather than properly adjusting the FG as an independent element before comping. The edges never work quite right because the BG is not blended in to the edges.

                    Comment


                    • #11
                      That's essentially what I'm doing, and all this is happening with no soft edges (no DoF or anything)--it's simply that the edges of the multimatte ids doesn't match the object edges, and it appears to be that the multimatte doesn't use the same antialiasing as the image (in which case, what kind of workaround is best for that? Is multimatte not the best option for rendering out object ID passes?)

                      My scene (without the geo--file size gets too big) is attached. Hopefully it's a render setting that I'm missing.
                      Attached Files

                      Comment


                      • #12
                        Originally posted by bentway23 View Post
                        it appears to be that the multimatte doesn't use the same antialiasing as the image (in which case, what kind of workaround is best for that? Is multimatte not the best option for rendering out object ID passes?)
                        Multimattes have been used for years in production without particular issue (I personally delivered three movies with them.), so yes, it is the way to render ID passes.

                        The caveat is that you will want a separate pass to generate them with the right amount of AA: they are not (as all other REs, unless otherwise instructed) considered for AA (things would become impossibly slow very quickly), but rather rely on the beauty's sampling.
                        This may create issues along edges of the multimatte, and along other low-contrast/low light zones in the beauty.

                        As such, the best approach is to render a multimatte (and all the data you may need from the scene which doesn't rely on shading or lighting) pass with fixed AA (say, fixed 4 subdivs, or even higher), but no lighting or shading to speak of.
                        General scene toggles (lights off) and overrides (black lightMtl as override, f.e., when and where applicable) ought to help a bit setting the pass up.
                        It'll be super quick and, being parallel to the beauty renders, it's also often the case it can be rendered less often, saving time and storage space.

                        Why specifically you're having issues with edges, though, i don't quite know.

                        With the approach described, in Max, i got this (object IDs)

                        Click image for larger version  Name:	MM_CS.jpg Views:	0 Size:	588.9 KB ID:	1077563

                        and this (mat IDs)
                        Click image for larger version  Name:	MM_matID_CS.jpg Views:	0 Size:	589.7 KB ID:	1077564
                        Lele
                        Trouble Stirrer in RnD @ Chaos
                        ----------------------
                        emanuele.lecchi@chaos.com

                        Disclaimer:
                        The views and opinions expressed here are my own and do not represent those of Chaos Group, unless otherwise stated.

                        Comment

                        Working...
                        X