Announcement

Collapse
No announcement yet.

Catching shadow for 3D background with projected plate image, possible?

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

  • Catching shadow for 3D background with projected plate image, possible?

    Hi,
    This has been a long-time issue that I constantly check if there is a simpler way to achieve.

    The issue is I would like to use geometry with projected plate image as 3D background for specific purposes. To not alter the pixel value of plate image, I use VRayLightMtl for background geometries, which can?t be used as shadow-catcher.

    And If I place a shadow-catching geometry as matte object anywhere in the scene, it returns black for camera/primary rays, which is expected (no Background Override Environment or Maya image plane) but not desired.

    Here is a use case, car sitting in a semi-dome geo with panoramic image projected onto the semi-dome to serve as background. Again, the exact pixel values of the projected panoramic image should be returned for camera rays. We need a way to catch the car?s shadow in a single render in this scenario and still be able to change lighting for the car with correct shadows.
    Is it Possible?

    cheers,
    Jason
    always curious...

  • #2
    I did a quick test in Arnold. This can be easily achieved by assigning aiShadowMatte to a ground geometry that will catch the shadow. In the aiShadowMatte, specify using "background color" and link a projected plate image. In a single render, I got a ground that has projected plate (and not affected by scene lighting) and the shadows.
    Click image for larger version

Name:	Arnold shadow matte.jpg
Views:	1286
Size:	131.8 KB
ID:	985780
    I've tried mimicking the approach in Vray by assigning VrayMtlWrapper to the ground. But as I use a VrayLightMtl with projected plate as the Base Material, it cannot catch shadow. And as I turn on Matte Surface (Alpha Contribution -1, Shadows On, Affect Alpah On), the shadow is in alpha channel but not in RGB. Also, the whole ground is black, which is the environment color.
    Click image for larger version

Name:	Vray shadow catch 01.jpg
Views:	904
Size:	32.2 KB
ID:	985781Click image for larger version

Name:	Vray shadow catch 02.jpg
Views:	939
Size:	38.6 KB
ID:	985782
    always curious...

    Comment


    • #3
      Mattes in V-Ray always return the background color. I'll check with the devs if we can add an option to choose another texture to be returned for camera rays and this may solve to an extent this problem in future versions.
      As for the lightMtl - it can be a matte if its "direct illumination" is disabled, but if it's a matte, it won't be a lightMtl, i.e. it will not illuminate.
      Alex Yolov
      Product Manager
      V-Ray for Maya, Chaos Player
      www.chaos.com

      Comment


      • #4
        Originally posted by yolov View Post
        Mattes in V-Ray always return the background color. I'll check with the devs if we can add an option to choose another texture to be returned for camera rays and this may solve to an extent this problem in future versions.
        As for the lightMtl - it can be a matte if its "direct illumination" is disabled, but if it's a matte, it won't be a lightMtl, i.e. it will not illuminate.
        Hi Yolov,

        The reason I use VrayLithtMtl is trying to return original pixel value of assigned texture (as if using Maya's surface shader), so direct illumination has been disabled.
        option 1: assign VrayLightMtl to the ground (direct illum disabled), make the ground a shadowCatcher through VrayObjectProperties.
        result: the same issue as mentioned. shadows in alpha channel. But camera rays return black.

        option 2: assign VrayMtlWrapper to ground and plug the VrayLightMtl in as the Base Material. Make the ground as a shadowCatcher by matte properties in the VrayMtlWrapper.
        result: the same result as option 1.

        In Arnold, it's done in shader level AFAIK: Click image for larger version  Name:	aiShadowMatte.jpg Views:	1 Size:	25.3 KB ID:	985944

        When Background is set to background_color, user can plug a texture network to the slot (texture projection allowed). And when Background is set to scene_background, it's for camera rays to return whatever environment color of Maya or renderer's environment override.

        What's nice is it returns texture color in RGB but in alpha, it cuts a hole and provide correct shadows in the alpha channel.
        Click image for larger version  Name:	beauty.jpg Views:	1 Size:	98.4 KB ID:	985945beautyClick image for larger version  Name:	alpha.jpg Views:	1 Size:	58.9 KB ID:	985946shadow in alpha


        I understand it's common to render the shadow in a different pass, but this provides a lighter to light a scene while observing everything in context. Very important in my humble opinion.

        Please consider.

        Thanks,
        Jason
        Last edited by jasonhuang1115; 02-06-2018, 10:29 AM.
        always curious...

        Comment


        • #5
          I understand. This is not possible at the moment, but I've made a note for the devs to consider adding the option to choose from the scene environment and a custom one to be returned for camera rays from matte objects.
          For now mattes always return the scene background environment, so that's why you're getting black in the RGB with both a regular or lightMtl as the base for the matte.
          Just a note - whether you use a mtlWrapper or VRayObjectProperties is absolutely the same for VRay when it comes to matte objects. The difference is only in the preference in using one over the other (material vs. set).
          Alex Yolov
          Product Manager
          V-Ray for Maya, Chaos Player
          www.chaos.com

          Comment


          • #6
            Hey Alex, just want to follow up on this. Would we see this in V-Ray Next for Maya at some point?
            always curious...

            Comment


            • #7
              You can attach V-Ray material override attributes to the material (or shading group, can’t remember which) and specify a custom environment to be used for the matte shader, even in V-Ray 3.

              Best regards,
              Vlado
              I only act like I know everything, Rogers.

              Comment


              • #8
                vlado I just did a quick test. The V-Ray material override attributes have to be added to the shading group to have to expected effect. I plug a spherical projection of an latlong map to be the Environment Override and it works.
                Awesome! Thank so much. Learned a new trick.
                The spherical projection doesn't line up with what's in the dome light but that's understandable.

                Why doesn't it work if the material override is added to the material itself?
                Last edited by jasonhuang1115; 02-06-2018, 11:23 PM.
                always curious...

                Comment


                • #9
                  Originally posted by jasonhuang1115 View Post
                  vladoWhy doesn't it work if the material override is added to the material itself?
                  Probably because we haven’t implemented it Will make a note to look into it.

                  Best regards,
                  Vlado

                  I only act like I know everything, Rogers.

                  Comment


                  • #10
                    Originally posted by vlado View Post
                    Probably because we haven’t implemented it Will make a note to look into it.

                    Best regards,
                    Vlado
                    Cool! Thank you Vlado.
                    always curious...

                    Comment


                    • #11
                      Originally posted by jasonhuang1115 View Post
                      vlado I just did a quick test. The V-Ray material override attributes have to be added to the shading group to have to expected effect. I plug a spherical projection of an latlong map to be the Environment Override and it works.
                      Awesome! Thank so much. Learned a new trick.
                      The spherical projection doesn't line up with what's in the dome light but that's understandable.

                      Why doesn't it work if the material override is added to the material itself?
                      Jason can you expand on this in simple terms please, I don't fully follow. I too am trying to get shadow catcher and projection maps to work together. Whats this trick you speak of?

                      Comment


                      • #12
                        Originally posted by otterman1 View Post

                        Jason can you expand on this in simple terms please, I don't fully follow. I too am trying to get shadow catcher and projection maps to work together. Whats this trick you speak of?
                        It's been a while and not sure where it stands in the latest VRay but the trick I was referring is actually what Vlado said. You add the material override attributes to the shading group node, instead of the material itself, to get the expected result.
                        always curious...

                        Comment


                        • #13
                          Four years later... same question
                          We use a VRayLightMtl for background geometries with the plates projected onto them. As we place any shadow-catching geometry as matte object anywhere in the scene, those returns black for camera/primary rays.
                          We need a way to catch the shadow in a single render - is this possible?

                          Comment

                          Working...
                          X