Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

USD - per face shader assignments (GeomSubset)

76 views
Skip to first unread message

Nico Rehberg

unread,
Dec 12, 2024, 11:38:14 AM12/12/24
to gaffer-dev
Hi,

are per face shader assignments in USDs supported? We have gotten some weird assets from a vendor with a lot of them and rebuilding them is not an option.
But I can't get them to work through a sceneReader.
Using an ExternalProcedural in usd mode works though. So Arnold itself does support them.

The assingments are stored as GeomSubset in the USD. I'll attach a simple sphere with 2 Shaders applied.

Thanks,
Nico
perFaceUSD.gfr
perFaceShader.usda

aurora

unread,
Dec 13, 2024, 12:17:15 PM12/13/24
to gaffer-dev
As far as I know is not possible yet.
Here is a hack, modifying the stage internally and assigning a prim-var to the faces based on the material binding. You can use this to split the geo by material.
It also collect the materials and stores them in a separate location you can query later.
This ca be greatly improved and probably is not very scalable, but hope it gives you ideas.
For large scenes is probably es to use Sets instead of paths filters.

A
perFaceUSD_hack.gfr

Nico Rehberg

unread,
Dec 16, 2024, 4:05:09 AM12/16/24
to gaffer-dev
Hi Aurora,

wow. That's an amazing example. Thanks a lot. While I understand the principle I would never have managed to build that.
I tried it with one of the bigger assets and it's surprisingly fast considering that you loop through the faces in python.
The only downside I see is that smoothing across the split geometry's borders now won't work, but as far as I can see that may not be an issue.

Thanks again,
Nico

aurora

unread,
Dec 17, 2024, 2:02:14 AM12/17/24
to gaffer-dev
Yeah, subdiv may be affected.
Maybe using a MeshTesselate node before splitting the faces and disable render subdiv may work.
A
Reply all
Reply to author
Forward
0 new messages