<?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 That the intersection in Intel® Embree Ray Tracing Kernels</title>
    <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/User-defined-geometry-bouding-box-overlapping/m-p/1172983#M828</link>
    <description>&lt;P&gt;That the intersection callback is called twice for the same object is very strange. Could you send us a more complete reproducer (including geometry setup) to &lt;A href="mailto:embree_support@intel.com"&gt;embree_support@intel.com&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2017 13:56:18 GMT</pubDate>
    <dc:creator>BenthinC_Intel</dc:creator>
    <dc:date>2017-12-14T13:56:18Z</dc:date>
    <item>
      <title>User defined geometry bouding box overlapping</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/User-defined-geometry-bouding-box-overlapping/m-p/1172982#M827</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; I meet a problem when defining the user defined geometry. &amp;nbsp;I simply defined a box, i.e. its bouding box is the same as the box itself.&lt;/P&gt;

&lt;P&gt;I implemented the intersection function as following:&lt;/P&gt;

&lt;P&gt;The problem is when I put two boxes up and down with one common face, i.e. they are aligned perfectly.&lt;/P&gt;

&lt;P&gt;For example, the center of the two boxes are: (0,0,0), (0, 10,0). while the edge length of them is 10.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;When I shoot a ray from top: org (0, 100, 0), dir (0, -1, 0). The '&lt;SPAN style="font-size: 13.008px;"&gt;cellIntersectFunc&lt;/SPAN&gt;' function will be called two times:&lt;/P&gt;

&lt;P&gt;intersect 0&lt;BR /&gt;
	intersect 0&lt;BR /&gt;
	p: (0, 5, 0)&lt;BR /&gt;
	p1: (0, 5, 0)&lt;/P&gt;

&lt;P&gt;The two intersected points (tnear and tfar) is the same, which is the common edge of the two boxes.&lt;/P&gt;

&lt;P&gt;If I seperate them slighly.&amp;nbsp;&lt;SPAN style="font-size: 13.008px;"&gt;(0,0,0), (0, 10.001,0), The results is correct:&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;intersect 0&lt;BR /&gt;
	p: (0, 15.001, 0)&lt;BR /&gt;
	p1: (0, 5.001, 0)&lt;/P&gt;

&lt;P&gt;Does anyone know what's wrong with this problem. I don't want any gaps between boxes, because some&lt;/P&gt;

&lt;P&gt;rays may just go through this gaps and then produce errors.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Thank you!&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;void cellIntersectFunc(void* cell_i, RTCRay&amp;amp; ray, size_t item) {&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;cout &amp;lt;&amp;lt; "intersect " &amp;lt;&amp;lt; item&amp;lt;&amp;lt; endl;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;&amp;nbsp; &amp;nbsp; const Cell* cells = (const Cell*)cell_i;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;const Cell&amp;amp; cell = cells[item];&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Vec3fa dRcp = 1/ray.dir;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;Vec3fa upper_right = cell.left_bottom + Vec3fa(cell.xzExtent, cell.yExtent, cell.xzExtent);&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; for (int i = 0; i &amp;lt; 3; i++) {&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;const float origin = ray.org&lt;I&gt;;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;const float minVal = cell.left_bottom&lt;I&gt;, maxVal = upper_right&lt;I&gt;;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (ray.dir&lt;I&gt; == 0) {//The ray is parallel to the planes.&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (origin &amp;lt; minVal || origin &amp;gt; maxVal) {&lt;BR /&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;return;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;else {&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;float t1 = (minVal - origin) * dRcp&lt;I&gt;;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;float t2 = (maxVal - origin) * dRcp&lt;I&gt;;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;bool flip = t1 &amp;gt; t2;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (flip)&lt;BR /&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;swap(t1, t2);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;ray.tnear = std::max(t1, ray.tnear);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;ray.tfar = std::min(t2, &amp;nbsp;ray.tfar);&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (!(ray.tnear &amp;lt;= ray.tfar))&lt;BR /&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;return;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;ray.geomID = cell.geomID;&lt;BR /&gt;
	&amp;nbsp;&amp;nbsp; &amp;nbsp;ray.primID = (unsigned int)item;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; return;&lt;BR /&gt;
	}&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 12:37:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/User-defined-geometry-bouding-box-overlapping/m-p/1172982#M827</guid>
      <dc:creator>Jianbo_Q_</dc:creator>
      <dc:date>2017-12-13T12:37:26Z</dc:date>
    </item>
    <item>
      <title>That the intersection</title>
      <link>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/User-defined-geometry-bouding-box-overlapping/m-p/1172983#M828</link>
      <description>&lt;P&gt;That the intersection callback is called twice for the same object is very strange. Could you send us a more complete reproducer (including geometry setup) to &lt;A href="mailto:embree_support@intel.com"&gt;embree_support@intel.com&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2017 13:56:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Embree-Ray-Tracing-Kernels/User-defined-geometry-bouding-box-overlapping/m-p/1172983#M828</guid>
      <dc:creator>BenthinC_Intel</dc:creator>
      <dc:date>2017-12-14T13:56:18Z</dc:date>
    </item>
  </channel>
</rss>

