Search - User list
Full Version: Karma (XPU) camera projection
Root » Solaris and Karma » Karma (XPU) camera projection
ronald_a
Is there a way in Karma to do cameraprojection in shader (or for that matter any kind of projection)?
jsmack
Yes, use a USDCoordsys to create a reference coordinate system, then in the shader use that coordsys' name in a space parameter on one of the mtlx transform nodes or on the mtlx position directly.
ronald_a
Thanks for the pointer. I also found an example in the docs but boy do I not understand how that works and why it needs to be setup in that way. For example why does it only work if the material is parented under the "World" primitive?
jsmack
ronald_a
For example why does it only work if the material is parented under the "World" primitive?

yeah, it's kind of annoying that the hierarchy is restricted this way due to some USD reasons. The material, camera, and target need to be able to find the coordsys, and they can't find it if they don't share a common ancestor. USD is 'rootless' so without creating a true root, for example the 'world' primitive, the prims won't share a common ancestor.
tamte
jsmack
USD is 'rootless'
I believe it's spelled ruthless, at least from my experience
robp_sidefx
jsmack
The material, camera, and target need to be able to find the coordsys, and they can't find it if they don't share a common ancestor

The camera doesn't need to live in the same hierarchy. As for the rest of that, we're looking into a possible implementation issue in Karma. For *now*, yes, the coordsys binding should be applied on a parent prim common to the geometry & material.
digitalwu
jsmack
Yes, use a USDCoordsys to create a reference coordinate system, then in the shader use that coordsys' name in a space parameter on one of the mtlx transform nodes or on the mtlx position directly.

May I ask how to assemble this USDCoordsys in materialx shader builder?
I need to project a displacement map on geo.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB