Announcement

Collapse
No announcement yet.

What exactly does the "Secondary matte environment" do?

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

  • What exactly does the "Secondary matte environment" do?

    The documentation is kind of lacking, or rather, I don't understand it. Can someone explain, preferably with an example when I would use that environment override and for what purpose?
    Software:
    Windows 7 Ultimate x64 SP1
    3ds Max 2016 SP4
    V-Ray Adv 3.60.04


    Hardware:
    Intel Core i7-4930K @ 3.40 GHz
    NVIDIA GeForce GTX 780 (4096MB RAM)
    64GB RAM


    DxDiag

  • #2
    V-Ray's matte objects work in a way that they sort of "camera-project" visible environment that is under them on top of them. So that if you have backplate, then backplate gets projected on top of the ground plane for example.

    The problem here is when you are rendering on black background for compositing, and use matte objects for reflections/GI, etc... If you switch directly visible environment to black, which is required for correct compositing, then V-Ray will camera-project that directly visible black BG on the matte geometry, so your CG objects will reflect black mattes, instead of mattes that have backplate projected.

    So here's where Secondary matte environment comes into play. If you enable it, and put either your screen mapped backplate or spherical map, depending on which of the workflows you do, you will be able to have your directly visible environment black, as it's supposed to be, but at the same time, all secondary rays, like reflection and GI, will see matte objects with the backplate which you've put into secondary matte environment.

    However I do agree this could be done in a bit more intuitive way, or at least named more conveniently. This somehow confusing approach stems from the fact that V-Ray does not have direct visibility (eye rays) environment override. Instead, to override directly visible environment, you have to override everything else

    Comment


    • #3
      Hm I think I still don't quite get it. You say VRay projects the black BG onto matte objects then, but isn't that what the "Matte for refl/refr" checkbox is for in the matte object properties? If I uncheck that checkbox, tha matte object will still be visible normally in reflections and refractions, right? DO you say that you only need this secondary matte environment in case you have camera-projected a texture onto matte objects? Sorry, I seem to still not get it... :P
      Software:
      Windows 7 Ultimate x64 SP1
      3ds Max 2016 SP4
      V-Ray Adv 3.60.04


      Hardware:
      Intel Core i7-4930K @ 3.40 GHz
      NVIDIA GeForce GTX 780 (4096MB RAM)
      64GB RAM


      DxDiag

      Comment


      • #4
        Originally posted by Art48 View Post
        Hm I think I still don't quite get it. You say VRay projects the black BG onto matte objects then, but isn't that what the "Matte for refl/refr" checkbox is for in the matte object properties? If I uncheck that checkbox, tha matte object will still be visible normally in reflections and refractions, right? DO you say that you only need this secondary matte environment in case you have camera-projected a texture onto matte objects? Sorry, I seem to still not get it... :P
        If you don't check, Matte for refl/refr, then the object will be matte only to eye rays, and secondary rays like GI and reflections will see it as regular object, not matte, so for GI and reflections, object will return its regular material, a red VrayMTL for example.
        Click image for larger version

Name:	Fig_1.jpg
Views:	1
Size:	183.5 KB
ID:	864320

        If you do enable Matte for refl/refr, then even GI and reflections will see the matte object as the surface of constant shading with background projected on it.
        Click image for larger version

Name:	Fig_2.jpg
Views:	1
Size:	173.3 KB
ID:	864321

        If your environment background is black, and Matte for refl/refr is enabled, then you will see that the matte objects in reflections will become black too, because matte object takes what is under it and projects it on itself.
        Click image for larger version

Name:	Fig_3.jpg
Views:	1
Size:	113.8 KB
ID:	864322

        What you most likely want to do is to compose your CG object onto the plate in post, but you want the reflections and GI of the plate to be on your CG objects already in render, you can't do that in post. So to achieve that, you enable secondary matte environment override, and put your plate in there, to get this:
        Click image for larger version

Name:	Fig_4.jpg
Views:	1
Size:	119.4 KB
ID:	864323

        You are rendering the same thing as on the second picture, but with black BG for correct compositing

        Comment


        • #5
          Ah I understand now, thank you for your very thorough explanation! Makes sense! So this secondary matte environment is used quite often then I guess?
          Software:
          Windows 7 Ultimate x64 SP1
          3ds Max 2016 SP4
          V-Ray Adv 3.60.04


          Hardware:
          Intel Core i7-4930K @ 3.40 GHz
          NVIDIA GeForce GTX 780 (4096MB RAM)
          64GB RAM


          DxDiag

          Comment


          • #6
            I have no idea. I myself do use it pretty much every time I do CG to plate/footage integration and I need to output for compositing. But I think combination of quite non descriptive name and it being quite a recent feature results to not many people using it or even knowing what it does. I can then only imagine what kind of ugly workarounds they come up with to fix the issues they run into
            Last edited by LudvikKoutny; 24-11-2016, 04:27 AM.

            Comment


            • #7
              I use it all the time, too. Glad that some bugs and workflow issues were fixed for 3.5
              One question for Recon: The shadows and GI caustics on the ground plane, do they get reflected correctly in the teapot?
              https://www.behance.net/Oliver_Kossatz

              Comment


              • #8
                Originally posted by kosso_olli View Post
                I use it all the time, too. Glad that some bugs and workflow issues were fixed for 3.5
                One question for Recon: The shadows and GI caustics on the ground plane, do they get reflected correctly in the teapot?
                Seems like it. GI on mattes does seem to do some weird stuff in 3.4 when combined with dome, as it will make matte objects darker and you need to reduce GI contribution to 0, but that seems to be fixed in 3.5 too, which is awesome.

                Now, if you save colored alpha channel separately, invert it and multiply it on top of you plate, and then add RGB channel, you will get a result that's 1:1 with rendering everything together in VFB.

                Comment


                • #9
                  Thanks a lot for this fantastic example! Helped me much to understand it.

                  -Robert

                  Comment


                  • #10
                    Don't wanna start a thread since it's probably been answred but I can't find it. How do you guys us vraymtlID element in PS...hopefully someone still does. I mean I use that layer to "select by colour" and then go to render layer to copy paste it. But it's not perfect if I then apply a rather strong levels on it (to darken it for instance). I know I can control the fuziness but it doesn't seam right or precies. There must be a pro way of separating layers by material or by object etc.
                    thx
                    www.hrvojedesign.com

                    Comment


                    • #11
                      You might wanna look into "MultiMatteElement". There you can define 3 pixel perfect masks per element by MatID or per ObjectID. There are tools out there to automate generating those elements accordingly for all your scene materials so that you basically have a one-click-solution to generate all your masks. There's Dave's PowerMasker for example, which is what I use.
                      Software:
                      Windows 7 Ultimate x64 SP1
                      3ds Max 2016 SP4
                      V-Ray Adv 3.60.04


                      Hardware:
                      Intel Core i7-4930K @ 3.40 GHz
                      NVIDIA GeForce GTX 780 (4096MB RAM)
                      64GB RAM


                      DxDiag

                      Comment


                      • #12
                        This looks great! Thanks will try it!
                        www.hrvojedesign.com

                        Comment


                        • #13
                          I had time to play with these a bit. Generally it's not a problem getting material IDs etc. but in post production to get a perfect selection. When I use select by colour and use a bit of fuziness I still get jagged edges if I apply stronger levels on it. What's the best way to extract these later in post?
                          www.hrvojedesign.com

                          Comment


                          • #14
                            I'm not sure if I understand you correctly. In any case: The way you use those RGB-Masks, the ones I talked about, is you place your mask on top of your document in PS, so you basically only see that one, nothing else. Then you go into channels and ctrl-click the R G or B channel and there you get your pixel-perfect mask. If you do very drastic changes you might have to expand the masks a tiny bit, but it's all managable in my experience.

                            Edit: In tools other than Photoshop you can use the R G or B channel as mask in your operator. Maybe you have to do a shuffle before, depends on your program/settings I think.
                            Software:
                            Windows 7 Ultimate x64 SP1
                            3ds Max 2016 SP4
                            V-Ray Adv 3.60.04


                            Hardware:
                            Intel Core i7-4930K @ 3.40 GHz
                            NVIDIA GeForce GTX 780 (4096MB RAM)
                            64GB RAM


                            DxDiag

                            Comment


                            • #15
                              Originally posted by Crayox13 View Post
                              I had time to play with these a bit. Generally it's not a problem getting material IDs etc. but in post production to get a perfect selection. When I use select by colour and use a bit of fuziness I still get jagged edges if I apply stronger levels on it. What's the best way to extract these later in post?
                              Do you have filtering turned on in the render element?
                              CGI Artist @ Staud Studios

                              Comment

                              Working...
                              X