<?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 for JacksonDunstan.com</title>
	<atom:link href="http://jacksondunstan.com/comments/feed" rel="self" type="application/rss+xml" />
	<link>http://jacksondunstan.com</link>
	<description>Mastering AS3</description>
	<lastBuildDate>Mon, 14 May 2012 17:02:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>Comment on Using Alpha Textures With Stage3D by jackson</title>
		<link>http://jacksondunstan.com/articles/1854/comment-page-1#comment-29702</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Mon, 14 May 2012 17:02:12 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=1854#comment-29702</guid>
		<description>Good points, both on the pro side and the con. I&#039;ve heard that the &lt;code&gt;kil&lt;/code&gt; opcode can really destroy performance on some devices though, so I&#039;d be careful. I&#039;ll add testing it to my list of article ideas. Thanks for the tip.</description>
		<content:encoded><![CDATA[<p>Good points, both on the pro side and the con. I&#8217;ve heard that the <code>kil</code> opcode can really destroy performance on some devices though, so I&#8217;d be careful. I&#8217;ll add testing it to my list of article ideas. Thanks for the tip.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Using Alpha Textures With Stage3D by ben w</title>
		<link>http://jacksondunstan.com/articles/1854/comment-page-1#comment-29683</link>
		<dc:creator>ben w</dc:creator>
		<pubDate>Mon, 14 May 2012 10:43:45 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=1854#comment-29683</guid>
		<description>another option is using the kill command in the pixel shader to discard pixels that fall below a threshold, this will not give as nice a result but for a number of situations will prove good enough, the benefit is no state change required to get the transparency, the downside is its only an on or off switch.

might be worth throwing into the mix to see if it proves to be a faster option than using alpha blending.

also impressive that it seems to sort that many cubes with almost no impact on performance, specially as it is a vector sort :) be interesting to see your timings for culling and sorting and rendering separately</description>
		<content:encoded><![CDATA[<p>another option is using the kill command in the pixel shader to discard pixels that fall below a threshold, this will not give as nice a result but for a number of situations will prove good enough, the benefit is no state change required to get the transparency, the downside is its only an on or off switch.</p>
<p>might be worth throwing into the mix to see if it proves to be a faster option than using alpha blending.</p>
<p>also impressive that it seems to sort that many cubes with almost no impact on performance, specially as it is a vector sort :) be interesting to see your timings for culling and sorting and rendering separately</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Simple 2D With Stage3D by jackson</title>
		<link>http://jacksondunstan.com/articles/1706/comment-page-1#comment-29603</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Sat, 12 May 2012 21:04:06 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=1706#comment-29603</guid>
		<description>Yes, the &lt;code&gt;BitmapData&lt;/code&gt; has transparency but the test app is not displaying it differently than the opaque ones. To display it with transparency is a little more complicated than I wanted to go into with this article since it would involve sorting the sprites by distance/layer and setting the blend mode of the &lt;code&gt;Context3D&lt;/code&gt;. It&#039;s a good idea though for a future article. :)</description>
		<content:encoded><![CDATA[<p>Yes, the <code>BitmapData</code> has transparency but the test app is not displaying it differently than the opaque ones. To display it with transparency is a little more complicated than I wanted to go into with this article since it would involve sorting the sprites by distance/layer and setting the blend mode of the <code>Context3D</code>. It&#8217;s a good idea though for a future article. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Simple 2D With Stage3D by indream</title>
		<link>http://jacksondunstan.com/articles/1706/comment-page-1#comment-29546</link>
		<dc:creator>indream</dc:creator>
		<pubDate>Sat, 12 May 2012 06:20:12 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=1706#comment-29546</guid>
		<description>but it show the black background when click &quot;add transparent bitmap&quot;</description>
		<content:encoded><![CDATA[<p>but it show the black background when click &#8220;add transparent bitmap&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Simple 2D With Stage3D by jackson</title>
		<link>http://jacksondunstan.com/articles/1706/comment-page-1#comment-29365</link>
		<dc:creator>jackson</dc:creator>
		<pubDate>Thu, 10 May 2012 16:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=1706#comment-29365</guid>
		<description>Transparent &lt;code&gt;BitmapData&lt;/code&gt; supports an alpha channel for transparent and semi-transparent pixels. You can create one by passing &lt;code&gt;true&lt;/code&gt; for the third parameter of the constructor:

&lt;pre lang=&quot;actionscript3&quot;&gt;
bmd = new BitmapData(width, height, true); // transparent (i.e. alpha supported)
bmd = new BitmapData(width, height, false); // opaque
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Transparent <code>BitmapData</code> supports an alpha channel for transparent and semi-transparent pixels. You can create one by passing <code>true</code> for the third parameter of the constructor:</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;">bmd = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">BitmapData</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">width</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">height</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// transparent (i.e. alpha supported)</span>
bmd = <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">BitmapData</span><span style="color: #000000;">&#40;</span><span style="color: #004993;">width</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #004993;">height</span><span style="color: #000066; font-weight: bold;">,</span> <span style="color: #0033ff; font-weight: bold;">false</span><span style="color: #000000;">&#41;</span><span style="color: #000066; font-weight: bold;">;</span> <span style="color: #009900; font-style: italic;">// opaque</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>Comment on Simple 2D With Stage3D by indream</title>
		<link>http://jacksondunstan.com/articles/1706/comment-page-1#comment-29358</link>
		<dc:creator>indream</dc:creator>
		<pubDate>Thu, 10 May 2012 13:43:40 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=1706#comment-29358</guid>
		<description>what‘s the difference between opaque and transparent bitmap?</description>
		<content:encoded><![CDATA[<p>what‘s the difference between opaque and transparent bitmap?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Sorted Array by skyboy</title>
		<link>http://jacksondunstan.com/articles/1848/comment-page-1#comment-29178</link>
		<dc:creator>skyboy</dc:creator>
		<pubDate>Wed, 09 May 2012 00:57:37 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=1848#comment-29178</guid>
		<description>Actually, the VM allocates Atoms (a word-aligned pointer with additional data stored in the low 3 bits), which are always 8 bytes on 64-bit machines (I had to do a bit of research to find out exactly how they were declaring it and what the end result was), to store ints/uints under 30 bits (even on 64 bit machines); once a value requires the 30th bit or higher, a Number is allocated to hold the value.

Also, due to the bug with */Number, you may be allocating up to 4x more memory for numeric types that won&#039;t be collected immediately.
However, it may be possible to store the type as Object instead of * (but the value assigned to the Object-variable must be * if it is to be numeric) and avoid potential allocation killers while doing the comparisons. Doing so will lose the ability to distinguish between undefined and null while sorting, but you can increase performance by special-casing this (currently, undefined and null are converted to Strings before comparing).

It would be nice if the subtle performance killers didn&#039;t exist and no one needed to know the exact operations of the VM to avoid the pitfalls and potential pitfalls.</description>
		<content:encoded><![CDATA[<p>Actually, the VM allocates Atoms (a word-aligned pointer with additional data stored in the low 3 bits), which are always 8 bytes on 64-bit machines (I had to do a bit of research to find out exactly how they were declaring it and what the end result was), to store ints/uints under 30 bits (even on 64 bit machines); once a value requires the 30th bit or higher, a Number is allocated to hold the value.</p>
<p>Also, due to the bug with */Number, you may be allocating up to 4x more memory for numeric types that won&#8217;t be collected immediately.<br />
However, it may be possible to store the type as Object instead of * (but the value assigned to the Object-variable must be * if it is to be numeric) and avoid potential allocation killers while doing the comparisons. Doing so will lose the ability to distinguish between undefined and null while sorting, but you can increase performance by special-casing this (currently, undefined and null are converted to Strings before comparing).</p>
<p>It would be nice if the subtle performance killers didn&#8217;t exist and no one needed to know the exact operations of the VM to avoid the pitfalls and potential pitfalls.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Sorted Array by skyboy</title>
		<link>http://jacksondunstan.com/articles/1848/comment-page-1#comment-29173</link>
		<dc:creator>skyboy</dc:creator>
		<pubDate>Tue, 08 May 2012 23:53:59 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=1848#comment-29173</guid>
		<description>Gah. One of int&#124;uint&#124;Number.</description>
		<content:encoded><![CDATA[<p>Gah. One of int|uint|Number.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Sorted Array by skyboy</title>
		<link>http://jacksondunstan.com/articles/1848/comment-page-1#comment-29172</link>
		<dc:creator>skyboy</dc:creator>
		<pubDate>Tue, 08 May 2012 23:53:01 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=1848#comment-29172</guid>
		<description>You can use an Object-typed variable and get nearly equal speeds to a Vector-typed variable. The constructor property can also be used to ensure it&#039;s a Vector that isn&#039;t a numeric-typed Vector (&lt;code&gt;constructor&lt;/code&gt; is always Vector.&lt;*&gt; or one of .&lt;int&#124;uint&#124;Number&gt;).</description>
		<content:encoded><![CDATA[<p>You can use an Object-typed variable and get nearly equal speeds to a Vector-typed variable. The constructor property can also be used to ensure it&#8217;s a Vector that isn&#8217;t a numeric-typed Vector (<code>constructor</code> is always Vector.&lt;*&gt; or one of .&lt;int|uint|Number&gt;).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Sorted Array by Erik</title>
		<link>http://jacksondunstan.com/articles/1848/comment-page-1#comment-29151</link>
		<dc:creator>Erik</dc:creator>
		<pubDate>Tue, 08 May 2012 20:46:06 +0000</pubDate>
		<guid isPermaLink="false">http://jacksondunstan.com/?p=1848#comment-29151</guid>
		<description>Thanks for the reply.  I have this post flagged in some old code of mine which is relevant:

http://stackoverflow.com/questions/3607593/is-it-faster-to-add-to-a-collection-then-sort-it-or-add-to-a-sorted-collection</description>
		<content:encoded><![CDATA[<p>Thanks for the reply.  I have this post flagged in some old code of mine which is relevant:</p>
<p><a href="http://stackoverflow.com/questions/3607593/is-it-faster-to-add-to-a-collection-then-sort-it-or-add-to-a-sorted-collection" rel="nofollow">http://stackoverflow.com/questions/3607593/is-it-faster-to-add-to-a-collection-then-sort-it-or-add-to-a-sorted-collection</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

