<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Driving shader properties on instances in Bifrost Forum</title>
    <link>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9736371#M5729</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="basic_user_data_1.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/816775i6028CDB84B4E70B7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="basic_user_data_1.png" alt="basic_user_data_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;In the shader I use AiUserDataColor to get any data I want from the instances. This data can come from the point cloud as shown here - but can also come from user data on the instanced geometry.&lt;/LI&gt;
&lt;LI&gt;This shader is applied to the sphere that we're instancing. The "assign material" just removes materials from the grid I'm using as my point cloud.&lt;/LI&gt;
&lt;LI&gt;In the graph I am taking the positions of the points and rescaling them to a zero-one range. You can modify these values in the graph with random data or anything else.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here is something slightly closer to the car example, this time I generate random values per point, generate the color gradients as before, and mix them together. That's the attached zip you'll find both these scene files.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="basic_user_data_2.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/816774iB7DCE70782FD1284/image-size/medium?v=v2&amp;amp;px=400" role="button" title="basic_user_data_2.png" alt="basic_user_data_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In the case of the Jaguar, this is instanced using render archive instancing but the process is the same. I have a lookdev scene that looks like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="carpaint_shader.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/816779iFD1765E75D3F4C72/image-size/medium?v=v2&amp;amp;px=400" role="button" title="carpaint_shader.png" alt="carpaint_shader.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That shader reads point_color to set car paint color, and if that data is not available uses the yellow color. I export the car as an Arnold .ass render archive (Arnold: Export Standin).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cars_grid.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/816780i1CAB77EF5B4D01D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cars_grid.png" alt="cars_grid.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then I instance that using render_archive_instance with a cube preview, and set colors. The shader inside the render archive picks them up.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Sep 2020 22:57:30 GMT</pubDate>
    <dc:creator>jonah.friedman</dc:creator>
    <dc:date>2020-09-08T22:57:30Z</dc:date>
    <item>
      <title>Driving shader properties on instances</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9736348#M5728</link>
      <description>&lt;P&gt;I was asked in another place how to drive shader parameters on instances, in the context of how the following image which was produced.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="color.JPG" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/816770iDF860F4F97089101/image-size/medium?v=v2&amp;amp;px=400" role="button" title="color.JPG" alt="color.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I'm re-asking the question to myself to post the answer publicly. Please feel free to use the thread for discussion as well.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 22:58:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9736348#M5728</guid>
      <dc:creator>jonah.friedman</dc:creator>
      <dc:date>2020-09-08T22:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Driving shader properties on instances</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9736371#M5729</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="basic_user_data_1.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/816775i6028CDB84B4E70B7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="basic_user_data_1.png" alt="basic_user_data_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;In the shader I use AiUserDataColor to get any data I want from the instances. This data can come from the point cloud as shown here - but can also come from user data on the instanced geometry.&lt;/LI&gt;
&lt;LI&gt;This shader is applied to the sphere that we're instancing. The "assign material" just removes materials from the grid I'm using as my point cloud.&lt;/LI&gt;
&lt;LI&gt;In the graph I am taking the positions of the points and rescaling them to a zero-one range. You can modify these values in the graph with random data or anything else.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Here is something slightly closer to the car example, this time I generate random values per point, generate the color gradients as before, and mix them together. That's the attached zip you'll find both these scene files.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="basic_user_data_2.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/816774iB7DCE70782FD1284/image-size/medium?v=v2&amp;amp;px=400" role="button" title="basic_user_data_2.png" alt="basic_user_data_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In the case of the Jaguar, this is instanced using render archive instancing but the process is the same. I have a lookdev scene that looks like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="carpaint_shader.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/816779iFD1765E75D3F4C72/image-size/medium?v=v2&amp;amp;px=400" role="button" title="carpaint_shader.png" alt="carpaint_shader.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;That shader reads point_color to set car paint color, and if that data is not available uses the yellow color. I export the car as an Arnold .ass render archive (Arnold: Export Standin).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cars_grid.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/816780i1CAB77EF5B4D01D1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="cars_grid.png" alt="cars_grid.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then I instance that using render_archive_instance with a cube preview, and set colors. The shader inside the render archive picks them up.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Sep 2020 22:57:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9736371#M5729</guid>
      <dc:creator>jonah.friedman</dc:creator>
      <dc:date>2020-09-08T22:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Driving shader properties on instances</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9736981#M5730</link>
      <description>&lt;P&gt;First try with your scene does work great!&lt;/P&gt;
&lt;P&gt;Thanks a lot Johna. I managed to layer the color ontop of a grayscale texture for my grass.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="layer_point_color.JPG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/816942iCFD9F858677ACB4C/image-size/large?v=v2&amp;amp;px=999" role="button" title="layer_point_color.JPG" alt="layer_point_color.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But now i want to use "handpainted" vertexColors to get green colors onto my grass.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do i sample the vertexcolors from the plane?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the scene.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 08:03:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9736981#M5730</guid>
      <dc:creator>Christoph_Schaedl</dc:creator>
      <dc:date>2020-09-09T08:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Driving shader properties on instances</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9737075#M5731</link>
      <description>&lt;P&gt;I thought i could get the vertexcolor with a "get_geo" node. But it wont work.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cmap.JPG" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/816969iDE00C71E3B09DC6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="cmap.JPG" alt="cmap.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 08:49:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9737075#M5731</guid>
      <dc:creator>Christoph_Schaedl</dc:creator>
      <dc:date>2020-09-09T08:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Driving shader properties on instances</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9737126#M5732</link>
      <description>&lt;P&gt;First, you are setting the wrong data type on that get_geo_property, the type on that node should be array&amp;lt;Math::float4&amp;gt;, not a single&amp;nbsp;float3.&lt;BR /&gt;&lt;BR /&gt;Second, you don't even need to use a get_geo_property node. You need to sample you color map property, from your points, using geometry queries, in this case get_closest_locations. Here's a tutorial Paul Smith made the other day:&amp;nbsp;&amp;nbsp;&lt;A href="https://vimeo.com/454418121" target="_blank" rel="noopener"&gt;https://vimeo.com/454418121&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;One's you've sampled your color map, you can save the result as a geo property on your points, and pass this to the renderer using the method explained by Jonah.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 09:23:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9737126#M5732</guid>
      <dc:creator>mjcg91</dc:creator>
      <dc:date>2020-09-09T09:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Driving shader properties on instances</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9737140#M5733</link>
      <description>&lt;P&gt;hmm... i tried both. Changing the type and the method from Paul today in the morning.&lt;/P&gt;
&lt;P&gt;I give it a second go. Thanks now i know it has to work.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 09:25:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9737140#M5733</guid>
      <dc:creator>Christoph_Schaedl</dc:creator>
      <dc:date>2020-09-09T09:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: Driving shader properties on instances</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9737165#M5734</link>
      <description>&lt;P&gt;It does work and im able to paint during rendering!!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://youtu.be/4sx_SBXX48A" target="_blank" rel="noopener"&gt;https://youtu.be/4sx_SBXX48A&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 09:39:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9737165#M5734</guid>
      <dc:creator>Christoph_Schaedl</dc:creator>
      <dc:date>2020-09-09T09:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: Driving shader properties on instances</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9737187#M5735</link>
      <description>&lt;P&gt;Maxime what is the advantage of sampling the color instead of using the get_geo node?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 09:44:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9737187#M5735</guid>
      <dc:creator>Christoph_Schaedl</dc:creator>
      <dc:date>2020-09-09T09:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Driving shader properties on instances</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9737229#M5736</link>
      <description>&lt;P&gt;It's not a question of advantages. In your case it worked because you scattered instances using the mesh's point_position. so the instance's points indices and the vertex color indices lines up.&lt;BR /&gt;&lt;BR /&gt;If you scatter points on anything else other than your mesh's point_position, you setup will break. That's why you need to use geometry queries sample the closest color, and use the returned values to set your instances's color.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2020 10:10:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9737229#M5736</guid>
      <dc:creator>mjcg91</dc:creator>
      <dc:date>2020-09-09T10:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: Driving shader properties on instances</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9987598#M5737</link>
      <description>&lt;LI-CODE lang="general"&gt;Hi everyone,
I have just been trying this out myself but I'm having issues getting it working and I'm wondering if it is perhaps my low knowledge of Arnold. I feel like I have replicated the steps, created a shader, plugged in an aiUserDataColor given it the attribute name I have set via the set_geo_property node but my render is just coming out white. I know the colour data is there because I have visualized it in the viewport by adding a color attribute to the particles as well.
I guess I'm wondering if there is an extra Arnold step I'm missing? Looking through the documentation it seems normally you need to add a specific parameter to the shape node of the mesh you want the userdata to affect. I had assumed that doing the set_geo_property we were kind of already doing this per point. Is there a simple step in missing?

Thanks
James&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 08 Jan 2021 15:05:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9987598#M5737</guid>
      <dc:creator>dangermouse82</dc:creator>
      <dc:date>2021-01-08T15:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Driving shader properties on instances</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9987656#M5738</link>
      <description>&lt;P&gt;Are you on the latest Arnold version.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you tried the sample scenes from Jonah?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 15:21:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9987656#M5738</guid>
      <dc:creator>Christoph_Schaedl</dc:creator>
      <dc:date>2021-01-08T15:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Driving shader properties on instances</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9987812#M5739</link>
      <description>&lt;P&gt;Yes to both &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The only thing I hadn't done was add an assign_material node at the beginning of the graph as I thought this was just to make the plane not render. I removed that in Jonah's scene though and the colours disapeared as well so perhaps you have to add this to have an empty material to start with?&lt;/P&gt;&lt;P&gt;Either way I added this to my graph this morning and now its working! I'll post something later today of a new compound I've been playing around with &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for replying&lt;/P&gt;&lt;P&gt;James&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jan 2021 16:18:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/9987812#M5739</guid>
      <dc:creator>dangermouse82</dc:creator>
      <dc:date>2021-01-08T16:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Driving shader properties on instances</title>
      <link>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/11524782#M5740</link>
      <description>&lt;P&gt;Hi, is it possible to drive Arnold operators per instance to create more variation?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2022 08:37:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/bifrost-forum/driving-shader-properties-on-instances/m-p/11524782#M5740</guid>
      <dc:creator>niroumand.reza</dc:creator>
      <dc:date>2022-11-02T08:37:06Z</dc:date>
    </item>
  </channel>
</rss>

