Render a material to an AOV? Nothing fancy!

Render a material to an AOV? Nothing fancy!

aaronfross
Collaborator Collaborator
5,128 Views
18 Replies
Message 1 of 19

Render a material to an AOV? Nothing fancy!

aaronfross
Collaborator
Collaborator

Hi,

I cannot figure out how to simply output a particular material to its own AOV. I read the documentation, but it's all about how to replace one thing with another thing. I.e. how to create an AOV for object IDs, overriding the object material with a Utility shader. Well that is fine, but it does not help me understand how AOV Write nodes work in general. So I can't apply those general principles to my specific situation. The documentation just leads me down the garden path to a place I don't want to be.

What I need is to simply render out a particular material to its own AOV. I need to do this with emissive materials because they are not showing up in my light group AOVs.

The thing is, I thought I could just create an AOV Write RGBA and connect the output of an Arnold Standard Surface to both the passthrough and the AOV_input of the AOV Write RGBA. So the material will show up in the beauty pass as well as the AOV. But I cannot connect the output of Arnold Standard Surface to the AOV_Input slot. It accepts a map, but not a material? This is very strange.

Please tell me how I can output a particular material to its own AOV.

Thank you,

Aaron

0 Likes
Accepted solutions (1)
5,129 Views
18 Replies
Replies (18)
Message 2 of 19

Stephen.Blair
Community Manager
Community Manager
Accepted solution

Standard Surface returns a closure, not a color, that's why you cannot connect to the AOV Input.

Can you use the Emission AOV? That should have all emissive materials.

If you need just one emissive material, and not the others, then perhaps you could use cryptomatte and a material ID pass to get the specific material.



// Stephen Blair
// Arnold Renderer Support
0 Likes
Message 3 of 19

aaronfross
Collaborator
Collaborator

OK, thanks Stephen! I am very confused by the illustration on the docs page showing an Arnold Standard Surface material connected to the AOV Input of an AOV Write node.

https://docs.arnoldrenderer.com/display/A5AF3DSUG/AOV+Write

2625-image2016-9-14-11-0-23.png

0 Likes
Message 4 of 19

Stephen.Blair
Community Manager
Community Manager

That looks like an old Arnold 4 screenshot, with the old Standard shader. I'll have that updated, thanks



// Stephen Blair
// Arnold Renderer Support
0 Likes
Message 5 of 19

aaronfross
Collaborator
Collaborator

So we used to be able to do this in Arnold 4? Sounds like a feature regression to me. In this case I was barking up the wrong tree to solve my problem; AOV write wasn't the correct approach. But I can easily imagine situations in which it would be useful to output specific materials to their own AOVs.

0 Likes
Message 6 of 19

thebenp
Contributor
Contributor

What was your solution, @Aaron Ross?

0 Likes
Message 7 of 19

aaronfross
Collaborator
Collaborator

@Ben Perkins

There wasn't a solution to the problem of rendering a material out to its own AOV. Apparently it is not possible anymore; that's progress.
My actual production challenge was to render the light coming from an emissive material as its own AOV. And that works fine with the built-in Emission AOV, as Stephen mentioned.

0 Likes
Message 8 of 19

aaronfross
Collaborator
Collaborator

But my emissive material was outside a window. The Emission AOV did not work through a transmissive object, i.e. window glazing. I guess I could have tried a Transmission AOV, but I don't think that would include the incident light from the emissive material onto the scene geometry. In the end, I gave up and just turned off all lights and rendered a beauty pass. So much for trying to do things the clever way.

0 Likes
Message 9 of 19

aaronfross
Collaborator
Collaborator

By the way, the 600-character limit on replies is lame sauce.

0 Likes
Message 10 of 19

Anonymous
Not applicable

SolidAngle, are you listening? Not being able to do this is a huge issue.

0 Likes
Message 11 of 19

Anonymous
Not applicable

However in our case we're just trying to generate a simple holdout matte AOV of a specific material. If no longer possible, then A5 just broke an important part of our pipeline.

0 Likes
Message 12 of 19

aaronfross
Collaborator
Collaborator

Yeah, I still don't know how to output a material to its own AOV.

0 Likes
Message 13 of 19

Stephen.Blair
Community Manager
Community Manager

@Jim Polk You can still plug a Standard Surface into the Beauty port of a Write Color node. The color for the holdout matte goes into the Input, and that is what is written to the AOV



// Stephen Blair
// Arnold Renderer Support
0 Likes
Message 14 of 19

Anonymous
Not applicable

Hmm, I don't see a 'beauty' param on the MtoaWriteColor node...but we're a few versions behind the curve..

arnold-5.1.0.1:-version option
node: MtoaWriteColor
type: shader
output: RGBA
parameters: 5
filename: /muse/prod/arnold-5.0.2.4/mtoa-maya20165-2.1.0.2/shaders/mtoa_shaders.so
version: 5.0.2.3

Type Name Default
------------ -------------------------------- --------------------------------
RGBA passthrough 0, 0, 0, 1
RGB aov_input 0, 0, 0
STRING aov_name
BOOL blend_opacity false
STRING name

0 Likes
Message 15 of 19

Stephen.Blair
Community Manager
Community Manager
@Jim Polk

It's the passthrough
In the current MtoA, I use an aiWriteColor node, which comes out as:

aov_write_rgb
{
 name aiWriteColor1
 passthrough aiStandardSurface1
 aov_input 1 0 0
 aov_name "holdout_matte"
}




// Stephen Blair
// Arnold Renderer Support
0 Likes
Message 16 of 19

Anonymous
Not applicable

Thoughts?

00:00:00 249MB WARNING | unable to connect standard_surface() to MtoaWriteColor(passthrough) - types are not compatible (CLOSURE to RGBA)

0 Likes
Message 17 of 19

Anonymous
Not applicable

Just a reminder, we only use Maya for modeling, we don't use it for rendering.

Thanks,

0 Likes
Message 18 of 19

Stephen.Blair
Community Manager
Community Manager

You need to use aov_write_rgb, not MtoAWriteColor
aov_write_rgb is in Arnold 5.1.0.1
not sure if that older MtoA exposes it, I have to check

aov_write_rgb takes a CLOSURE for the passthrough, that's what is needed to connect Standard Surface



// Stephen Blair
// Arnold Renderer Support
0 Likes
Message 19 of 19

Anonymous
Not applicable

Ahh, ic, my bad...that does indeed work <big sigh of relief>
Thank you very, very much,

0 Likes