Karma array attributes?

   903   7   1
User Avatar
Member
33 posts
Joined: Aug. 2018
Offline
Gang:

I’m trying to port some VEX shaders over to Karma CPU without luck - the problem seems to be that array attributes don’t work. In the following contrived example, a vector array assigned to primitives is read in and used to assign a surface color. If you go to the old Render View and fire it up, it works fine. If you switch to the Solaris viewport with Karma CPU (XPU is out of the question, obviously), it doesn't. Is there any expectation that array attributes should work in Karma CPU? I couldn’t find anything either way in the docs.

Thanks in advance,
Tim

Attachments:
Screen Shot 2024-02-19 at 8.02.53 PM.png (1.6 MB)
solaris-vex-arrays.hiplc (607.4 KB)

User Avatar
Member
8043 posts
Joined: Sept. 2011
Offline
I don't think USD has array attributes, so it's not possible to encode them for the renderer.
User Avatar
Member
646 posts
Joined: July 2013
Offline
If you click/select the mesh_0 Prim on the Stage to inspect it, then in the Solaris Geometry Spreadsheet pane (where the name:value pairs are listed), you can scroll down and see what PrimVars where automatically created from the SOP Import.

In that list, you'll see your 'colors' defined as:

primvars:colors
primvars:colors:indices
primvars:colors:lengths

So, the data you defined in SOPs is converted into USD data - now your materials needs to be setup to consume that USD data in a way that works with USD.

There's a specific node that reads PrimVar data in Shading - I think it's literally called "USD Prim Var Reader"?
Houdini Indie
Karma/Redshift 3D
User Avatar
Member
8043 posts
Joined: Sept. 2011
Offline
TwinSnakes007
In that list, you'll see your 'colors' defined as:

primvars:colors
primvars:colors:indices
primvars:colors:lengths

Oh, wow I wonder when they added that. It used to ignore array attributes. It's up to karma to marshal that data into bound array shader parameters though. Presently, it probably only works for round tripping bgeo-usd.

Mtlx has no way to bind array attributes and neither does a usd preview surface, so only a VEX mantra material could make use of them anyway. So it's probably unlikely we'll see array attributes in Karma without significant demand.
User Avatar
Member
33 posts
Joined: Aug. 2018
Offline
TwinSnakes007
There's a specific node that reads PrimVar data in Shading - I think it's literally called "USD Prim Var Reader"?

Yeah, I did see that the array was encoded in USD, which gave me hope. It looks like “USD Prim Var Reader” is only available when working in a USD Preview Material Builder context; further, it doesn’t support any array types. But thanks for pointing it out!

Cheers,
Tim
User Avatar
Member
33 posts
Joined: Aug. 2018
Offline
jsmack
Mtlx has no way to bind array attributes and neither does a usd preview surface, so only a VEX mantra material could make use of them anyway. So it's probably unlikely we'll see array attributes in Karma without significant demand.

I’m sympathetic when it comes to the limitations of Karma XPU, but it’ll be a big disappointment if Karma CPU + VEX ends up missing big chunks of Mantra functionality … I’m already upset at losing shade().

Cheers,
Tim
Edited by tshead2 - Feb. 20, 2024 15:21:27
User Avatar
Member
646 posts
Joined: July 2013
Offline
MaterialX has an 'array append' VOP, with a blue connector (for several supported Array data types) - but I don't see anything else that can consume it in there.

'USD Prim Var Reader' VOP is available in KarmaMaterial and its equivalent 'User Data' is available in MaterialXMaterial.
Houdini Indie
Karma/Redshift 3D
User Avatar
Member
8043 posts
Joined: Sept. 2011
Offline
tshead2
I’m sympathetic when it comes to the limitations of Karma XPU, but it’ll be a big disappointment if Karma CPU + VEX ends up missing big chunks of Mantra functionality … I’m already upset at losing shade().

yes, it's unfortunate. Mantra remains my primary renderer for now, and I don't see another replacing it any time soon due to its unique flexibility.
  • Quick Links