Adding AOVs to existing mtlx shaders

   127   2   2
User Avatar
Member
11 posts
Joined: 8月 2013
オフライン
Hi all, I'm trying to work out if it's possible to take geo with existing shaders and then add additional aov shader passes without having to do multiple renders. For workflow reasons we'd really like to just have one exr output with beauty and all AOVs included.

simple example - I'd like to take an prebuilt usd asset and render it with both its original correct shaders (beauty, reflections etc.) and also add a custom uvmap pass.

Things I've already tried:
  • Creating the custom aov shader separately in the material library - works fine if I'm happy to render this separately but I can't find a way to switch between the beauty and aov shaders within the same render
  • Doing everything with primvars - works fine for attrib based AOVs, but some things eg. texture maps only work if I go via a shader.
  • Using an edit material to add the map and a Karma AOV to a shader, then outputting everything either as binds or using the Subnet Outputs node - this seems to add the attribs to the material prim that I'd expect, but still renders black even when the made-from-scratch AOV shader is working on other geo.
  • Trying to do it in python - I'm not sure what I'm missing in terms of USD structure and changes to the mtlx shader prims to make this all work, so this ran aground pretty quickly in the API docs!

Hopefully someone's already had a play with this and has a solution, if not I'd love to know if anyone has any more ideas I can try!
Edited by deselby - 2026年1月12日 10:56:31
User Avatar
スタッフ
4263 posts
Joined: 9月 2007
オンライン
This is not something vanilla MaterialX materials can really do yet; the Karma Material Builder supports this via the Karma AOV VOP (https://www.sidefx.com/docs/houdini/nodes/vop/kma_aov-2.0.html), which you connect to the builder's output node; Material Library then sets up the Render Var, and the downstream Karma Render Settings should pick that up, and it should show up in the render.

Editing materials to add AOVs isn't super practical right now; hopefully materials-based AOVs will become more standardized/prevalent/supported in MaterialX/UsdMaterialX.

Hope this helps!
I'm o.d.d.
User Avatar
Member
11 posts
Joined: 8月 2013
オフライン
Thanks for the reply!

Sadly we're usually bringing in the mtlx shaders from outside so rebuilding them from scratch in the Karma builder isn't really an option. It looks like for now I'll have to just suck it up and render the original shader and the custom Karma AOV shaders as separate images, and then glue them together into one exr afterwards in COPs.

It's good to get confirmation that I shouldn't spend too much more time down this particular rabbithole, and at least with Houdini there's always a solution, even if it's a bit ugly!
  • Quick Links