Blender has a kind of cool feature where the type of light path can be used as a boolean in a shader network to mix between different kinds of shaders. For example, in this image:
a light path node is used to make it so any rays directly from the camera make the material have a green color, while any other rays see the object as red.
I noticed that Houdini has some kind of light path expression [www.sidefx.com]. Could I use light path expressions to get a similar result in Karma? If so, how?
AnsonSavageBYU a light path node is used to make it so any rays directly from the camera make the material have a green color, while any other rays see the object as red.
I noticed that Houdini has some kind of light path expression . Could I use light path expressions to get a similar result in Karma? If so, how?
I don't think you can use LPE in shaders, they are only applied to AOVs. Karma CPU supports Mantra shaders; if you make a shader using VEX material builder the renderstate/raylevel information allows for ray path switching.
Okay, I can confirm that using a raybounce node does work with a Mantra Vex material imported into Karma. I can also confirm it doesn't work with Karma XPU. I wasn't sure how to use a renderstate node, but that does sound interesting.
AnsonSavage I can also confirm it doesn't work with Karma XPU. I wasn't sure how to use a renderstate node, but that does sound interesting.
XPU doesn't support Mantra VEX materials, so that makes sense.
For materialX materials that work with XPU, the Karma rayimport node can import the raylevel. I'm not sure if it works with XPU or not as not all the variables are importable in both engines.