{"id":2839,"date":"2023-03-11T19:41:57","date_gmt":"2023-03-11T19:41:57","guid":{"rendered":"http:\/\/julius-ihle.de\/?p=2839"},"modified":"2023-03-11T19:48:56","modified_gmt":"2023-03-11T19:48:56","slug":"light-linking-light-filters-in-arnold","status":"publish","type":"post","link":"https:\/\/julius-ihle.de\/?p=2839","title":{"rendered":"Light-Linking Light Filters in Arnold"},"content":{"rendered":"<p><a href=\"https:\/\/julius-ihle.de\/?p=2839\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-2841 size-large\" src=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2023\/03\/multfilter_arnold-1024x426.jpg\" alt=\"multfilter_arnold\" width=\"1000\" height=\"416\" srcset=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2023\/03\/multfilter_arnold-1024x426.jpg 1024w, https:\/\/julius-ihle.de\/wp-content\/uploads\/2023\/03\/multfilter_arnold-300x125.jpg 300w, https:\/\/julius-ihle.de\/wp-content\/uploads\/2023\/03\/multfilter_arnold.jpg 1280w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n<p>A very artist-friendly and powerful feature of RenderMan is the ability to light-link light filters to specific objects. In certain scenarios this can become quite useful to make detailed tweaks. In Arnold this is unfortunately not possible to my knowledge, but luckily there are ways to do something similar&#8230;<\/p>\n<p><!--more--><\/p>\n<p>&#8230;through the use of userdata (primvars)! Specifically what I wanted to replicate was <a title=\"MultFilter\" href=\"https:\/\/rmanwiki.pixar.com\/display\/REN23\/PxrIntMultLightFilter\">RenderMan&#8217;s MultFilter<\/a>. The idea is pretty simple, but combined with the ability to light-link it to specific objects it can be extremely useful for adjusting small details of a given scene.<\/p>\n<p>It also was a great starting point to get my hands dirty with C++. I&#8217;m still mostly lost for anything that is more complex than multiplying a few values together, but also happy that I got something out that at least seems to work reasonably well :)<\/p>\n<p>The controls are relatively straight forward. To make use of the userdata inputs, make sure you tag your objects with an Arnold-compliant float userdata and a value between 0 and 1 to drive the amount.<\/p>\n<div style=\"width: 1284px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-2839-1\" width=\"1284\" height=\"436\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2023\/03\/multfilter_demo_short.mp4?_=1\" \/><a href=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2023\/03\/multfilter_demo_short.mp4\">https:\/\/julius-ihle.de\/wp-content\/uploads\/2023\/03\/multfilter_demo_short.mp4<\/a><\/video><\/div>\n<p>&nbsp;<\/p>\n<p>For Katana specifically I&#8217;m also providing a setup that is meant to serve as an example of using it with the built-in light-linking features. The way I&#8217;ve been approach it is the following:<br \/>\n1) Resolve the light linking information (which lights are linked to which geo)<br \/>\n2) Tag light-linked filters with the hierarchy location of the lightfilter as the userdata name and set the default depending on the <code>initialState<\/code>:<br \/>\n<a href=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2023\/03\/lf1.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-2842 aligncenter\" src=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2023\/03\/lf1.png\" alt=\"lf1\" width=\"529\" height=\"284\" srcset=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2023\/03\/lf1.png 529w, https:\/\/julius-ihle.de\/wp-content\/uploads\/2023\/03\/lf1-300x161.png 300w\" sizes=\"auto, (max-width: 529px) 100vw, 529px\" \/><\/a><\/p>\n<p>3) Tag linked objects with the userdata name of the lightfilter location<\/p>\n<p><a href=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2023\/03\/lf2.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-2843 aligncenter\" src=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2023\/03\/lf2.png\" alt=\"lf2\" width=\"575\" height=\"235\" srcset=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2023\/03\/lf2.png 575w, https:\/\/julius-ihle.de\/wp-content\/uploads\/2023\/03\/lf2-300x123.png 300w\" sizes=\"auto, (max-width: 575px) 100vw, 575px\" \/><\/a><\/p>\n<p>This is a more artist-friendly and direct way of setting up using known workflows. It&#8217;s probably recreatable to a degree in other DCC&#8217;s as well. A Katana example file that includes this setup can be found <a title=\"multfilter katana demo scene\" href=\"https:\/\/github.com\/julsVFX\/katana\/blob\/main\/multfilter_demo.katana\" target=\"_blank\">HERE<\/a><br \/>\n&nbsp;<\/p>\n<p>Also here&#8217;s a bit more guided walkthrough available on Vimeo:<\/p>\n<div style=\"padding: 75% 0 0 0; position: relative;\"><iframe loading=\"lazy\" style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%;\" title=\"multfilter_demo_long.mp4\" src=\"https:\/\/player.vimeo.com\/video\/807112525?h=d7d03e9d4e&amp;badge=0&amp;autopause=0&amp;player_id=0&amp;app_id=58479\" width=\"300\" height=\"150\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/div>\n<p><script src=\"https:\/\/player.vimeo.com\/api\/player.js\"><\/script><\/p>\n<p>&#8230; and you can grab it from <a title=\"Download MultFilter\" href=\"https:\/\/github.com\/julsVFX\/arnold\" target=\"_blank\">HERE<\/a> (source + precompiled for Linux, MacOS and Windows)<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #808080;\">_________________________________________________<\/span><br \/>\n<span style=\"color: #808080;\"><span style=\"font-size: small;\"> If this post has helped you in any way you can express your gratefulness by using the <em>Donate <\/em>Button below to buy me a coffee! :)<\/span><\/span><br \/>\n<a href=\"https:\/\/www.paypal.com\/cgi-bin\/webscr?cmd=_s-xclick&amp;hosted_button_id=VH5RW3YDWDJSQ\" target=\"_blank\" rel=\"nofollow\"><img decoding=\"async\" src=\"https:\/\/www.paypal.com\/en_US\/i\/btn\/x-click-but21.gif\" alt=\"\" \/><\/a><\/p>\n<div class=\"moz-text-html\" lang=\"x-unicode\">\n<div><span style=\"font-size: small;\"><span style=\"color: #808080;\">3M5xNSV7g2NzVpHMqzYKhgoKJZ8CWa644m<\/span><\/span><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-2576\" src=\"https:\/\/julius-ihle.de\/wp-content\/uploads\/2018\/03\/bc_ldgr_qrcode.png\" alt=\"bc_ldgr_qrcode\" width=\"128\" height=\"128\" \/><\/div>\n<div><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A very artist-friendly and powerful feature of RenderMan is the ability to light-link light filters to specific objects. In certain scenarios this can become quite useful to make detailed tweaks. In Arnold this is unfortunately not possible to my knowledge, but luckily there are ways to do something similar&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2839","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3MXK6-JN","jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/julius-ihle.de\/index.php?rest_route=\/wp\/v2\/posts\/2839","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/julius-ihle.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/julius-ihle.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/julius-ihle.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/julius-ihle.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2839"}],"version-history":[{"count":4,"href":"https:\/\/julius-ihle.de\/index.php?rest_route=\/wp\/v2\/posts\/2839\/revisions"}],"predecessor-version":[{"id":2847,"href":"https:\/\/julius-ihle.de\/index.php?rest_route=\/wp\/v2\/posts\/2839\/revisions\/2847"}],"wp:attachment":[{"href":"https:\/\/julius-ihle.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/julius-ihle.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/julius-ihle.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}