<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: GPU accelerated particles</title>
	<atom:link href="http://www.luminance.org/blog/gruedorf/2009/07/08/gpu-accelerated-particles/feed" rel="self" type="application/rss+xml" />
	<link>http://www.luminance.org/blog/gruedorf/2009/07/08/gpu-accelerated-particles</link>
	<description>Programming and Game Development - Kevin Gadd&#039;s Blog</description>
	<lastBuildDate>Sun, 25 Mar 2012 19:57:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Kael</title>
		<link>http://www.luminance.org/blog/gruedorf/2009/07/08/gpu-accelerated-particles/comment-page-1#comment-351</link>
		<dc:creator>Kael</dc:creator>
		<pubDate>Mon, 14 Sep 2009 18:42:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.luminance.org/?p=548#comment-351</guid>
		<description>&lt;blockquote cite=&quot;#comment-body-350&quot;&gt;
&lt;strong&gt;&lt;a href=&quot;#comment-350&quot; rel=&quot;nofollow&quot;&gt;Markus Ewald&lt;/a&gt; :&lt;/strong&gt;
                  &lt;div class=&quot;avatar&quot;&gt;&lt;img alt=&quot;&quot; src=&quot;http://www.gravatar.com/avatar/2c77da3d1d53514294331467d2589139?s=64&amp;d=identicon&amp;r=PG&quot; class=&quot;avatar avatar-64 photo&quot; height=&quot;64&quot; width=&quot;64&quot;/&gt;&lt;/div&gt;
&lt;p&gt;Letting the GPU update the particles sounds interesting, but how do you eliminate dead particles? I can’t think of a way that would avoid reading particles back into system memory, either to shift alive particles over dead ones or to locate particles marked as dead when you want to add new ones – unless all particles had the same life time in which case you could blindly overwrite the texture like a ring-buffer (but with quite some limitations on how the particle system can be used).&lt;/p&gt;
         &lt;a id=&quot;comment-reply-350&quot; rel=&quot;nofollow&quot;&gt;&lt;/a&gt;
       &lt;/blockquote&gt;
That&#039;s definitely the biggest challenge, I think - the only reasonable solution I can think of that doesn&#039;t involve doing a readback every frame would be something like this:

Your particle system uses multiple textures as a backing store. You start out by filling one up, and once it&#039;s full, you move on to the next one. Periodically (say, every N frames, or whenever you have a certain number of particles), you pull down one or all of the textures, scan over them, and remove all the dead particles, reordering everything. You could also do this on one texture at a time, in a sort of round-robin fashion.

The GPU isn&#039;t going to pay any additional cost for dead particles, so leaving them in the textures for a few frames won&#039;t kill you, and you only need to reclaim the space used by a dead particle when you&#039;re trying to spawn a new one.</description>
		<content:encoded><![CDATA[<blockquote cite="#comment-body-350"><p>
<strong><a href="#comment-350" rel="nofollow">Markus Ewald</a> :</strong></p>
<div class="avatar"><img alt="" src="http://www.gravatar.com/avatar/2c77da3d1d53514294331467d2589139?s=64&amp;d=identicon&amp;r=PG" class="avatar avatar-64 photo" height="64" width="64"/></div>
<p>Letting the GPU update the particles sounds interesting, but how do you eliminate dead particles? I can’t think of a way that would avoid reading particles back into system memory, either to shift alive particles over dead ones or to locate particles marked as dead when you want to add new ones – unless all particles had the same life time in which case you could blindly overwrite the texture like a ring-buffer (but with quite some limitations on how the particle system can be used).</p>
<p>         <a id="comment-reply-350" rel="nofollow"></a>
       </p></blockquote>
<p>That&#8217;s definitely the biggest challenge, I think &#8211; the only reasonable solution I can think of that doesn&#8217;t involve doing a readback every frame would be something like this:</p>
<p>Your particle system uses multiple textures as a backing store. You start out by filling one up, and once it&#8217;s full, you move on to the next one. Periodically (say, every N frames, or whenever you have a certain number of particles), you pull down one or all of the textures, scan over them, and remove all the dead particles, reordering everything. You could also do this on one texture at a time, in a sort of round-robin fashion.</p>
<p>The GPU isn&#8217;t going to pay any additional cost for dead particles, so leaving them in the textures for a few frames won&#8217;t kill you, and you only need to reclaim the space used by a dead particle when you&#8217;re trying to spawn a new one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Markus Ewald</title>
		<link>http://www.luminance.org/blog/gruedorf/2009/07/08/gpu-accelerated-particles/comment-page-1#comment-350</link>
		<dc:creator>Markus Ewald</dc:creator>
		<pubDate>Mon, 14 Sep 2009 18:02:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.luminance.org/?p=548#comment-350</guid>
		<description>This very much reminds me of the thoughts I went to when I designed my own particle system.

I didn&#039;t have the problem of SpriteBatch&#039;s overhead because I had previously written my own SpriteBatch-alike class (which efficiently handles mass-data and supports point sprites) - so I ended up taking the CPU-based multi-threaded approach first.

Letting the GPU update the particles sounds interesting, but how do you eliminate dead particles? I can&#039;t think of a way that would avoid reading particles back into system memory, either to shift alive particles over dead ones or to locate particles marked as dead when you want to add new ones - unless all particles had the same life time in which case you could blindly overwrite the texture like a ring-buffer (but with quite some limitations on how the particle system can be used).</description>
		<content:encoded><![CDATA[<p>This very much reminds me of the thoughts I went to when I designed my own particle system.</p>
<p>I didn&#8217;t have the problem of SpriteBatch&#8217;s overhead because I had previously written my own SpriteBatch-alike class (which efficiently handles mass-data and supports point sprites) &#8211; so I ended up taking the CPU-based multi-threaded approach first.</p>
<p>Letting the GPU update the particles sounds interesting, but how do you eliminate dead particles? I can&#8217;t think of a way that would avoid reading particles back into system memory, either to shift alive particles over dead ones or to locate particles marked as dead when you want to add new ones &#8211; unless all particles had the same life time in which case you could blindly overwrite the texture like a ring-buffer (but with quite some limitations on how the particle system can be used).</p>
]]></content:encoded>
	</item>
</channel>
</rss>
