Announcement

Collapse
No announcement yet.

self illuminating shader multiplied by shadow catcher in a single render

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

  • self illuminating shader multiplied by shadow catcher in a single render

    Has anyone found a way to successfully create a constant/self illuminating shader(for projecting hdr/plate on set geometry) but having a shadow catcher shader control the self illumination intensity? the logic being that you wont get gi bounce emitted from shadows of live object that fall on the projected set.. for example.

    i have been trying to achieve this using different approaches with no luck.

    we tried using the material wrapper/use background shaders to capture shadows, but it seems that this wrapper resolves last and we cant successfully pass that shadow result as input(mask) of another shader. meaning i cant plug the result(outcolor) of material wrapper into the self illumination input of a vray shader/surface shader like you can with normal maya shaders.
    is there another node that allows to capture shadow information besides the wrapper?

    we also tried to build our own osl shader but that has the limitation of not being able to calculate light/shadow information and pass that as values in the shader to other functions. if anyone has done an osl shader for vray maya that can capture shadow and pipe that into emission() i would love to see the code.

    the typical solution of rendering a shadow catcher then baking it to texture and plugging it into another render as the self illumination mask is not a solution for what we are after.

    any ideas would be most welcome,
    thanks

  • #2
    I would also like to know this.

    Comment


    • #3
      The V-Ray matte/shadow material or the V-Ray object properties are typically used for that; will get you an example.

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

      Comment


      • #4
        I think I have managed to achieve this by connecting my spherical projection map directly into the environment overrides and using Matte Surface via Object Properties.
        Last edited by brobins; 24-10-2015, 06:51 AM.

        Comment


        • #5
          OK, let me know if you still need help with this.

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

          Comment


          • #6
            Well maybe if I explain my setup you can tell me if it makes sense to you as I managed it by a fluke.

            Essentially I am projecting a spherical map projected via a 3d placement node onto set geometry. The set geometry has a vrayobjectproperties assigned and Matte Surface is checked. I found that by linking the same spherical projection into the environment override slots it projects onto the set geometry and allows me to catch shadows and also reflect back into my objects environment projection with shadows, etc (which was always my end goal).

            With the set geometry visible it works (which feels strange to me) but if I hide the set geometry the result of the projection changes significantly.

            What is happening here? How come the matte surface set geometry is being affected by the environment overrides?

            I would like to understand what is going on a little better.

            Thank you

            Comment


            • #7
              If you enable the "shadows" option of the matte object properties, then the matte surface shader takes the environment color and multiplies it by the calculated matte shadows. Which is what you wanted, isn't it? Normally, the environment is the one that you specify as the background texture in the renderer settings. However in most cases you want that black for other purposes, and the matte shader to use the HDR environment only for reflection/refraction/GI rays. So in order to do that, you can override the environment locally for the matte shader only, while keeping the scene environment map black. Does it make sense? Newer versions of V-Ray have a special "secondary matte" environment slot in the renderer settings which can be used instead of adding material override attributes to the matte shader.

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

              Comment


              • #8
                I do understand all that fairly well as I have used Vray for quite some time.

                I think what is confusing me is why the 3d projection is still affecting the setGeo when matte surface is enabled on the object? And why the result of the projection is so different when the setGeo is visible vs not visible.

                I have attached a simple scene to illustrate. By default the setGeo is visible and behaves as I want (but I dont know why it is behaving as its a matte object). If you hide the setGeo and re render the entire projection changes.

                I guess I just dont understand why the setGeo is being effected by the projection from the environment override?

                Many Thanks,

                Ben
                Attached Files

                Comment


                • #9
                  To avoid any confusion and to sum up, it appears that when a standard Maya projection is connected to the Environment Override slots, all Matte Objects in the Scene pick up the projection (and reflect that back into our objects, which is good). If however, at any point a VRayPlaceEnvTex replaces the default place2dTexture that is connected to the projection File node the Matte Objects are ignored and all we see is the Environment Override maps in the background. Is this considered normal behavior?

                  Its funny as its behaving exactly how I want it to but I don't understand how or why. Its also a little tricky to ensure that I never create a VRayPlaceEnvTex as this breaks the connection of the place2dTexture to the File node and stops it behaving how I want.

                  It would also be useful to know if its possible to control which Matte Objects pick up the projection rather than all of them.

                  I hope this makes sense, apologies if my explanation is a little all over the place. I am really keen to fully understand this.

                  Many Thanks,

                  Ben

                  Comment


                  • #10
                    The difference comes from the fact that the Projection node is applied differently to setGeo object and the Environment because of the place3dTexture-node.
                    VRayPlaceEnvTex is automatically assigned to a texture when the same is assigned to any of the Environment slots.

                    I am wondering what is the reason for using such complicate setup, would it be easier to just have a matte-ground plane to capture the shadows and texture plugged into Environment Override slots?
                    There is no need to add any projection nodes etc, everything should work fine by default.

                    Here is a quick example:
                    http://ftp.chaosgroup.com/support/sc...plane_matte.mb
                    Svetlozar Draganov | Senior Manager 3D Support | contact us
                    Chaos & Enscape & Cylindo are now one!

                    Comment


                    • #11
                      Thanks for your reply.

                      The main reason is to ensure that the projection is accurate which it isn't in your setup as seen in the. When reconstructing the set in 3D you want to be able to project the environment back onto it as accurately as possible for obvious reasons. In order to do that the project origin needs to be set to the same place that the camera was at when shooting the hdri, in this case 5 foot off the ground.

                      Here are 2 images. The first shows your setup and the second image shows the same thing using a Spherical Projection instead set to the correct projection origin.

                      Its not exactly a complicated setup, its a very simple projection. I guess part of the frustration comes in that Vray automatically assumes we always want to use an VRayPlaceEnvTex node when in actual fact that's not the case for the reasons outlined above.

                      So now we have cleared that up, my main question above was if it is possible to specify which Matte Objects pick up whatever is plugged into the Environment Overrides rather than all of them?



                      Click image for larger version

Name:	vrayEnvTex.jpg
Views:	1
Size:	149.5 KB
ID:	858890Click image for larger version

Name:	sphericalProjection.jpg
Views:	1
Size:	139.5 KB
ID:	858891


                      Apologies for the lack of detail in these images. I should have chosen a better example as a simple ground plane doesn't really show this off very well.

                      Comment

                      Working...
                      X