<?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 OK , thanks for clarifying! in Intel® Embree Ray Tracing Kernels</title>
    <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/user-geometry-intersection-routine/m-p/1181729#M842</link>
    <description>&lt;P&gt;OK , thanks for clarifying!&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jan 2018 16:16:43 GMT</pubDate>
    <dc:creator>AndrewC</dc:creator>
    <dc:date>2018-01-17T16:16:43Z</dc:date>
    <item>
      <title>user geometry intersection routine</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/user-geometry-intersection-routine/m-p/1181727#M840</link>
      <description>&lt;P&gt;Following from the "user_geometry" example. I am mixing analytical spheres and triangulated geometry.&lt;/P&gt;

&lt;P&gt;The sphere intersection function has a signature of void sphereIntersectFunc(void* spheres_i, RTCRay&amp;amp; ray, size_t item);&lt;/P&gt;

&lt;P&gt;My algorithm simply sets up the rays, loops over them and calls&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rtcIntersect(rtcscene, rtc_ray&lt;I&gt;);&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;In the "user defined intersection" function for the sphere(s). I notice in the &lt;EM&gt;passed &lt;/EM&gt;RTCRay structure&amp;nbsp; two things that I find a bit confusing.&lt;/P&gt;

&lt;P&gt;- the tnear and tfar values are not 0.0 and inf as I would expect. They are often a "segment" of the ray. I can understand this may be an optimization based on a geometry space subdivision. It appears I should restrict any intersection to only be within the passed tnear and tfar.&lt;/P&gt;

&lt;P&gt;- the RTCRay structure sometimes also contains a geomID&amp;nbsp; == the triangulated geometry ID. That is, the ray seems to already have intersected some part of the triangulated geometry before being passed to the "sphere" intersection routine. I really don't understand this.&amp;nbsp; I would expect that once a ray has intersected a geometry, it would return immediately from rtcIntersect.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2018 22:35:34 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/user-geometry-intersection-routine/m-p/1181727#M840</guid>
      <dc:creator>AndrewC</dc:creator>
      <dc:date>2018-01-10T22:35:34Z</dc:date>
    </item>
    <item>
      <title>1) In the user geometry</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/user-geometry-intersection-routine/m-p/1181728#M841</link>
      <description>&lt;P&gt;1) In the user geometry callback the tnear value will always be identical to the tnear initially passed to the ray, but the tfar value will shrink when hits get found. Reason is that rtcIntersect is interested in the closest hit only, and the current closest distance is recorded as ray.tfar.&lt;/P&gt;

&lt;P&gt;2) rtcIntersect returns the closest intersection, thus even if it already found an intersection with a triangle, intersections with your sphere might still be closer than this current closest hit. This is why you see triangle hit data inside the ray. However, you should never read that hit data, your callback should just update the hit data (and tfar) when a closer hit is found.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 07:46:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/user-geometry-intersection-routine/m-p/1181728#M841</guid>
      <dc:creator>SvenW_Intel</dc:creator>
      <dc:date>2018-01-17T07:46:15Z</dc:date>
    </item>
    <item>
      <title>OK , thanks for clarifying!</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/user-geometry-intersection-routine/m-p/1181729#M842</link>
      <description>&lt;P&gt;OK , thanks for clarifying!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 16:16:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/user-geometry-intersection-routine/m-p/1181729#M842</guid>
      <dc:creator>AndrewC</dc:creator>
      <dc:date>2018-01-17T16:16:43Z</dc:date>
    </item>
  </channel>
</rss>

