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?
Thanks!
How to determine material based on light path
1625 7 0- AnsonSavageBYU
- Member
- 15 posts
- Joined: Dec. 2021
- Offline
- jsmack
- Member
- 7803 posts
- Joined: Sept. 2011
- Offline
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.
- AnsonSavage
- Member
- 129 posts
- Joined: Sept. 2021
- Offline
- jsmack
- Member
- 7803 posts
- Joined: Sept. 2011
- Offline
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.
- jsmack
- Member
- 7803 posts
- Joined: Sept. 2011
- Offline
- eikonoklastes
- Member
- 333 posts
- Joined: April 2018
- Online
- AnsonSavage
- Member
- 129 posts
- Joined: Sept. 2021
- Offline
- AnsonSavage
- Member
- 129 posts
- Joined: Sept. 2021
- Offline
-
- Quick Links