<?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 For triangles and quads best in Intel® Embree Ray Tracing Kernels</title>
    <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/UV-Interpolation/m-p/1143451#M708</link>
    <description>&lt;P&gt;For triangles and quads best implement the implementation yourself, thus will give higher performance.&lt;/P&gt;

&lt;P&gt;For subdivision surfaces, face varying interpolation is now supported, thus there is no need to create these dummy subdiv meshes anymore. See Face-Varying-Data section of the Embree documentation &lt;A href="http://embree.github.io/api.html"&gt;http://embree.github.io/api.html&lt;/A&gt;. You essentially have to create a separate index buffer when you have face varying data, and attach that index buffer to the user vertex buffer to interpolate.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Oct 2017 05:18:51 GMT</pubDate>
    <dc:creator>SvenW_Intel</dc:creator>
    <dc:date>2017-10-19T05:18:51Z</dc:date>
    <item>
      <title>UV Interpolation</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/UV-Interpolation/m-p/1143450#M707</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I know that this question has been asked here before and there is a reply discussing to create a secondary mesh, but the answer is too vague (or maybe it's just that I don't understand it) and the way this is handled in the Interpolation tutorial is very obscure to me and I cannot understand how it works.&lt;/P&gt;

&lt;P&gt;What I want to do is to work with objects that can be either:&lt;/P&gt;

&lt;P&gt;* Triangle meshes (rtcNewTriangleMesh2)&lt;/P&gt;

&lt;P&gt;* Quad meshes (rtcNewQuadMesh2)&lt;/P&gt;

&lt;P&gt;* Subdiv meshes made of a mixture of triangles and quads (rtcNewSubdivisionMesh2)&lt;/P&gt;

&lt;P&gt;* Hair objects (rtcNewBezierHairGeometry2)&lt;/P&gt;

&lt;P&gt;For each of those objects, after a ray intersection where I get ray.u and ray.v, I want to interpolate some per-face/vertex UV coordinates. So I was wondering if to do the interpolation myself or (probably better) to use rtcInterpolate to do it.&lt;/P&gt;

&lt;P&gt;Unfortunately rtcInterpolate is only for Vertex data and not for Face/Vertex data. So, I was considering making these secondary auxiliary meshes but I don't really understand how to do it. Also, I'm not too happy having to duplicate (or more) the RAM needed to store Embree objects.&lt;/P&gt;

&lt;P&gt;Perhaps for triangle/quad and subdiv meshes made of tri/quads it's not necessary to use rtcInterpolate? Or due to performance reasons it's better to use it despite duplicating RAM?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2017 19:20:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/UV-Interpolation/m-p/1143450#M707</guid>
      <dc:creator>David_B_3</dc:creator>
      <dc:date>2017-10-18T19:20:31Z</dc:date>
    </item>
    <item>
      <title>For triangles and quads best</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/UV-Interpolation/m-p/1143451#M708</link>
      <description>&lt;P&gt;For triangles and quads best implement the implementation yourself, thus will give higher performance.&lt;/P&gt;

&lt;P&gt;For subdivision surfaces, face varying interpolation is now supported, thus there is no need to create these dummy subdiv meshes anymore. See Face-Varying-Data section of the Embree documentation &lt;A href="http://embree.github.io/api.html"&gt;http://embree.github.io/api.html&lt;/A&gt;. You essentially have to create a separate index buffer when you have face varying data, and attach that index buffer to the user vertex buffer to interpolate.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Oct 2017 05:18:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/UV-Interpolation/m-p/1143451#M708</guid>
      <dc:creator>SvenW_Intel</dc:creator>
      <dc:date>2017-10-19T05:18:51Z</dc:date>
    </item>
    <item>
      <title>Hello,</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/UV-Interpolation/m-p/1143452#M709</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Thank you for your answer. However, I still find it difficult to understand.&lt;/P&gt;

&lt;P&gt;For example, let's imagine I have a Quad object (or a SubDiv object where all faces are quads) that is a Cube.&lt;/P&gt;

&lt;P&gt;The cube would have 6 faces and 8 vertices, so I would create it, for example with:&lt;/P&gt;

&lt;P&gt;unsigned geomID = rtcNewSubdivisionMesh2(scene, RTC_GEOMETRY_STATIC, 6, 6*4, 8, 0, 0, 0, 1);&lt;/P&gt;

&lt;P&gt;So, I create my Faces buffer [6] with the 6 entries = 4, my Index buffer [6] with the 4 vertices in each face and then the Vertex buffer [8] with the 8 vertices. Up to here, all is ok and works correctly.&lt;/P&gt;

&lt;P&gt;However, if I want to create UV coordinates that are not just per-vertex but per-face+vertex I need to create a User Vertex Buffer of 6 faces x UV data for 4 vertices each = UV data for 24 vertices. In this case my Index buffer+1 used for this topology would still have 6 entries as before, but this time the UV data for the vertices could be each of the 24 vertices and therefore I get a segfault because the object was created with room for 8 vertices and not with 24 vertices.&lt;/P&gt;

&lt;P&gt;Alternatively I could create the object with 24 vertices but how? Can I just leave the "unused" 16 vertices without initializing them? Would that create problems somewhere?&lt;/P&gt;

&lt;P&gt;Thanks and Best regards!&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Oct 2017 08:30:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/UV-Interpolation/m-p/1143452#M709</guid>
      <dc:creator>David_B_3</dc:creator>
      <dc:date>2017-10-22T08:30:54Z</dc:date>
    </item>
    <item>
      <title>To setup the per-face data to</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/UV-Interpolation/m-p/1143453#M710</link>
      <description>&lt;P&gt;To setup the per-face data to interpolate you would essentially do the following additionally to setting up the geometry:&lt;/P&gt;

&lt;P&gt;rtcSetBuffer(geom, RTC_INDEX_BUFFER0+1, mesh-&amp;gt;texcoord_indices, 0, sizeof(unsigned int), mesh-&amp;gt;numEdges);&lt;/P&gt;

&lt;P&gt;rtcSetBuffer(geom, RTC_USER_VERTEX_BUFFER0, mesh-&amp;gt;texcoords, 0, sizeof(Vec2f), mesh-&amp;gt;numTexCoords);&lt;/P&gt;

&lt;P&gt;rtcSetIndexBuffer(geom, RTC_USER_VERTEX_BUFFER0, RTC_INDEX_BUFFER0+1);&lt;/P&gt;

&lt;P&gt;The texcoords can have different index buffer and different buffer with texcoords. The number of texcoords does NOT have to be the same as the number of positions/vertices. In your example the texcoord_indices could contain the values 0,1,2,3,&amp;nbsp;&amp;nbsp; 4,5,6,7,&amp;nbsp;&amp;nbsp;&amp;nbsp; 8,9,10,11, ... in case each face has its own texcoords, and no texcoords are shared between faces. The texcoords buffer would contain 24 texture coordinates.&lt;/P&gt;

&lt;P&gt;Also have a look at the ConvertSubdivMesh function in scene_device.cpp. There is also a debug scene includes that shows the feature ./viewer -c tutorials/models/cylinder.ecs&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 08:59:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/UV-Interpolation/m-p/1143453#M710</guid>
      <dc:creator>SvenW_Intel</dc:creator>
      <dc:date>2017-10-23T08:59:45Z</dc:date>
    </item>
  </channel>
</rss>

