<?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   in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Unity-Draw-Images-Lag/m-p/1040941#M45984</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Maybe I haven't understood correctly and I may be wrong, but it sounds strange to me that the main thread have to wait for camera's frame in order to go forward. Are you running the code which acquire frames in a separated thread?&lt;/P&gt;

&lt;P&gt;I'm using a background worker which generates an event when each frame is ready (the same event gives the frame to the main thread)..In this way the main thread, which is listening to events from the background worker, goes on its own with no lag and analizes the frame when the event is rised.&lt;/P&gt;

&lt;P&gt;Mike&lt;/P&gt;</description>
    <pubDate>Fri, 31 Oct 2014 07:51:43 GMT</pubDate>
    <dc:creator>Mike_V_</dc:creator>
    <dc:date>2014-10-31T07:51:43Z</dc:date>
    <item>
      <title>Unity Draw Images Lag</title>
      <link>https://community.intel.com/t5/Software-Archive/Unity-Draw-Images-Lag/m-p/1040939#M45982</link>
      <description>&lt;P&gt;When I add the "Image" prefab to my empty scene with just a camera, the game seems to run at the same frame rate as the real-life camera.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Is this intentional?&lt;/P&gt;

&lt;P&gt;For example, when lighting changes drastically, the camera framerate sometimes drops. But then so does the whole game, and the main thread goes up to 60ms, and it runs at 30 ms on average. The main thread should not be this high just to display a webcam texture on a plane.&lt;/P&gt;

&lt;P&gt;I am using the older Senz3D camera, but it has the exact same issue with another camera I have tried. So I'm not sure if even the new camera will fix this.&lt;/P&gt;

&lt;P&gt;Anyone have an idea for why displaying the webcam on a plane with DrawImages would be so inefficient?&lt;/P&gt;

&lt;P&gt;Does the RSSDK pause execution inbetween camera frames or something?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2014 00:54:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Unity-Draw-Images-Lag/m-p/1040939#M45982</guid>
      <dc:creator>Austin_C_</dc:creator>
      <dc:date>2014-10-30T00:54:58Z</dc:date>
    </item>
    <item>
      <title>Okay I found a solution, but</title>
      <link>https://community.intel.com/t5/Software-Archive/Unity-Draw-Images-Lag/m-p/1040940#M45983</link>
      <description>&lt;P&gt;Okay I found a solution, but I'm not sure what side-effects it will have.&lt;/P&gt;

&lt;P&gt;Using the profiler, I found that AcquireFrame was causing all of my application's lag.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Here is the documentation on AcquireFrame:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?acquireframe_pxcsensemanager.html" target="_blank"&gt;https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?acquireframe_pxcsensemanager.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;In SenseToolkitManager.cs, in the Update() function, change this line:&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;_sts = SenseManager.AcquireFrame(true, 100);&lt;/PRE&gt;

&lt;P&gt;to this:&lt;/P&gt;

&lt;PRE class="brush:csharp;"&gt;_sts = SenseManager.AcquireFrame(false, 1);&lt;/PRE&gt;

&lt;P&gt;Now my framerate has jumped from 15-20 fps to 90+ fps, and my Main Thread is at about 10ms instead of 60.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Oct 2014 18:04:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Unity-Draw-Images-Lag/m-p/1040940#M45983</guid>
      <dc:creator>Austin_C_</dc:creator>
      <dc:date>2014-10-30T18:04:08Z</dc:date>
    </item>
    <item>
      <title> </title>
      <link>https://community.intel.com/t5/Software-Archive/Unity-Draw-Images-Lag/m-p/1040941#M45984</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;Maybe I haven't understood correctly and I may be wrong, but it sounds strange to me that the main thread have to wait for camera's frame in order to go forward. Are you running the code which acquire frames in a separated thread?&lt;/P&gt;

&lt;P&gt;I'm using a background worker which generates an event when each frame is ready (the same event gives the frame to the main thread)..In this way the main thread, which is listening to events from the background worker, goes on its own with no lag and analizes the frame when the event is rised.&lt;/P&gt;

&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2014 07:51:43 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Unity-Draw-Images-Lag/m-p/1040941#M45984</guid>
      <dc:creator>Mike_V_</dc:creator>
      <dc:date>2014-10-31T07:51:43Z</dc:date>
    </item>
    <item>
      <title>I'm using everything that is</title>
      <link>https://community.intel.com/t5/Software-Archive/Unity-Draw-Images-Lag/m-p/1040942#M45985</link>
      <description>&lt;P&gt;I'm using everything that is comes default with the Unity Toolkit Package.&lt;/P&gt;

&lt;P&gt;I created an empty scene with just a camera and their prefab "Image" and hit play.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;When I look at the stats, the framerate of the game seems to be the same as the camera.&lt;/P&gt;

&lt;P&gt;For example, when I put my hand over the sensor and it gets darker, the camera's framerate drops (because it's trying to correct for low lighting I guess). That drop in frame rate also makes the game's frame rate drop.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;I can make a video later showing exactly what's going on.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;What seems to be happening is the whole game just pauses while it waits for the I/O from the camera unless you set that variable to false.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2014 07:59:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Unity-Draw-Images-Lag/m-p/1040942#M45985</guid>
      <dc:creator>Austin_C_</dc:creator>
      <dc:date>2014-10-31T07:59:45Z</dc:date>
    </item>
    <item>
      <title>Ok, what I understood is that</title>
      <link>https://community.intel.com/t5/Software-Archive/Unity-Draw-Images-Lag/m-p/1040943#M45986</link>
      <description>&lt;P&gt;Ok, what I understood is that the game waits for camera inputs to go forward. That's why I think that decoupling the camera from the main thread might work. &lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;U&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 19.5120010375977px;"&gt;nfortunately I&lt;/SPAN&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp;have no experience with unity and I can't say much more :( &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;Mike&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2014 10:19:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Unity-Draw-Images-Lag/m-p/1040943#M45986</guid>
      <dc:creator>Mike_V_</dc:creator>
      <dc:date>2014-10-31T10:19:27Z</dc:date>
    </item>
    <item>
      <title>Thanks anyway. I don't have</title>
      <link>https://community.intel.com/t5/Software-Archive/Unity-Draw-Images-Lag/m-p/1040944#M45987</link>
      <description>&lt;P&gt;Thanks anyway. I don't have the new camera yet so I don't know what functionality changes this will have, but at least it did improve the framerate.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Oct 2014 22:47:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Unity-Draw-Images-Lag/m-p/1040944#M45987</guid>
      <dc:creator>Austin_C_</dc:creator>
      <dc:date>2014-10-31T22:47:49Z</dc:date>
    </item>
    <item>
      <title>AcquireFrame is used to wait</title>
      <link>https://community.intel.com/t5/Software-Archive/Unity-Draw-Images-Lag/m-p/1040945#M45988</link>
      <description>&lt;P&gt;AcquireFrame is used to wait for data to be available and pauses processing &amp;nbsp;(but not captures) until you invoke ReleaseFrame, so the frame should be released as soon as possible so the next frames can then be processed. In Unity, it's recommended to use AcquireFrame(false,0) to avoid impacting the Unity rendering performance.&amp;nbsp;&lt;/P&gt;

&lt;P class="p_TableText"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Nov 2014 07:01:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Unity-Draw-Images-Lag/m-p/1040945#M45988</guid>
      <dc:creator>Colleen_C_Intel</dc:creator>
      <dc:date>2014-11-01T07:01:00Z</dc:date>
    </item>
  </channel>
</rss>

