<?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>Manuel&#039;s Coding Blog &#187; hydra</title>
	<atom:link href="http://manuel.bit-fire.com/category/dev/hydra/feed/" rel="self" type="application/rss+xml" />
	<link>http://manuel.bit-fire.com</link>
	<description></description>
	<lastBuildDate>Sun, 27 Jun 2010 12:35:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Compiz-like wobbling windows in AS3</title>
		<link>http://manuel.bit-fire.com/2008/09/04/compiz-like-wobbling-windows-in-as3/</link>
		<comments>http://manuel.bit-fire.com/2008/09/04/compiz-like-wobbling-windows-in-as3/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 19:01:09 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[c++]]></category>
		<category><![CDATA[dev]]></category>
		<category><![CDATA[hydra]]></category>
		<category><![CDATA[compiz]]></category>
		<category><![CDATA[effect]]></category>
		<category><![CDATA[wobble]]></category>
		<category><![CDATA[wobbling]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/?p=128</guid>
		<description><![CDATA[This code was intended to be released back in October last year, but i never managed to do it since it needed some refactoring, some changes and had to be quite decent to present: then in November i got the chance to work with some very talented guys over at Jooce, in Paris, so i]]></description>
			<content:encoded><![CDATA[<p>This code was intended to be released back in October last year, but i never managed to do it since it needed some refactoring, some changes and had to be quite decent to present: then in November i got the chance to work with some very talented guys over at <a title="Jooce! Try it, it's seriously cool!" href="http://jooce.com/">Jooce</a>, in Paris, so i never got back to write something about it.<br />
<em> Btw, if you never tried Jooce then give it a try, it really deserves it!</em><br />
<span id="more-128"></span><br />
While there, i used portions of this code to derive something from it and while working on that for some time i realized some key points for optimizations but i&#8217;m not going to share more details with you about that, since the NDA i agreed to sign doesn&#8217;t allow me to do that: i&#8217;ve to say this version is therefore unoptimized and proof-of-concept, especially for the real window drawings: in fact, i just did some cleanup before packaging it, but since i don&#8217;t plan to put some time on it sooner, better i publish it as-is, or it will lie on my disk for the next few months for sure.</p>
<p>The idea was to build the foundation for a fancy, compositing-based windowing system: beside the actual implementation that&#8217;s basically just <em>wobbling</em> the current target, i&#8217;m sure you&#8217;ll be able to come up with other effects as well, but that&#8217;s not the real point.<br />
Setting aside the concrete animator implementation that would be better to be used as a base to derive some more abstract definitions from it, the architecture is quite open to new approaches and ideas, especially for the ultra-simple opengl-like interface i chosen for the rasterizer that let&#8217;s you prototype things quite fast:</p>
<pre>
<pre class="brush: cpp;">
package rasterizer
{
	import flash.display.Sprite;
	import flash.display.BitmapData;
	import rasterizer.data.*;

	/**
	 * OpenGL-like interface for a generic rasterizer.
	 * The triangle is the only supported polygon right now
	 *
	 * More desc for me..
	 */
	public interface IRasterizer
	{
		function glTexture( tex: BitmapData, forceRecreate: Boolean = false, smooth: Boolean = false ): void;
		function glSetTarget( aTarget: Sprite ): void;

		function glBegin( rasterMode: int ): void;
		function glEnd(): void;

		function glPresent( aTarget: Sprite = null ): void;
	}

	/**
	 * OpenGL-like interface for a generic 2D rasterizer.
	 * The triangle is the only supported polygon right now
	 *
	 * More desc for me..
	 */
	public interface IRasterizer2D extends IRasterizer
	{
		function glVertex( vertex: Vertex2, uv: Vertex2 ): void;
	}

	/**
	 * OpenGL-like interface for a generic 3D rasterizer.
	 * The triangle is the only supported polygon right now
	 *
	 * More desc for me..
	 */
	public interface IRasterizer3D extends IRasterizer
	{
		function glVertex( vertex: Vertex3, uv: Vertex2 ): void;
	}
}
</pre>
</pre>
<p>Portions of the actual wobble animator took inspiration from the previous <a href="http://manuel.bit-fire.com/2007/08/10/the-magic-carpet/">Magic Carpet</a> demo and some stuff i found on the net: if you come up with some other effects let me know, i&#8217;ll be happy to link back to them!<br />
Here you can play with a basic demo i setup to try it out or get the <a title="AS3 Wobbling windows demo" href="http://manuel.bit-fire.com/code/wobble_webdemo.zip">source code</a> to do your own experiments:</p>

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
			id="fm_wobble_demo_1282783557"
			class="flashmovie"
			width="100%"
			height="480">
	<param name="movie" value="http://manuel.bit-fire.com/code/wobble_demo.swf" />
	<!--[if !IE]>-->
	<object	type="application/x-shockwave-flash"
			data="http://manuel.bit-fire.com/code/wobble_demo.swf"
			name="fm_wobble_demo_1282783557"
			width="100%"
			height="480">
	<!--<![endif]-->
		
	<!--[if !IE]>-->
	</object>
	<!--<![endif]-->
</object>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2008/09/04/compiz-like-wobbling-windows-in-as3/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Hydra considerations</title>
		<link>http://manuel.bit-fire.com/2007/10/03/hydra-considerations/</link>
		<comments>http://manuel.bit-fire.com/2007/10/03/hydra-considerations/#comments</comments>
		<pubDate>Wed, 03 Oct 2007 15:32:44 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[hydra]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[kernel filters]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/2007/10/03/hydra-considerations/</guid>
		<description><![CDATA[While experimenting with the AIF toolkit i noticed some glitches that could be taken into consideration by the AIF team before going final with the release: it seems that image-type function parameters are bound to the selected images according to their alphabetical order, instead of the natural user-defined one: for instance, create a new kernel]]></description>
			<content:encoded><![CDATA[<p>While experimenting with the AIF toolkit i noticed some glitches that could be taken into consideration by the AIF team before going final with the release:</p>
<ul>
<li> it seems that image-type function parameters are bound to the selected images according to their alphabetical order, instead of the natural user-defined one: for instance, create a new kernel as <a href="http://manuel.bit-fire.com/code/testfilter.hydra">here</a>, select two images and refresh; you should be now looking at the image you loaded via &#8220;Load Image 2&#8230;&#8221;: now rename &#8220;in image4 srca&#8221; to be &#8220;in image4 srcc&#8221; and refresh. Wrongly, you are now looking at the first image</li>
<li>the GUI doesn&#8217;t release cpu/gpu resources while minimized in order to relieve the machine from the rendering process</li>
</ul>
<p>Aside that, i&#8217;m looking forward to try all this cool stuff with <a href="http://labs.adobe.com/wiki/index.php/Astro">Astro</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2007/10/03/hydra-considerations/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hydra is here!</title>
		<link>http://manuel.bit-fire.com/2007/10/02/hydra-is-here/</link>
		<comments>http://manuel.bit-fire.com/2007/10/02/hydra-is-here/#comments</comments>
		<pubDate>Tue, 02 Oct 2007 15:12:20 +0000</pubDate>
		<dc:creator>Manuel</dc:creator>
				<category><![CDATA[hydra]]></category>
		<category><![CDATA[astro]]></category>
		<category><![CDATA[kernel filters]]></category>

		<guid isPermaLink="false">http://manuel.bit-fire.com/2007/10/02/hydra-is-here/</guid>
		<description><![CDATA[Finally the Adobe team released the Hydra&#8217;s tech-preview package, available for download right here: reading the documentation, there are some cool things that aren&#8217;t expected to work in the Flash player, anyway Hydra signify a huge step forward for the Flash technology, enabling the next Flash Player for custom bitmap filters, blend modes and a]]></description>
			<content:encoded><![CDATA[<p><a title="Glassy look through" href="http://manuel.bit-fire.com/wp-content/uploads/2007/10/glassy.jpg"><img class="alignleft" src="http://manuel.bit-fire.com/wp-content/uploads/2007/10/glassy.thumbnail.jpg" alt="Glassy look through" width="128" height="122" /></a><br />
Finally the Adobe team released the Hydra&#8217;s tech-preview package, available for download right <a title="Hydra" href="http://labs.adobe.com/wiki/index.php/AIF_Toolkit">here</a>: reading the documentation, there are some cool things that aren&#8217;t expected to work in the Flash player, anyway Hydra signify a huge step forward for the Flash technology, enabling the next Flash Player for custom bitmap filters, blend modes and a bunch of <a href="http://blogs.adobe.com/kevin.goldsmith/2007/10/its_alive_hydra.html">exciting new stuff</a>! Also, congrats to <a href="http://blog.je2050.de/2007/10/01/hydra/">Joa</a> as he wrote <a href="http://blogs.adobe.com/kevin.goldsmith/2007/10/joa_ebert_becom.html">the first non-Adobe hydra filter</a>!</p>
<p>I had some difficulties installing the package since it was keep asking to terminate another Adobe installation, anyway i managed to install the beast and give it a try: i wanted to simulate a &#8220;glassy look-through&#8221; effect (as you are watching something outside of a glass door): it goes without saying there is the need to use some of the &#8220;region needed&#8221; magic in order to crop the black borders out, but i have no time at the moment, so here it is.<br />
In order to use this filter you&#8217;ll have to <a title="Glassy look-through" href="http://manuel.bit-fire.com/code/glassy.hydra">download the kernel source</a> and these three images:</p>
<p><a title="Shower" href="http://manuel.bit-fire.com/wp-content/uploads/2007/10/shower.jpg"><img class="alignleft" src="http://manuel.bit-fire.com/wp-content/uploads/2007/10/shower.thumbnail.jpg" alt="Shower" /></a><a title="Normal1" href="http://manuel.bit-fire.com/wp-content/uploads/2007/10/normal1.jpg"><img class="alignleft" src="http://manuel.bit-fire.com/wp-content/uploads/2007/10/normal1.thumbnail.jpg" alt="Normal1" /></a><a title="Normal2" href="http://manuel.bit-fire.com/wp-content/uploads/2007/10/normal2.jpg"><img class="alignleft" src="http://manuel.bit-fire.com/wp-content/uploads/2007/10/normal2.thumbnail.jpg" alt="Normal2" /></a></p>
<p style="clear: both; padding-top: 5px">Basically, once you launched the AIF Toolkit, you load the hydra source, then the <strong>shower</strong> as the <em>first image</em>, and then choose one of the two <strong>normal maps</strong> as the <em>second image</em>, press <strong>F5</strong> and try play with the parameters.</p>
]]></content:encoded>
			<wfw:commentRss>http://manuel.bit-fire.com/2007/10/02/hydra-is-here/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
