<?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 World-Aligned Road Texturing in ArcGIS CityEngine Questions</title>
    <link>https://community.esri.com/t5/arcgis-cityengine-questions/world-aligned-road-texturing/m-p/71418#M996</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on a road rule file that does texturing based on the world position of the shape in order to minimize texture discontinuities. I'm using the GetMapData function to retrieve the road layout and. However, the world-space uvs do not line up for multiple street shapes and are shifted in curved shapes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following code is used:&amp;nbsp;&lt;/P&gt;&lt;P&gt;RoadAsphalt --&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;setupProjection(0, world.xz, 4, 4) &lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;projectUV(0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;translateUV(0, -OffsetX/4, -OffsetZ/4) &lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;scaleUV(0,1,-1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;texture("builtin:uvtest.png")X.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OffsetX/Y/Z is the centroid of the scene (without it single-precision uvs have trouble)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/433627_Unbenannt.PNG" /&gt;&lt;IMG alt="" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/433652_Unbenannt2.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have an idea on how to get continous UVs over multiple shapes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bernhard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Jan 2019 10:23:15 GMT</pubDate>
    <dc:creator>BernhardRainer1</dc:creator>
    <dc:date>2019-01-18T10:23:15Z</dc:date>
    <item>
      <title>World-Aligned Road Texturing</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/world-aligned-road-texturing/m-p/71418#M996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm working on a road rule file that does texturing based on the world position of the shape in order to minimize texture discontinuities. I'm using the GetMapData function to retrieve the road layout and. However, the world-space uvs do not line up for multiple street shapes and are shifted in curved shapes.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following code is used:&amp;nbsp;&lt;/P&gt;&lt;P&gt;RoadAsphalt --&amp;gt;&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;setupProjection(0, world.xz, 4, 4) &lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;projectUV(0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;translateUV(0, -OffsetX/4, -OffsetZ/4) &lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;scaleUV(0,1,-1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;texture("builtin:uvtest.png")X.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OffsetX/Y/Z is the centroid of the scene (without it single-precision uvs have trouble)&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/433627_Unbenannt.PNG" /&gt;&lt;IMG alt="" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/433652_Unbenannt2.PNG" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have an idea on how to get continous UVs over multiple shapes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bernhard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2019 10:23:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/world-aligned-road-texturing/m-p/71418#M996</guid>
      <dc:creator>BernhardRainer1</dc:creator>
      <dc:date>2019-01-18T10:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: World-Aligned Road Texturing</title>
      <link>https://community.esri.com/t5/arcgis-cityengine-questions/world-aligned-road-texturing/m-p/71419#M997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;world.xz&lt;/SPAN&gt; would be the way to set up the projection, but unfortunately when the scene contents are far away from the origin, there are some problems with floating point precision.&amp;nbsp; This is why you get the results above.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;With &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;setupProjection(0, world.xz, 4, 4)&lt;/SPAN&gt;, the texture is blurry.&lt;/LI&gt;&lt;LI&gt;Adding an offset in&amp;nbsp;&lt;SPAN&gt;&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;setupProjection(0, world.xz, 4, 4, 525363, -5221099)&lt;/SPAN&gt;, fixes the blurry textures, but the textures are discontinuous.&amp;nbsp; (Offset numbers are taken from your screenshot).&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;While we investigate the problem and see if we can fix it, there is a not-so-nice workaround to get continuous textures on the street shapes which are far away from the scene origin.&amp;nbsp; This workaround imposes some limitations though (e.g. no more dynamic shapes, no more separate shapes).&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN&gt;Convert the street shapes to static shapes (&lt;STRONG&gt;Graph -&amp;gt; Convert to Static Shapes&lt;/STRONG&gt;)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Combine the shapes into a single shape (&lt;STRONG&gt;Shapes -&amp;gt; Combine Shapes&lt;/STRONG&gt;)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Apply &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;setupProjection&lt;/SPAN&gt; using scope instead of world.&lt;/LI&gt;&lt;/OL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 May 2019 12:15:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-cityengine-questions/world-aligned-road-texturing/m-p/71419#M997</guid>
      <dc:creator>CherylLau</dc:creator>
      <dc:date>2019-05-03T12:15:35Z</dc:date>
    </item>
  </channel>
</rss>

