<?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 3000 shaders on export in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/3000-shaders-on-export/m-p/632168#M8415</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I developed a scene to bring over to Maya, with the intent of creating about 60,000 buildings. I took a small section of it and exported OBJ to bring into Maya and render with Arnold. When I imported the file it created around 3000 shaders.&amp;nbsp; Since I have to convert all of these default Maya shaders to Arnold aiStandard shader I was wondering if there is a more optimized way to do this, I would think that I would not need more shaders than there are textures.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would also be interested in any other model or texture optimization recommendations.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 20 Apr 2013 22:45:15 GMT</pubDate>
    <dc:creator>GregDowning</dc:creator>
    <dc:date>2013-04-20T22:45:15Z</dc:date>
    <item>
      <title>3000 shaders on export</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/3000-shaders-on-export/m-p/632168#M8415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I developed a scene to bring over to Maya, with the intent of creating about 60,000 buildings. I took a small section of it and exported OBJ to bring into Maya and render with Arnold. When I imported the file it created around 3000 shaders.&amp;nbsp; Since I have to convert all of these default Maya shaders to Arnold aiStandard shader I was wondering if there is a more optimized way to do this, I would think that I would not need more shaders than there are textures.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would also be interested in any other model or texture optimization recommendations.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 20 Apr 2013 22:45:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/3000-shaders-on-export/m-p/632168#M8415</guid>
      <dc:creator>GregDowning</dc:creator>
      <dc:date>2013-04-20T22:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: 3000 shaders on export</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/3000-shaders-on-export/m-p/632169#M8416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Greg,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;be cautious in CGA, you can wind up creating lots and lots of materials !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;check your code for :&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;1]&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;color( rand(1), rand(1), rand(1))&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;this creates a new material each time called !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;2]&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;any opacity, reflectivity or other change of the default material settings.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;each time that changes, a new material is created, that is also true of the same texture is used.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;e.g. a default brick texture material is not the same as a glossy brick texture material.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to create 'random colors', use e.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
myRandColor = 33% : 1 33% : 0.8 else : 0.6

Lot --&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; color (myRandColor *myRandColor , myRandColor *myRandColor , myRandColor *myRandColor )&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or play with similar structures with 'const' values to further break down the variation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not sure if you're using an existing example or your own code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know .. ok ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:54:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/3000-shaders-on-export/m-p/632169#M8416</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2021-12-12T02:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: 3000 shaders on export</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/3000-shaders-on-export/m-p/632170#M8417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks again Matt, I will look into this next. I was still using the Pompeii example.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Apr 2013 17:15:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/3000-shaders-on-export/m-p/632170#M8417</guid>
      <dc:creator>GregDowning</dc:creator>
      <dc:date>2013-04-22T17:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: 3000 shaders on export</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/3000-shaders-on-export/m-p/632171#M8418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using the Pompleii cga rule on a larger city I grew. I checked the maya file again after importing the obj and these materials are identical, they are using the same texture in the same channel. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it the random statement that causes it to create a new material for each object? It doesn't have the specific code you mentioned but it does have several "fileRandom" calls for textures.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 02:33:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/3000-shaders-on-export/m-p/632171#M8418</guid>
      <dc:creator>GregDowning</dc:creator>
      <dc:date>2013-04-23T02:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: 3000 shaders on export</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/3000-shaders-on-export/m-p/632172#M8419</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi !&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then it's probably the dirtmaps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've checked, there's 17 dirtmaps :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Note that dirtmaps are not supported in OBJ export. Nevertheless, the material diversification is generated in CE during the model generation process, since exporting is 'post-generating'. If you want to export dirtmaps, use FBX.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Note that this multiplies the number of materials !&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Note also that the dirtmaps have a different UV-set.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;line 150 of pompeii.cga :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;const dirtTex&amp;nbsp;&amp;nbsp;&amp;nbsp; = fileRandom("assets/general/dirtmaps/dirtmap.*.jpg")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe for now, try to just deactivate all dirtmap calls (also, check the other rules) :&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;set(material.dirtmap, dirtTex)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You'll find that the models look more clean afterwards in CE .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know what comes out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Apr 2013 08:58:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/3000-shaders-on-export/m-p/632172#M8419</guid>
      <dc:creator>MatthiasBuehler1</dc:creator>
      <dc:date>2013-04-23T08:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: 3000 shaders on export</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/3000-shaders-on-export/m-p/632173#M8420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Matt, that was helpful, I was able to reduce it to 600 shaders. I have a few things to track down still as it is still ~6 times the number of textures but it is a much more manageable number now.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 28 Apr 2013 17:15:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/3000-shaders-on-export/m-p/632173#M8420</guid>
      <dc:creator>GregDowning</dc:creator>
      <dc:date>2013-04-28T17:15:13Z</dc:date>
    </item>
  </channel>
</rss>

