Community
Maya Shading, Lighting and Rendering
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya materials topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Rendering ID Pass through glass with Arnold?

17 REPLIES 17
Reply
Message 1 of 18
Anonymous
7406 Views, 17 Replies

Rendering ID Pass through glass with Arnold?

Hi guys. I am currently using Arnold renderer in Maya 2018 and I'm trying to render a transparent glass lens with a regular aisurfaceshader. The transmission weight on the glass lens is currently set to 1.00 so that it is completely transparent save for reflections and specular bouncing off of it. Behind the lens I have several pieces of geometry that will be animated. The final render (beauty pass, specular pass, etc) all look great and I'm achieving exactly the look I want. However in order to create more control in post I'd like to be able to create ID passes on each individual object. When I give the animated objects behind the lens ID's they do not show up in my ID pass. Does anybody know how to make it so the ID pass (or any pass other then the transmission pass) will render behind the transparent lens? Unfortunately, the lens also has an IOR distortion so that it distorts the render of the geometry through the glass, therefore simply hiding the glass lens is not a viable option. 

17 REPLIES 17
Message 2 of 18
mspeer
in reply to: Anonymous

Hi!

 

A pixel can have the ID of only one object, so what you want is usually not possible (it's the same for Z-Depth). There where some changes for AOV's in Arnold 5.0.2 (plug-in 2.1.0), but i don't think that affects the ID Pass (i will test this soon). So you have to find an other solution.

Message 3 of 18
ashley.handscomb.retallack
in reply to: Anonymous

In MtoA 2.1.0 and above there is now the "Transmit AOVS" option on the standard_surface shader. ( updates available at https://www.solidangle.com/arnold/download/ )

 

transmit_aovs.png

This should allow you to have custom IDs be visible through transmission rays. 

 

--

Ash

 

 

 

 



Ashley Handscomb Retallack
Senior Software Engineer (Arnold)
Arnold Documentation | Arnold Downloads
Message 4 of 18

Hi!

 

@ashley.handscomb.retallack and @Anonymous

I tested the new "Transmit AOV" feature and it's really cool, but as supposed it does not work with ID-Pass and Z(depth)-Pass.

Message 5 of 18

@mspeer Unfortunately no it will not apply to the built-in ID pass or zdepth.

 

However, for a custom ID pass where a custom RGB AOV is added to the shaders in the scene, it should work.

 



Ashley Handscomb Retallack
Senior Software Engineer (Arnold)
Arnold Documentation | Arnold Downloads
Message 6 of 18

Hi!

 

The problem with a color pass /mask is that when the glass is rendered with a rgb color value there is no room for an other rgb value.

If the glass is pink, what color should an object get that's half outside and half inside of the glass?

That's the same problem for simple Z-depth, you can't create 2 different z-depth values with one pixel.

 

The only solution is to exclude the glass / write to separate channels.

 

Message 7 of 18

True you would need to write to separate channels, traditionally you would create multiple custom ID aovs and write to the Red Green and Blue channels for each. 

 

e.g. given the beauty below

beauty.jpg

 

I make two id AOVs, ID1 has the spheres using Red, Green and Blue

 

custom_id.jpg

 

ID2 has just the ground plane in the red channel 

 

custom_id2.jpg

 

The builtin ID and z-depth aovs do not take shading into consideration, as does cryptomatte currently. 

 

You can use the aiRaySwitch node to have ids for just the materials that are being transmitted as well.

 

ID1_transmittedOnly.jpg

 

 

 

rayswitch_id.png

 

---

 

Ash

 

 

 

 

 

 



Ashley Handscomb Retallack
Senior Software Engineer (Arnold)
Arnold Documentation | Arnold Downloads
Message 8 of 18
madsd
in reply to: Anonymous

Hello,

I fell over this question by mistake.

 

It is indeed possible to knock out a construct you can use to make Post DOF in photoshop with glass in the scene, using a single AOV pass for the Z effect that will include the mentioned "transmit AOV" on the glass element.

 

So there is no need to make exclusions or do passes infront of glass and behind, you can do a single Z depth that account for everything in one go.

 

Message 9 of 18
mspeer
in reply to: madsd

Hi!

 

You will not get the Z-Depth of objects behind the glass.

Message 10 of 18
madsd
in reply to: mspeer

Look closer to the refracting sphere in my gif.

I can make another example which exposes it is possible much clearer if needed be.

 

The shot with 2 images side by side is the beauty pass on the left and the Z pass on the right, the Z pass includes the depth through the refracting glass sphere just fine.

 

Do note, I mentioned this is a construct/AOV, not the core Z pass. however it produces what is needed, in a single pass.

Message 11 of 18
mspeer
in reply to: madsd

Hi!

"construct/AOV"

You mean a custom pass?

 

This thread is mainly about Rendering the ID AOV through an object, which is currently not possible with the default AOV (the same applies to the Z AOV). You need custom AOVs or Layers.

Message 12 of 18
madsd
in reply to: mspeer

Yep, I know, I just read something about Z depth, maybe I missunderstood the discussion.

 

I just prove you can render Z depth through glass in a single AOV which works perfect on a full shot, picking focus point in front of glass, on glass and behind glass based on a single AOV depth buffer, without the needs to worry about splitting things up into multiple layers.

 

Which is basicly the opposit of what you say in the reply to my gif 🙂 Because it is possible.

 

Message 13 of 18
madsd
in reply to: madsd

Knocked out a better example.
Picking focus point infront of glass, and behind it is no problem. Obviously the beauty and Z both have the glass in the big frame enabled, it's not hid at any point.

You can see the 2 lamps and the fruit basket reflects in the window, revealing that there is actually a glass.
All very simple to rig in a single Z AOV.

Message 14 of 18
mailA3RBB
in reply to: madsd

would you please be so kind to explain how you achieved this z-depth aov? is that glas actually refracting or just transparent and reflecting. Any more information on this is very much appreciated.

Message 15 of 18
madsd
in reply to: mailA3RBB

It is completly refracting, so if the glass had noise on it everything beyond it would naturallly distort, this distortion would be included in the custom Z file.

 

As this has been mentioned several places "cant be done" I think it is time to make a complete tutorial about how to achive a Z that works on everything, including refracting, ray bending glass.

It will also work on volumetric clouds and so on.

Message 16 of 18
nicolasDE
in reply to: madsd

And is there an Tutorial on that topic yet? I would really know how to do it! 🙂

Message 17 of 18
Anonymous
in reply to: madsd

Hi man

 

Did you used here Light Path Expression AOVs, or ...

Can you give us some hint how to do this?

 

Thanks

Aleksandar


Message 18 of 18
michaelTDY3J
in reply to: madsd

Hello,

did you have the opportunity to create a tutorial for explein the process of the creation for your custom Zdepth aov through refraction? Thanks Michael

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report