Iray Matte Function

I asked in "The Commons" forum about how to use the matte function and was successful in getting a character and shadow to render on a transparent background. I could only get it to work with a distant light though. Is there a way to capture shadows withg the matte function using spot lights? I can get reflections with a dome or mesh lights but no shadows unless I use a distant light. Any ideas???

Comments

  • kwanniekwannie Posts: 865

    I just discovered that the Iray HDRI toolkit which I purchased a while back has alot off matte function utilities, but sadly still does not work with spotlights. Could somebody in DAZ Land please, please please tell me if Spotlights can be made to work with the Iray matte function................... ! I know this might be an uncommon question, but surely someboy here knows, would appreciate any insight, thanks!

  • ebergerlyebergerly Posts: 3,255

    Did you apply the Advanced Iray Node to both the light source and the object to receive the shadows, and then Enable Iray Matte in Parameters/Display/Iray? 

  • kwanniekwannie Posts: 865

    I just tried it as you said. I applied the "Create Advanced Iray Node Properties" to the spotlight as well as the groundplane and made sure matte was turned on, but still spotlight won't cast any shadows. Have you ever gote the matte function to work with spotlights?

  • kwanniekwannie Posts: 865

     When I render a frame  a  I am getting a very faint representation of the shadow, with a spotlight. If I increase the intensity of the light the character gets washed out but the shadow looks sharp. It doesn't do that with a distant light.

  • ebergerlyebergerly Posts: 3,255

    Not that I recall, but I gave up on ever using the Iray matte long ago since I found it to be pretty much useless and annoying. It's all fakery anyway, since this version of Iray doesn't do real shadow passes in the Photoreal render. 

    But it should work with emissive lights, though. 

  • ebergerlyebergerly Posts: 3,255

    Here's my result using a DAZ primitive plane with an emissive applied to light the scene, and Iray matte on both the emissive plane and the plane catching the shadow. 

    If you want a spotlight then you could just make one yourself from a primitive sphere or something. I pretty much never use the built-in lights, and always make my own. If I want a spotlight I have a couple of objects I put together: one is an emissive sphere to simulate a light bulb, and the other is an empty cylinder to simulate the housing. I just parent the bulb/sphere to the cylinder, and slide the sphere inside the cylinder to narrow the beam.  

    matte.JPG
    871 x 676 - 148K
  • kwanniekwannie Posts: 865

    OKay, I tried that one too ebergerly and I got very nice shadows with just a sphere. So, is the cylinder you use open on the ends? It is not just the primative cylinder from the primatives menu correct? 

  • ebergerlyebergerly Posts: 3,255

    By the way, forgot to mention...

    If you're going to make your own spotlight like I suggested (and this is one reason I swore never to use Iray mattes again...), and you have an emissive sphere inside a cylinder, make sure to apply the Iray matte to the cylinder also. The light coming from the sphere/bulb will bounce off the inside of the cylinder and, in effect, the cylinder is also a light source. If you don't apply the Iray matte to the cylinder, you'll get some goofy shading on the shadow-receiving floor plane.

    Arrgghhh...frustrating to have to make sure you dot all the i's with this Iray matte thing. 

  • kwanniekwannie Posts: 865

    Oh, extra steps is fine with me if I get things to work. Finding ways to make things work in DAZ is the frustrating part to me. The ends of the cylinder need to be open right? I guess I could just use the object editor and remove ends of a primative cylinder.  It does seem to take a bit longer to render with emmisives which makes think I need to stick with direct lighting. I got the spot to work with your suggestion for applying matte to the spot, but I was getting a lot of sparkle artifacts  around the feet not matter how much I tried to turn down or turn off glossiness of the ground plane. Even tried the default shader on the plane to choose matte in surface tab but artifacts still appeared. None of these issues occur with distant lights so maybe the fight is futile............lol.

  • ebergerlyebergerly Posts: 3,255

    Yeah, here's one of my spotlights. I basically run to Blender, grab a cylinder, knock off one end, solidify it and bevel it a bit, bring it back to D|S and I'm all set. Just add a D|S sphere, apply an emissive surface, and parent to the cylinder. Then I save it as a prop and use it constantly.

    The only time I use the built-in lights in D|S is I made a script that places 4 distant lights at 90 degree angles to light the scene in the OpenGL preview. 

    spotlight.JPG
    1084 x 796 - 69K
  • prixatprixat Posts: 1,588
    edited April 2021

    The matte function is working as expected for me (I'm using the beta).

    ...with any combination of lights and environment, even in the viewport.

    (edited to add just tried in current release and it also works correctly)

    Screenshot 2021-04-29 075734before.png
    1959 x 1334 - 1M
    Screenshot 2021-04-29 080025after.png
    1984 x 1336 - 1M
    Post edited by prixat on
  • ebergerlyebergerly Posts: 3,255

    If the Iray matte functionality works for you then great. I would just caution that if you're going to be doing post-processing and rely on accuracy of alpha maps and actually isolating the character and associated shadows, and not wanting unrelated reflections showing up, you may ultimately be disappointed. 

    Here's a link to the Iray docs discussing Iray mattes and their intents and limitations, and here's a portion of the discussion of intended usage (note the use of terms like "roughly" and "illusion"):

    "To guide the interaction of backplate and rendered objects though, additional matte objects have to be provided that should (roughly) match the photographed real world objects using the same camera settings. In addition, these objects should be assigned (roughly) matching materials to further perfect the illusion of the rendered objects being part of the environment and especially interacting closely with the backplate."

    https://raytracing-docs.nvidia.com/iray/manual/index.html#iray_photoreal_render_mode#introduction

Sign In or Register to comment.