Custom rendervars with opacity? Like in Beauty.

   1190   4   1
User Avatar
Member
654 posts
Joined: 8月 2014
オフライン
Some standard rendervars, like Beauty, are rendered with opacity. How can I configure custom rendervars to render with it too, instead of a black opaque background. For what it's worth, I'm rendering textures.
User Avatar
Member
8218 posts
Joined: 9月 2011
オフライン
export your var as a vector4 and set the fourth component to 1
User Avatar
Member
9492 posts
Joined: 7月 2007
オフライン
make your AOVs from the material Vector4 and just set 4-th component to 1, in MtlX shadeers Karma seems to automatically multiply all components by opacity

however usually there is no need for this as such Alpha would be exactly the same as Beauty alpha, so no need to have a copy for each AOV unless you need custom values in 4th component
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
654 posts
Joined: 8月 2014
オフライン
Guys, thank you for your replies. This works for AOVs that are generated by a material (like BaseColor, Roughness, etc.) via Karma AOV VOP. However, I should probably stress that my main problem is with geometry attributes that I'm baking. Those I'm creating from Primvars using Additional Render Vars LOP, and then construct render products in Render Product LOPs, so they don't pass through VOPs at all.

For instance, many Primvars (like curvature, for instance) are of float Format and setting their Data Type in the Additional Render Vars LOP to float4 or color4f doesn't really do much. The default color outside of UVs remains opaque black. On the other hand, if I set a float4 or a color4f format to a float Primvar, then regardless of its data type it won't render at all. So things seem to look slightly different here from the way Karma processes opacity in VOPs.
User Avatar
Member
654 posts
Joined: 8月 2014
オフライン
I think I found a solution. Converting geometry attributes to vector4 regardless of their initial type (before feeding the geometry into LOPs) and then setting custom rendervars to float4 (format/data type), seems to do the trick.

PS. Thanks for putting me on the right track.
Edited by ajz3d - 2025年2月13日 05:15:24
  • Quick Links