<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Promethe's Blog</title>
	<atom:link href="http://blog.promethe.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.promethe.net</link>
	<description>Web, RIAs and chocolate spaghettis...</description>
	<lastBuildDate>Tue, 29 Jun 2010 09:24:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>funanbulle, our #air24h application!</title>
		<link>http://blog.promethe.net/2010/06/24/funanbulle-our-air24h-application/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=funanbulle-our-air24h-application</link>
		<comments>http://blog.promethe.net/2010/06/24/funanbulle-our-air24h-application/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 15:10:16 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[Aerys]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[AIR 2.0]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[Minko]]></category>
		<category><![CDATA[RIA]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=836</guid>
		<description><![CDATA[The Adobe 24H Challenge was last friday and the application the 14 teams created are already online. You can see all the available applications on the official website. Our application is called "funanbulle". The goal of the application is to allow families to create their own micro virtual world and gather. We wanted to show [...]]]></description>
			<content:encoded><![CDATA[<p>The Adobe 24H Challenge was last friday and the application the 14 teams created are already online. You can see all the available applications on <a href="http://www.adobeairchallenge.com" target="_blank">the official website</a>.</p>
<p>Our application is called "funanbulle". The goal of the application is to allow families to create their own micro virtual world and gather. We wanted to show what such virtual worlds would look like. The idea was to enable people to share and chat in real time with a fun and engaging user experience.</p>
<div id="attachment_865" class="wp-caption aligncenter" style="width: 642px"><img class="size-full wp-image-865 " title="funanbulle_ingame" src="http://blog.promethe.net/wp-content/uploads/2010/06/funanbulle_ingame.jpg" alt="" width="632" height="452" /><p class="wp-caption-text">funanbulle, Aerys&#39; #air24h challenge contribution</p></div>
<p style="text-align: center;">
<p>The application is nothing more than a proof of concept. If we had enough time, we would have added lots of feature like:</p>
<ul>
<li>Audio chat</li>
<li>Photos and videos sharing</li>
<li>Interactive objects to trigger applications (games, sharing applications, etc...)</li>
</ul>
<p>In the end, we had just enough time to build a 3D chat. But I think it was a lot of fun and it looks really nice! Here is a quick video to show what funanbulle is about and how it works:</p>
<p><center><br />
<object width="400" height="250"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=12924419&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=12924419&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="250"></embed></object><br />
</center></p>
<p>This video was made by <a href="http://codemoiunmouton.wordpress.com/" target="_blank">Michael Chaize</a> to show the 14 applications created during the contest.</p>
<p><span id="more-836"></span></p>
<p>To install the application, just click on the following picture to go to the install badge:</p>
<p><a rel="shadowbox;width=400;height=300;background=#ffffff" href="http://www.adobeairchallenge.com/applications/install/?teamid=1&amp;appliName=FUNANBULLE&amp;appliUrl=aerys-funanbulle.air&amp;appliBadge=badge-aerys.jpg" target="_blank"><img class="aligncenter size-full wp-image-854" title="funanbulle_badge" src="http://blog.promethe.net/wp-content/uploads/2010/06/funanbulle_badge.jpg" alt="" width="217" height="130" /></a></p>
<p>When the application starts, you will be asked to "join" or "create" a room:</p>
<p><img class="aligncenter size-full wp-image-858" title="funanbulle_menu" src="http://blog.promethe.net/wp-content/uploads/2010/06/funanbulle_menu.jpg" alt="" width="632" height="452" /></p>
<ul>
<li>If you don't have a room number: select "create a room" to create a new room. When the room is created, you'll join in automatically join it. The room number will be visible in the top right corner. You can share it with your friends and family to enable them joining your room.</li>
<li>If you have a room number (because a friend already created a room and gave you its number for example): select "join a room", type your room number and click "Go". And voilà!</li>
</ul>
<p>You can use the bottom text input to chat with your friends. But you can also launch special actions by typping one of the following commands:</p>
<ul>
<li>/jump</li>
<li>/wait</li>
<li>/sit</li>
<li>/use</li>
<li>/wave</li>
</ul>
<p>We hope you'll like it and have fun with it!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2010/06/24/funanbulle-our-air24h-application/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>#air24h Challenge: First Video!</title>
		<link>http://blog.promethe.net/2010/06/22/air24h-challenge-first-video/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=air24h-challenge-first-video</link>
		<comments>http://blog.promethe.net/2010/06/22/air24h-challenge-first-video/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 12:42:09 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[Aerys]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[AIR]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=831</guid>
		<description><![CDATA[Here is the very first video (in French) of the Aerys team during the Adobe AIR 24H Challenge that took place last week. The first half of the video was shot only 2 hours after the begining of the contest. The 2nd half was shot only a few hours before the end of the event... [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the very first video (in French) of the Aerys team during the Adobe AIR 24H Challenge that took place last week. The first half of the video was shot only 2 hours after the begining of the contest. The 2nd half was shot only a few hours before the end of the event...</p>
<p><center><br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="225" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=12729060&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="225" src="http://vimeo.com/moogaloop.swf?clip_id=12729060&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a href="http://vimeo.com/12729060">Adobe AIR Challenge : interview equipe AERYS</a> from <a href="http://vimeo.com/user880002">michael chaize</a> on <a href="http://vimeo.com">Vimeo</a>.<br />
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2010/06/22/air24h-challenge-first-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash 10.1 is out!</title>
		<link>http://blog.promethe.net/2010/06/10/flash-10-1-is-out/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=flash-10-1-is-out</link>
		<comments>http://blog.promethe.net/2010/06/10/flash-10-1-is-out/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 19:09:31 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash 10.1]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=815</guid>
		<description><![CDATA[You can download it from the Adobe website: http://get.adobe.com/fr/flashplayer/.]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-818" title="flashplayer_100x100" src="http://blog.promethe.net/wp-content/uploads/2010/06/flashplayer_100x100.jpg" alt="" width="100" height="100" /></p>
<p>You can download it from the Adobe website: <a href="http://get.adobe.com/fr/flashplayer/" target="_blank">http://get.adobe.com/fr/flashplayer</a>/.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2010/06/10/flash-10-1-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Please support Aerys for the Adobe AIR 24H Challenge</title>
		<link>http://blog.promethe.net/2010/06/10/please-support-aerys-for-the-adobe-air-24h-challenge/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=please-support-aerys-for-the-adobe-air-24h-challenge</link>
		<comments>http://blog.promethe.net/2010/06/10/please-support-aerys-for-the-adobe-air-24h-challenge/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 14:15:10 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[Aerys]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[AIR]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=810</guid>
		<description><![CDATA[That's it! The challenge is on, every challenger knows his opponents... In 8 days, we will unleash Minko and our secret project to conquer the world... or at least the Flash platform! In the meantime, we need you! YES, YOU! Our team needs supporters, and you can help up by simply clicking on the above [...]]]></description>
			<content:encoded><![CDATA[<p>That's it! The challenge is on, every challenger knows his opponents... In 8 days, we will unleash Minko and our secret project to conquer the world... or at least the Flash platform!</p>
<p><a href="http://bit.ly/chrxsV" target="_blank"><img class="aligncenter size-full wp-image-811" title="aerys_needs_you" src="http://blog.promethe.net/wp-content/uploads/2010/06/aerys_needs_you.jpg" alt="" width="400" height="569" /></a></p>
<p>In the meantime, we need you! YES, YOU! Our team needs supporters, and you can help up by simply clicking on the above picture or <a href="http://bit.ly/chrxsV" target="_blank">here</a>. You will then be asked to log into your Facebook account to show just how much you love us and you want us to win!</p>
<p>Thank you all for your help. I just want you to know we are setting up for a great show!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2010/06/10/please-support-aerys-for-the-adobe-air-24h-challenge/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pixel shader demo using Flash 10, Pixel Bender and Minko</title>
		<link>http://blog.promethe.net/2010/06/09/pixel-shader-demo-using-flash-10-pixel-bender-and-minko/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=pixel-shader-demo-using-flash-10-pixel-bender-and-minko</link>
		<comments>http://blog.promethe.net/2010/06/09/pixel-shader-demo-using-flash-10-pixel-bender-and-minko/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 12:42:47 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[Aerys]]></category>
		<category><![CDATA[Minko]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Flash 10]]></category>
		<category><![CDATA[Flash 10.1]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=770</guid>
		<description><![CDATA[I'm really excited to announce Minko (which is, by the way, the final name for my 3D library) has reached a new level: pixel shader integration! Pixel shaders are little programs that run on each pixel and can modify their final color. They are often written in C-like languages and in this precise case we [...]]]></description>
			<content:encoded><![CDATA[<p>I'm really excited to announce Minko (which is, by the way, the final name for my 3D library) has reached a new level: pixel shader integration! Pixel shaders are little programs that run on each pixel and can modify their final color. They are often written in C-like languages and in this precise case we use Pixel Bender, the shader language introduced with Flash 10.</p>
<p>In this post I will:</p>
<ul>
<li>Explain how any 3D scene is built when using Minko</li>
<li>Explain how pixel shaders are integrated in the 3D scene</li>
<li>Explain how pixel shaders are built using Pixel Bender</li>
<li>Show you a very simple demo of the kind of effects pixel shaders will provide</li>
<li>Explain how the demo was built</li>
</ul>
<p>Here are a two screenshots to show the results:</p>
<div id="attachment_824" class="wp-caption aligncenter" style="width: 650px"><a href="http://blog.promethe.net/wp-content/uploads/2010/06/minko_lamborghini.jpg" rel="shadowbox[post-770];player=img;"><img class="size-full wp-image-824 " title="minko_lamborghini" src="http://blog.promethe.net/wp-content/uploads/2010/06/minko_lamborghini.jpg" alt="" width="640" height="360" /></a><p class="wp-caption-text">Phong shading + spheric environment mapping on a 2700+ polygons Lamborghini</p></div>
<div id="attachment_782" class="wp-caption aligncenter" style="width: 508px"><a href="http://blog.promethe.net/wp-content/uploads/2010/06/minko_phong_1.jpg" rel="shadowbox[post-770];player=img;"><img class="size-full wp-image-782 " title="minko_phong_1" src="http://blog.promethe.net/wp-content/uploads/2010/06/minko_phong_1.jpg" alt="" width="498" height="373" /></a><p class="wp-caption-text">Phong shading + spheric environment mapping demo</p></div>
<p><span id="more-770"></span></p>
<h4>The Scene Graph API</h4>
<p>This API is used to build and manage the 3D scene. Scene graph is the most common data-structure used to build 3D scenes. It is simple to understand and both memory wise and CPU efficient. To explain what the scene graph is, start thinking about Flash's display list. In ActionScript 3.0, the display list is actually a tree. The root of the tree is the Stage and you can add multiple children to it. Each child can be a leaf, such as a Bitmap object, or a container such as a Sprite. One of the limitations of a tree is that every node can have multiple children but each child can have only one parent. This property is what makes it look like a tree: branches (and leaves for that matter...) have only one parent branch.</p>
<p>A direct consequence of that paradigm is that if you want 20 red circles, you will have to create 20 red circles and add them to the display tree. Despite the fact that those 20 red circles will be exactly the same you will still have to create and add all of them to the display tree. Thus, you will use 19 times more memory than what is actually needed. That's where the graph kicks in...</p>
<p>A graph is just like a tree except every node can have multiple parents. You can see graphs as a generalization of trees. But you can also say that trees are particular graphs where each node can have only one parent. Anyway, we can now create one red circle and use it as many times as we need! To understand how this apply to a 3D scene, lets consider the following rendering:</p>
<p><a href="http://blog.promethe.net/wp-content/uploads/2010/06/minko_scene_graph_demo.jpg" rel="shadowbox[post-770];player=img;"><img class="aligncenter size-full wp-image-771" title="minko_scene_graph_demo" src="http://blog.promethe.net/wp-content/uploads/2010/06/minko_scene_graph_demo.jpg" alt="" width="413" height="308" /></a></p>
<p>And here is the corresponding scene graph:</p>
<p><a href="http://blog.promethe.net/wp-content/uploads/2010/06/minko_scene_graph.jpg" rel="shadowbox[post-770];player=img;"><img class="aligncenter size-medium wp-image-786" title="minko_scene_graph" src="http://blog.promethe.net/wp-content/uploads/2010/06/minko_scene_graph-300x176.jpg" alt="" width="300" height="176" /></a></p>
<p>There are five things to notice:</p>
<ol>
<li>The figure doesn't show the whole graph (I removed the camera and materials).</li>
<li><strong>The Scene Graph API is all about interfaces</strong>. You can add new features to the API and still extend the classes you need/want (ie. EventDispatcher).</li>
<li>The CubeMesh.cubeMesh, SquareMesh.squareMesh and SphereMesh.sphereMesh nodes, which contain the primitives geometry, exist only once each but are used by many IDisplayObject3D. Therefore there is <strong>no useless memory consumption</strong>! The same can be done with any node in the graph: containers, display objects, materials, etc...</li>
<li>The orange circled <strong>nodes apply a (3D) transformation to their children</strong>, just like Flash containers apply (2D) transformations to their own children.</li>
<li><strong>Z-Sorting is here enabled by two different technics</strong>: the <strong>drawing order</strong> (which is pretty much the same as in a classic-2D-Flash display tree) and the <strong>DepthSortContainer3D</strong> node. This node takes care of z-sorting by sorting its children using their average depth. This way, <strong>z-sorting occurs only when needed</strong> and only on relevant geometry.</li>
</ol>
<p>There a lot to explain about the Scene Graph API! But the main point is to understand how it compares to Flash's display tree and what benefits it provides: <strong>lower memory consumption and powerful scene building</strong>. You are likely to need to find a way to fit in the Scene Graph API anytime you want to extend Minko to add a new feature. In this precise case I will talk about how pixel shaders fits in.</p>
<h4>Pixel shader integration</h4>
<p>The first step is to find "where" in the graph your new feature will be used. Close to the scene "root" you will more likely find containers. And the "leaves" are often more tangible objects such as a materials or meshes. A pixel shader is some kind of a material so that's where we should start looking!</p>
<p>In the Scene Graph API, there is a special way to handle materials: the "<strong>material stack</strong>". It's a part of the graph - a subgraph really - that looks very much like a stack because every node uses an "underlaying" material node. Lets consider the orange box from the previous example:</p>
<p><a href="http://blog.promethe.net/wp-content/uploads/2010/06/minko_scene_graph_material.jpg" rel="shadowbox[post-770];player=img;"><img class="aligncenter size-full wp-image-790" title="minko_scene_graph_material" src="http://blog.promethe.net/wp-content/uploads/2010/06/minko_scene_graph_material.jpg" alt="" width="424" height="348" /></a></p>
<p>This figure shows the orange cube subgraph. On this graph I added the material nodes to demonstrate how the material stack works. In this precise case, the stack is made of a WireframeMaterial node and a SolidMaterial node. The first one provides a wireframe rendering and the second one is a solid fill. When rendering, <strong>the resulting graphics operations will be the list of all the graphics instructions outputed by each node of the stack</strong>. Thus, we will here obtain an (orange) solid fill with a (purple) wireframe. So where does the pixel shader fits in the material stack? Well you might have noticed there are two different kinds of nodes in the material stack:</p>
<ol>
<li>the bottom of the stack is more likely to be a "<strong>base material</strong>", like a solid fill or a texture</li>
<li>and the rest of the stack will be mainly "<strong>modifiers</strong>". In the case of the orange cube, the WireframeMaterial node acts as a modifier for the SolidMaterial node</li>
</ol>
<p><strong>Our pixel shader material will be a modifier</strong> because it will work on an underlaying texture. Now we know our pixel shader material should be on the top of the material stack we have to know what data it needs and how to provide it!</p>
<h4>Pixel shader creation using Pixel Bender</h4>
<p>A pixel shader works at the pixel level (true story). Therefore, <strong>we need per-pixel data</strong>. But because we use Flash's drawing API we don't have a direct access to the actual pixels (I'm oversimplifying but that's the idea). The trick is to <strong>work on the material BitmapData itself rather than the screen pixels</strong>. Thus, I will now talk about "<strong>texels</strong>" (texture pixels) rather than pixels (so I guess it should be called a "texel shader" then...). Anyway, <strong>our shader will then most certainly always need three inputs</strong>:</p>
<ol>
<li>The color of each texel, also called a "<strong>diffuse map</strong>" or... a texture. Any material will do the trick (we can get a BitmapData out of any material).</li>
<li>The position of each texel, also called a "<strong>position map</strong>".</li>
<li>The normal of each texel, also called a "<strong>normal map</strong>".</li>
</ol>
<p>The position map will be generated at runtime. It is mainly a BitmapData where <strong>each pixel stores the (x, y, z) values of the position</strong> of the corresponding texel instead of an (r, g, b) color value. The normal map can be generated at runtime. It can also be any material as long as it provides a relevant BitmapData. This BitmapData stores <strong>the (nx, ny, nz) values of the normal</strong> of the corresponding texel. Here is an example:</p>
<p><a href="http://blog.promethe.net/wp-content/uploads/2010/06/minko_maps_generation.jpg" rel="shadowbox[post-770];player=img;"><img class="aligncenter size-medium wp-image-777" title="minko_maps_generation" src="http://blog.promethe.net/wp-content/uploads/2010/06/minko_maps_generation-300x85.jpg" alt="" width="300" height="85" /></a></p>
<p>In this example both the normal and the position maps have been generated using Minko's NormalMap and PositionMap classes. This picture is actually a screenshot of a demo Flash application. I wont talk too much about this generation step for now, but its done using Pixel Bender and its lighting fast!</p>
<p>In order to make this data available to any pixel shader, the diffuse, normal and position maps are stored in a one-and-only scene graph node: the <strong>PixelMaterial</strong>. This node will then provide <strong>per-texel data access</strong> to its modifiers. We can now implement a real pixel shader on top of any PixelMaterial! Everything we need now is a <strong>Pixel Bender kernel that takes our 3 maps (diffuse, position and normal) in input</strong>.</p>
<p>The following Pixel Bender filter performs <a href="http://en.wikipedia.org/wiki/Phong_shading" target="_blank">Phong shading</a>:</p>

<div class="wp_syntax"><div class="code"><pre class="pixelbender" style="font-family:monospace;"><span style="color: #0033ff;">void</span>
<span style="color: #0033ff; font-weight: bold;">evaluatePixel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
        <span style="color: #0033ff;">float2</span> o <span style="color: #000000; font-weight: bold;">=</span> <span style="color: #333333;">outCoord</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;
        <span style="color: #0033ff;">float3</span> position <span style="color: #000000; font-weight: bold;">=</span> <span style="color: #333333;">sampleNearest</span><span style="color: #000000;">&#40;</span>positionMap, o<span style="color: #000000;">&#41;</span>;
        <span style="color: #0033ff;">float3</span> normal <span style="color: #000000; font-weight: bold;">=</span> <span style="color: #333333;">sampleNearest</span><span style="color: #000000;">&#40;</span>normalMap, o<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> 2. <span style="color: #000000; font-weight: bold;">-</span> ONE;
        <span style="color: #0033ff;">float3</span> light <span style="color: #000000; font-weight: bold;">=</span> <span style="color: #333333;">normalize</span><span style="color: #000000;">&#40;</span>light <span style="color: #000000; font-weight: bold;">-</span> position<span style="color: #000000;">&#41;</span>;
&nbsp;
        <span style="color: #009900;">// ambient</span>
        <span style="color: #0033ff;">float</span> l <span style="color: #000000; font-weight: bold;">=</span> ambient <span style="color: #000000; font-weight: bold;">*</span> intensity;
&nbsp;
        <span style="color: #009900;">// diffuse</span>
        l <span style="color: #000000; font-weight: bold;">+=</span> <span style="color: #333333;">max</span><span style="color: #000000;">&#40;</span>0., <span style="color: #333333;">dot</span><span style="color: #000000;">&#40;</span>light, normal<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> diffuse <span style="color: #000000; font-weight: bold;">*</span> intensity;
&nbsp;
        dst <span style="color: #000000; font-weight: bold;">=</span> <span style="color: #333333;">sampleNearest</span><span style="color: #000000;">&#40;</span>diffuseMap, o<span style="color: #000000;">&#41;</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #0033ff;">float4</span><span style="color: #000000;">&#40;</span>l, l, l, 1.<span style="color: #000000;">&#41;</span>;
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>As you can see its really straight forward. This is due to the Scene Graph API which makes it possible to <strong>do every computation in local space</strong>. Therefore we don't have to care about where those computations happen in the 3D scene.</p>
<h4>Demo</h4>
<p><a href="http://en.wikipedia.org/wiki/Phong_shading" target="_blank">Phong shading</a> or <a href="http://en.wikipedia.org/wiki/Reflection_mapping" target="_blank">reflection mapping</a> are great examples of pixel shaders. The following demo uses both (the white diamond stands for the light source):</p>
<div id="attachment_779" class="wp-caption aligncenter" style="width: 648px"><a href="http://blog.promethe.net/wp-content/uploads/2010/06/PixelShaderDemo.swf" rel="shadowbox[post-770];width=640;height=385;"><img class="size-full wp-image-779 " title="minko_phong_cubic" src="http://blog.promethe.net/wp-content/uploads/2010/06/minko_phong_cubic.jpg" alt="" width="638" height="359" /></a><p class="wp-caption-text">Phong shading + spheric environment mapping demo</p></div>
<div id="attachment_797" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.promethe.net/wp-content/uploads/2010/06/minko_scene_graph_phong_spheric.jpg" rel="shadowbox[post-770];player=img;"><img class="size-medium wp-image-797 " title="minko_scene_graph_phong_spheric" src="http://blog.promethe.net/wp-content/uploads/2010/06/minko_scene_graph_phong_spheric-300x229.jpg" alt="" width="300" height="229" /></a><p class="wp-caption-text">Phong shading + spheric environment mapping scene graph</p></div>
<p style="text-align: left;">And to put it in a nutshell, a few performances considerations:</p>
<ul>
<li>Everything is done in <strong>real time</strong>.</li>
<li>Thanks to the Scene Graph API, <strong>every computation is done in local space</strong>. It avoids matrix multiplications by the thousand and gives a significant performance boost.</li>
<li>The application takes <strong>less than 20Mb of memory</strong> and weights less than 100Kb.</li>
<li>There are a total of <strong>6 pixel shaders run at each frame</strong> (only the visible faces materials are computed and there are 2 shaders per face).</li>
<li>Those shaders work on <strong>128*128 pixels diffuse/normal/position maps</strong></li>
<li>That's a total of <strong>98,304 pixels per frame</strong></li>
<li>Each frame is <strong>"processed" in an average of 10ms.</strong> (Core2 Duo U9400 @ 1.4Ghz, Flash 10.1 RC7, Chrome 5)</li>
<li>That's <strong>9,830,400 pixels per second!</strong></li>
<li>There is a <strong>~30% performance boost with Flash 10.1 RC7</strong></li>
<li><strong>The number of triangles does not impact the performances</strong></li>
<li>Do not hesitate to post your own results (with your configuration of course)! <img src='http://blog.promethe.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </li>
</ul>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2010/06/09/pixel-shader-demo-using-flash-10-pixel-bender-and-minko/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Aerys joins the 24H Adobe AIR Challenge</title>
		<link>http://blog.promethe.net/2010/06/04/aerys-joins-the-24h-adobe-air-challenge/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=aerys-joins-the-24h-adobe-air-challenge</link>
		<comments>http://blog.promethe.net/2010/06/04/aerys-joins-the-24h-adobe-air-challenge/#comments</comments>
		<pubDate>Fri, 04 Jun 2010 11:42:25 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Aerys]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[AIR 2.0]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=751</guid>
		<description><![CDATA[The 24H Adobe AIR Challenge is a 24 hours long contest that will take place the 18th of June in Paris, France. During this coding challenge, 15 teams of two people will have to build the best AIR application regarding a precise subject. This very subject will be unveiled as the competition starts. The challenge [...]]]></description>
			<content:encoded><![CDATA[<p><center><br />
<object data="http://www.adobeairchallenge.com/ed/decompte/swf/decompte.swf" name="air_decompte" id="air_decompte" type="application/x-shockwave-flash" height="80" width="230"><param value="false" name="menu"><param value="always" name="allowScriptAccess"></object><br />
</center><br />
</p>
<p>The 24H Adobe AIR Challenge is a 24 hours long contest that will take place the 18th of June in Paris, France.</p>
<p>During this coding challenge, 15 teams of two people will have to build the best AIR application regarding a precise subject. This very subject will be unveiled as the competition starts.</p>
<p>The challenge will be broadcasted live from <a href="http://www.adobeairchallenge.com/">http://www.adobeairchallenge.com/</a>.</p>
<p>Aerys is very proud to join the competition and we hope to see you there!</p>
<p>And here are a few useful links (in French) :</p>
<ul>
<li><a target="_blank" href="http://codemoiunmouton.wordpress.com/2010/05/31/candidat-pour-24h-de-coding/">Code Moi Un Mouton - Candidat pour 24h de coding ?</a></li>
<li><a target="_blank" href="http://twitter.com/air24h">Official 24H Adobe AIR Challenge twitter</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2010/06/04/aerys-joins-the-24h-adobe-air-challenge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Video of the Minko presentation at the TTFX barcamp</title>
		<link>http://blog.promethe.net/2010/06/01/video-of-the-minko-presentation-at-the-ttfx-barcamp/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=video-of-the-minko-presentation-at-the-ttfx-barcamp</link>
		<comments>http://blog.promethe.net/2010/06/01/video-of-the-minko-presentation-at-the-ttfx-barcamp/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 12:42:12 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[barcamp]]></category>
		<category><![CDATA[Minko]]></category>
		<category><![CDATA[Tontons Flexeurs]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=747</guid>
		<description><![CDATA[Here is a link to my first official presentation of Minko, the 3D library I am working on (and which was previously called "DirectFlex"): This video was shot the 23rd of March by the people from BAAO. A very big thank you to Yann Chevalier, who's leading the TTFX effort, Michael Chaize, our awesome french [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a link to my first official presentation of Minko, the 3D library I am working on (and which was previously called "DirectFlex"):</p>
<p><a href="http://www.baao.com/Video/Minko_3D.html" target="_blank"><img class="aligncenter size-full wp-image-748" title="minko_ttfx_20090323" src="http://blog.promethe.net/wp-content/uploads/2010/05/minko_ttfx_20090323.jpg" alt="" width="600" height="340" /></a></p>
<p>This video was shot the 23rd of March by the people from BAAO. A very big thank you to Yann Chevalier, who's leading the TTFX effort, Michael Chaize, our awesome french Flash platform evangelist and Olivier from BAAO who gave me the link to the video.</p>
<p>You can find the slides <a href="http://promethe.net/slides/ttfx_minko_20100323.pdf" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2010/06/01/video-of-the-minko-presentation-at-the-ttfx-barcamp/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Flash 10.1 gets a release date</title>
		<link>http://blog.promethe.net/2010/04/30/flash-10-1-gets-a-release-date/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=flash-10-1-gets-a-release-date</link>
		<comments>http://blog.promethe.net/2010/04/30/flash-10-1-gets-a-release-date/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 09:49:55 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash 10.1]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=734</guid>
		<description><![CDATA[In reaction to Steve Jobs' latest outrageous declarations, Kevin Lynch himself announced the release date of Flash 10.1 for Android devices: "We look forward to delivering Flash Player 10.1 for Android smartphones as a public preview at Google I/O in May, and then a general release in June. From that point on, an ever increasing [...]]]></description>
			<content:encoded><![CDATA[<p>In reaction to <a href="http://www.apple.com/hotnews/thoughts-on-flash/" target="_blank">Steve Jobs' latest outrageous declarations</a>, Kevin Lynch himself announced the release date of Flash 10.1 for Android devices:</p>
<p><em>"We look forward to delivering Flash Player 10.1 for Android  smartphones as a public preview at Google I/O in May, and then a  general release in June. From that point on, an ever increasing number  and variety of powerful, Flash-enabled devices will be arriving which  we hope will provide a great landscape of choice."</em></p>
<p>You can read is full post here : <a href="http://blogs.adobe.com/conversations/2010/04/moving_forward.html" target="_blank">Moving Forward</a>.</p>
<p>From what I'e heard from Adobe so far, Flash 10.1 for the desktop <strong>should</strong> be released before the Android version. Meaning we can expect Flash 10.1 desktop to be released in May...</p>
<p><strong><span style="color: #ff0000;">Update</span></strong>: In the following Wall Street Journal interview, Shantanu Narayen - Adobe's CEO - also comments Steve Jobs declarations and says <strong>Flash 10.1 will be released June 17th</strong> (3'10):</p>
<p><center><br />
<object id="wsj_fp" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="512" height="363" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="flashvars" value="videoGUID=5C074A32-B7A3-47EC-9B53-E7A8A5A04E49&amp;playerid=1000&amp;plyMediaEnabled=1&amp;configURL=http://wsj.vo.llnwd.net/o28/players/&amp;autoStart=false" /><param name="src" value="http://s.wsj.net/media/swf/main.swf" /><param name="name" value="main" /><param name="bgcolor" value="#FFFFFF" /><param name="allowfullscreen" value="true" /><embed id="wsj_fp" type="application/x-shockwave-flash" width="512" height="363" src="http://s.wsj.net/media/swf/main.swf" bgcolor="#FFFFFF" name="main" flashvars="videoGUID=5C074A32-B7A3-47EC-9B53-E7A8A5A04E49&amp;playerid=1000&amp;plyMediaEnabled=1&amp;configURL=http://wsj.vo.llnwd.net/o28/players/&amp;autoStart=false" allowscriptaccess="always" allowfullscreen="true"></embed></object><br />
</center></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2010/04/30/flash-10-1-gets-a-release-date/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash 10.1 RC2 released</title>
		<link>http://blog.promethe.net/2010/04/20/flash-10-1-rc2-released/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=flash-10-1-rc2-released</link>
		<comments>http://blog.promethe.net/2010/04/20/flash-10-1-rc2-released/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 10:40:18 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash 10.1]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=729</guid>
		<description><![CDATA[Flash 10.1 Release Candidate 2 is available on Adobe Labs: http://labs.adobe.com/downloads/flashplayer10.html]]></description>
			<content:encoded><![CDATA[<p><em><span style="font-style: normal;">Flash 10.1 Release Candidate 2 is available on Adobe Labs:</span></em></p>
<p><em><span style="font-style: normal;"><a href="http://labs.adobe.com/downloads/flashplayer10.html">http://labs.adobe.com/downloads/flashplayer10.html</a></span></em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2010/04/20/flash-10-1-rc2-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash 11 drawing API will be hardware accelerated</title>
		<link>http://blog.promethe.net/2010/04/19/flash-11-will-be-hardware-accelerated/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=flash-11-will-be-hardware-accelerated</link>
		<comments>http://blog.promethe.net/2010/04/19/flash-11-will-be-hardware-accelerated/#comments</comments>
		<pubDate>Mon, 19 Apr 2010 13:42:39 +0000</pubDate>
		<dc:creator>Promethe</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Flash 10.1]]></category>
		<category><![CDATA[hardware acceleration]]></category>

		<guid isPermaLink="false">http://blog.promethe.net/?p=724</guid>
		<description><![CDATA[I love catchy titles. I know nothing about the next major version of Flash and all of this is just speculations. Anyway, as the whole HTML5 versus Flash battle is raging, it appears Flash relatively poor performances are indeed criticizable at best. Beside poor developers, the Flash Platform suffers from a very very slow software [...]]]></description>
			<content:encoded><![CDATA[<p>I love catchy titles. I know nothing about the next major version of Flash and all of this is just speculations.</p>
<p>Anyway, as the whole HTML5 versus Flash battle is raging, it appears Flash relatively poor performances are indeed criticizable at best. Beside poor developers, the Flash Platform suffers from a very very slow software renderer. Or at least much slower than the rest of the platform. It's no secret: hardware acceleration is a key feature for the future of the Flash Player. It's even hard to believe it is not available yet!</p>
<p>As you must already know, Flash 10.1 will support OpenGL ES 2 on mobile devices to leverage the lack of CPU horsepower. While hardware HD video decoding will be available on the desktop too, the drawing API will only be accelerated on mobile devices.</p>
<p>Anyone knowing a bit about OpenGL ES knows it is a subset of OpenGL. Thus if it works with OpenGL ES, it <em>should</em> work with OpenGL. With this in mind, a few questions:</p>
<ol>
<li>Why isn't Flash 10.1 drawing API hardware accelerated on any OpenGL capable platform, including the desktop?</li>
<li>How will it work?</li>
<li>Will Pixel Bender be hardware accelerated?</li>
</ol>
<h4>1. Hardware Accelerated Desktop Flash Player</h4>
<p>Let's face it: there <strong>must be</strong> an hardware accelerated desktop Flash Player in the works. As I said previously, OpenGL supports all features of OpenGL ES so this is not far fetched at all. Yet, it is neither released nor announced. Why?</p>
<p>My first guess is OpenGL provides with a lot of features that would make the desktop experience a lot smoother than just using what offers its little brother OpenGL ES. So at some point Adobe had to make a choice :</p>
<ul>
<li>release a fully hardware accelerated Flash 10.1 on both mobile and desktop platforms, with the last one being very far from what desktop hardware is actually capable to handle</li>
<li>or release Flash 10.1 focusing on mobile devices and announce hardware acceleration for the desktop just after its the final release... and I'm guessing it might be a key feature of Flash 11</li>
</ul>
<p>When I was at the French Flash User Group (TTFX - les TonTons FleXeurs) a few months ago, I spoke with Lee Brimelow and Mike Chambers about the just announced microphone raw-data access. I asked them why it was announced only for AIR 2.0 and not Flash 10.1. The answer was something about the "quality guys" making sure the feature was well suited on both the roadmap and the logic of the incoming updates. And this feature eventually made its way into the Flash Player! I think that's what is happening with hardware acceleration on the desktop.</p>
<p>But if you don't believe me, you don't have to take my word for it! What about Adobe's word? Cnuuja, one of the engineer working on the Flash Player, posted this very message on the Flash 10.1 Forum:</p>
<p><a href="http://forums.adobe.com/message/2742943#2742943">Can OpenGL 3.3/4.0 improve Flash 10.x ?</a></p>
<p><em>"Yes....  with a lot of work.   We have spent the last year writing new code which allows OpenGLES2 to render flash content on mobile devices.  Performance varies significantly from one gpu to the next, with some gpus being slower than the software renderer.   What Flash does is significantly different from the 3d triangles+shaders GPUs were designed to support. </em><strong><em>Its a lot of work to make OGL/D3D usable as our renderer, but we're working on it <img src="http://wwwimages.adobe.com/www.adobe.com/adobeforums/images/emoticons/happy.gif" alt="" width="16px" height="16px" /></em></strong></p>
<p><em>-chris"</em></p>
<h4>2. How will it work?</h4>
<p>Just like in Flash 10.1 for mobile devices. But much faster thanks to OpenGL and Direct3D.</p>
<p>The internals of such feature is very important: developers must know and understand how it works to make the best out of it. <a href="http://www.adobe.com/devnet/flashplayer/articles/fplayer10.1_hardware_acceleration_05.html" target="_blank">Adobe already talked about how the drawing API is accelerated in Flash 10.1</a> on mobile devices:</p>
<p><em>"When a GPU renders vector graphics, it breaks them up into meshes made of small triangles before drawing them, a process called tesselating. There is a small cost to doing this, which increases as the complexity of the shape increases. To minimize performance impact, avoid morph shapes, which must be retesselated on every frame."</em></p>
<p>It's straight forward and I think it's actually the best (and only...) way to do it. Tesselation will create triangles by computing sets of vertices/indices (also called Vertex and Index Buffers) and push them to the graphics hardware. The end of the quote suggests such data is cached and should not be recomputed if no redraw occurs.</p>
<p>Something very important though: z-sorting. People might think hardware acceleration implies z-sorting. But it doesn't. When you know how 3D hardware and APIs work, you know it will be very tricky to make it work with something as general purpose as Flash. If Adobe wants to use the z-buffer, they will have to cut the compatibility with the software renderer. And I don't think this will happen anytime soon.</p>
<h4>3. Hardware Accelerated Pixel Bender</h4>
<p>Pixel Bender is already hardware accelerated pretty much everywhere except the Flash Platform. I'm not sure why. Still, it's hardware accelerated in other products of the Creative Suite so I guess that an OpenGL/Direct3D shader languages compliant intermediate represenation of Pixel Bender kernels does exist.</p>
<p>This said, it's just a matter of how to make it work with the very general purpose Flash Player. Considering Flash 10.1 is using tesselation, my guess is pixel shader should follow quite easily.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.promethe.net/2010/04/19/flash-11-will-be-hardware-accelerated/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
