<?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>Smart-Page.net &#187; 3D</title>
	<atom:link href="http://www.smart-page.net/blog/category/3d/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.smart-page.net/blog</link>
	<description>C++ / C# / Actionscript / Py ... &#039;My God. It&#039;s full of stars!&#039;</description>
	<lastBuildDate>Tue, 27 Jul 2010 21:35:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Kopernikus Orrery &#8211; our solar system in Unity</title>
		<link>http://www.smart-page.net/blog/2010/07/27/the-kopernikus-orrery-our-solar-system-in-unity/</link>
		<comments>http://www.smart-page.net/blog/2010/07/27/the-kopernikus-orrery-our-solar-system-in-unity/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 21:28:57 +0000</pubDate>
		<dc:creator>flashgordon</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Unity 3D]]></category>
		<category><![CDATA[Kopernikus]]></category>
		<category><![CDATA[Orrery]]></category>

		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=1144</guid>
		<description><![CDATA[<a href="http://www.smart-page.net/blog/2010/07/27/the-kopernikus-orrery-our-solar-system-in-unity/" title="The Kopernikus Orrery &#8211; our solar system in Unity"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/orrery.4bkgzqqwbyqssk8ks8cws0s8.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="The Kopernikus Orrery &#8211; our solar system in Unity" style="float:left;padding:0 10px 10px 0;" ></a>Humanity has presumably gazed at the stars long before the invention of speech and the concept of numbers&#8230;
But it took until the middle of the last millennia till we really understood our own place within the cosmic clockwork.
Checkout the Kopernikus Planetarium!


In 1704, George Graham and Thomas Tompion build a mechanical, heliocentric illustration of the solar [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.smart-page.net/blog/2010/07/27/the-kopernikus-orrery-our-solar-system-in-unity/" title="The Kopernikus Orrery &#8211; our solar system in Unity"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/orrery.4bkgzqqwbyqssk8ks8cws0s8.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="The Kopernikus Orrery &#8211; our solar system in Unity" style="float:left;padding:0 10px 10px 0;" ></a><p>Humanity has presumably gazed at the stars long before the invention of speech and the concept of numbers&#8230;</p>
<p>But it took until the middle of the last millennia till we really understood our own place within the cosmic clockwork.</p>
<p><strong>Checkout the <a href="http://www.smart-page.net/unity/sp_orrery/" target="_blank">Kopernikus Planetarium!</a></strong></p>
<p><strong><span id="more-1144"></span><br />
</strong></p>
<p>In 1704, <a href="http://en.wikipedia.org/wiki/George_Graham_%28clockmaker%29" target="_blank">George Graham</a> and <a href="http://en.wikipedia.org/wiki/Thomas_Tompion" target="_blank">Thomas Tompion</a> build a mechanical, heliocentric illustration of the solar system &#8211; a copy was made for the Earl of Orrery &#8211; hence the name &#8220;<a href="http://en.wikipedia.org/wiki/Orrery" target="_blank">Orrery</a>&#8220;.</p>
<p>Recently my fellow worker <a href="http://www.pa3d.de" target="_blank">Philipp Althoff</a> introduced me to those fascinating devices and we decided to build one.</p>
<p><img class="alignnone size-full wp-image-1147" title="orrery1" src="http://www.smart-page.net/blog/wp-content/uploads/2010/07/orrery1.jpg" alt="" width="683" height="169" /><br />
<br/></p>
<p>As orrerys naturally show a scaled version of the solar system, high precision is vital for the device will quickly start to become inaccurate.</p>
<p>Philipp did an outstanding job measuring, modeling and texturing a model that also is completely parametric, so we could freely scale its polygon count for use in Unity 3D.</p>
<p>Klaus Hünig from <a href="http://www.Astromedia.de" target="_blank">Astromedia.de</a> was so kind to support us with plans and data of his &#8220;<a href="http://astromedia.de/" target="_blank">Kopernikus-Planetarium</a>&#8220;, a beautiful orrery construction kit.</p>
<p>While I did my best to research and calculate the exact orbits, directions and pivots, Mr. Hünig pointed out my errors and helped to refine the model.<br />
<br/></p>
<h2>Conclusion</h2>
<p>The result is a 5MB heavy, animated Unity 3D version of the Kopernikus orrery by Astromedia.de.<br />
Orbits and scales are accurate, the time scale able.</p>
<p><img class="alignnone size-full wp-image-1148" title="orrery2" src="http://www.smart-page.net/blog/wp-content/uploads/2010/07/orrery2.jpg" alt="" width="683" height="169" /><br />
<br/></p>
<p>Finally we also produced <a href="http://www.smart-page.net/unity/sp_orrery/setup.exe">a screensaver installer</a> (WIN) and Philipp did the finishing touch on the browser version by composing the celestial background music.</p>
<p><br/><br />
Hope you find it relaxing.</p>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-page.net/blog/2010/07/27/the-kopernikus-orrery-our-solar-system-in-unity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Binary Kite &#8211; even more cubes with Py4D</title>
		<link>http://www.smart-page.net/blog/2010/06/25/the-binary-kite-even-more-cubes-with-py4d/</link>
		<comments>http://www.smart-page.net/blog/2010/06/25/the-binary-kite-even-more-cubes-with-py4d/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 12:47:17 +0000</pubDate>
		<dc:creator>flashgordon</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Binary kite]]></category>
		<category><![CDATA[C4D]]></category>
		<category><![CDATA[Cinema4D]]></category>
		<category><![CDATA[Generative geometry]]></category>
		<category><![CDATA[py4d]]></category>
		<category><![CDATA[Structure Synth]]></category>

		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=1096</guid>
		<description><![CDATA[<a href="http://www.smart-page.net/blog/2010/06/25/the-binary-kite-even-more-cubes-with-py4d/" title="The Binary Kite &#8211; even more cubes with Py4D"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/binary_kite1.7nj4lk5ebzgow4wggo8wssw8o.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="The Binary Kite &#8211; even more cubes with Py4D" style="float:left;padding:0 10px 10px 0;" ></a>There are those popular structures we all know and love because they simply look fascinating from every angle &#8211; like the Sierpinski triangle, the Pythagoras tree or the Menger sponge.
Generative geometry is one more proof that math is beautiful no matter how basic.
Recently I stumbled upon a new pattern that is also phenomenally simple but [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.smart-page.net/blog/2010/06/25/the-binary-kite-even-more-cubes-with-py4d/" title="The Binary Kite &#8211; even more cubes with Py4D"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/binary_kite1.7nj4lk5ebzgow4wggo8wssw8o.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="The Binary Kite &#8211; even more cubes with Py4D" style="float:left;padding:0 10px 10px 0;" ></a><p>There are those popular structures we all know and love because they simply look fascinating from every angle &#8211; like the <a href="http://en.wikipedia.org/wiki/Sierpinski_triangle" target="_blank">Sierpinski triangle</a>, the <a href="http://en.wikipedia.org/wiki/Pythagoras_tree" target="_blank">Pythagoras tree</a> or the <a href="http://en.wikipedia.org/wiki/Menger_sponge" target="_blank">Menger sponge</a>.<br />
Generative geometry is one more proof that math is beautiful no matter how basic.</p>
<p>Recently I stumbled upon a new pattern that is also phenomenally simple but produces rather complex shapes &#8211; the &#8220;Binary Kite&#8221;.</p>
<p><span id="more-1096"></span></p>
<p>I first saw it in Mikael Hvidtfeldt Christensen&#8217;s &#8216;<a href="http://structuresynth.sourceforge.net/" target="_blank">Structure Synth</a>&#8216; &#8211; an ingenious tool for exploration of generative 3D structures.</p>
<p>Basically it&#8217;s a 3D array of randomly black/white colored cubes that slightly scale(linear) and rotate(noise) per iteration on one axis.<br />
What makes it look so interesting is that each items transformation matrix is subordinated to its predecessor on that axis.</p>
<p>Initially, I played around with the kite in Unity 3D but quickly discovered that it can´t be animated at high iterations.<br />
<br/><br />
So I fired up C4D and wrote a simple Py4D generator.<br />
<br/></p>
<h2>The results</h2>
<p>I did end up with this gorgeous picture of a 30*30*500 cubes kite (5400000 polygons) (<a href="http://www.smart-page.net/py4d/sp_kite/binary_kite.jpg" target="_blank" rel="lightbox[1096]">fullsize</a>):</p>
<p><a href="http://www.smart-page.net/py4d/sp_kite/binary_kite_small.jpg" target="_blank" rel="lightbox[1096]"><img class="alignnone size-full wp-image-1097" title="binary_kite_01" src="http://www.smart-page.net/blog/wp-content/uploads/2010/06/binary_kite_01.jpg" alt="" width="683" height="169" rel="" /></a></p>
<p>Here is a closeup from the same viewpoint (<a href="http://www.smart-page.net/py4d/sp_kite/binary_kite_close.jpg" target="_blank" rel="lightbox[1096]">fullsize</a>):</p>
<p><a href="http://www.smart-page.net/py4d/sp_kite/binary_kite_close_small.jpg" target="_blank" rel="lightbox[1096]"><img class="alignnone size-full wp-image-1098" title="binary_kite_02" src="http://www.smart-page.net/blog/wp-content/uploads/2010/06/binary_kite_02.jpg" alt="" width="683" height="169" /></a></p>
<p>Last but not least I rendered this short animation of a <a href="http://www.vconverter.de/?file=binary_kite" target="_blank">5*5*150 kite growing</a>:</p>
<p><a href="http://www.vconverter.de/?file=binary_kite" target="_blank"><img src="http://www.smart-page.net/blog/wp-content/uploads/2010/06/binary_kite_03.jpg" alt="" title="binary_kite_03" width="683" height="169" class="alignnone size-full wp-image-1118" /></a></p>
<p>Want to render your own kite with even more cubes? Grab the <a href="http://www.smart-page.net/py4d/sp_kite/binary_kite_for_py4d.c4d">scene file here</a>.</p>
<p><strong><span style="color: rgb(255, 102, 0);">Hint:</span></strong><br />
<em>Remember to uncheck &#8220;Optimize cache&#8221; in the Python Generator´s properties if you want to animate the parameters.</em><br />
<br/></p>
<h2>Conclusion</h2>
<p>While Structure Synth is awesome, Cinema 4D and Py4D are a great way to visualize generated geometry too as Cinema&#8217;s render instances enable you to work with millions of objects.<br />
<br/><br />
Cheers<br />
<br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-page.net/blog/2010/06/25/the-binary-kite-even-more-cubes-with-py4d/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Conway&#8217;s Game of Life 3D &#8211; huge amount of objects in Unity</title>
		<link>http://www.smart-page.net/blog/2010/06/10/conway%c2%b4s-game-of-life-3d-huge-amount-of-objects-in-unity/</link>
		<comments>http://www.smart-page.net/blog/2010/06/10/conway%c2%b4s-game-of-life-3d-huge-amount-of-objects-in-unity/#comments</comments>
		<pubDate>Thu, 10 Jun 2010 13:24:49 +0000</pubDate>
		<dc:creator>flashgordon</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[C Sharp]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Unity 3D]]></category>
		<category><![CDATA[CombineMeshes]]></category>
		<category><![CDATA[Conway]]></category>
		<category><![CDATA[Game of Life]]></category>

		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=1032</guid>
		<description><![CDATA[<a href="http://www.smart-page.net/blog/2010/06/10/conway%c2%b4s-game-of-life-3d-huge-amount-of-objects-in-unity/" title="Conway&#8217;s Game of Life 3D &#8211; huge amount of objects in Unity"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/gol.3k7231q2u7eokgock0csgw0k0.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="Conway&#8217;s Game of Life 3D &#8211; huge amount of objects in Unity" style="float:left;padding:0 10px 10px 0;" ></a>Surely you have already heard of Conway&#8217;s cellular automaton &#8211; the Game of Life.
For those who haven&#8217;t, it&#8217;s a simulation of cells interacting with their neighbors by following a simple rule set on an infinite, two dimensional grid.
So let&#8217;s add a dimension -> view the game of life in 3D!

The Game of Life has become [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.smart-page.net/blog/2010/06/10/conway%c2%b4s-game-of-life-3d-huge-amount-of-objects-in-unity/" title="Conway&#8217;s Game of Life 3D &#8211; huge amount of objects in Unity"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/gol.3k7231q2u7eokgock0csgw0k0.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="Conway&#8217;s Game of Life 3D &#8211; huge amount of objects in Unity" style="float:left;padding:0 10px 10px 0;" ></a><p>Surely you have already heard of <a href="http://en.wikipedia.org/wiki/John_Horton_Conway" target="_blank">Conway</a>&#8217;s <a href="http://en.wikipedia.org/wiki/Cellular_automaton" target="_blank">cellular automaton</a> &#8211; the <a href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life" target="_blank">Game of Life</a>.</p>
<p>For those who haven&#8217;t, it&#8217;s a simulation of cells interacting with their neighbors by following a <a href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life#Rules" target="_blank">simple rule set</a> on an infinite, two dimensional grid.</p>
<p><strong>So let&#8217;s add a dimension -> <a href="http://www.smart-page.net/unity/sp_gol/" target="_blank">view the game of life in 3D</a>!</strong></p>
<p><span id="more-1032"></span><br />
The Game of Life has become famous not only in theoretical computer science, for it is <a href="http://en.wikipedia.org/wiki/Turing_complete" target="_blank">Turing Complete</a>, generates the most interesting <a href="http://conwaylife.com/wiki/index.php?title=Category:Patterns" target="_blank">patterns</a> and is easy to implement.<br />
In flash it can be <a href="http://www.smart-page.net/as3/sp_life" target="_blank">done</a> in &#8216;one line&#8217; of code by means of a convolution filter.</p>
<p>So since 1970 the Game of Life has been explored by almost every programmer, it&#8217;s no surprise its &#8220;Glider&#8221; pattern became the official &#8220;<a href="http://en.wikipedia.org/wiki/Hacker_emblem" target="_blank">Hacker Emblem</a>&#8221; in 2003.</p>
<p>Customarily it&#8217;s visualized by a 2D representation of the board/grid &#8211; however, it can be applied to 1D and 3D space as well.</p>
<p>While I find 3D versions/rule sets to be interesting too, there is a much simpler way to lift the game into three dimensions that also generates more beautiful patterns:<br />
Simply plotting the (visible) game grid´s state over time on the third axis perfectly visualizes the process and generates amazing shapes&#8230; or at least very interesting greebles <img src='http://www.smart-page.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<br/><br />
<h2>Why Unity?</h2>
<p>The only issue is the amount of cells to draw &#8211; visualizing a small 10*10 field over 100 generations already means handling up to 10k cubes or sprites.</p>
<p>And I had an even higher amount in mind, so flash wouldn&#8217;t get me anywhere this time.</p>
<p><img src="http://www.smart-page.net/blog/wp-content/uploads/2010/06/gol3.jpg" alt="" title="gol3" width="683" height="169" class="alignnone size-full wp-image-1084" /></p>
<p>First I thought about building a standalone app, then using <a href="http://processing.org/" target="_blank">Processing</a> or <a href="http://www.py4d.com/" target="_blank">Py4D</a>&#8230;</p>
<p>There it hit me &#8211; Unity! As long as OpenGL isn&#8217;t native to the web, <a href="http://unity3d.com/" target="_blank">Unity 3D</a> is definitely the best way to deliver intensive 3D games/apps via the browser.</p>
<p>As Unity offers C# as scripting language I immediately feel at home. Unity 3D reviewed in one word: Awesome!<br />
<br/><br />
<h2>The draw call issue</h2>
<p>But there is always a stumbling block hidden somewhere.</p>
<p>Since I am generating a lot of cubes (cells) on every frame, unity has to do a huge amount of draw calls &#8211; one for each object.<br />
The frame rate on my machine (Q6600, GF8600) dropped right into the basement.</p>
<p>The simple solution to this issue was to generate the complete generation of cubes and to fuse them to one single mesh using <a href="http://unity3d.com/support/documentation/ScriptReference/Mesh.CombineMeshes.html" target="_blank"><em>Mesh.CombineMeshes</em></a>.<br />
Normally this is done on startup  &#8211;  for the exact purpose of reducing draw calls &#8211; and I thought it could also be used at runtime for this scenario.</p>
<p>As objects are limited to 65k vertices, it wasn&#8217;t possible to merge the complete scene into one mesh, but that might have quickly become too time intensive as well.</p>
<p>So finally I was able to animate/display more than a million vertices.</p>
<p><img src="http://www.smart-page.net/blog/wp-content/uploads/2010/06/gol12.jpg" alt="" title="gol1" width="683" height="169" class="alignnone size-full wp-image-1081" /><br />
<br/><br />
<h2>Conclusion</h2>
<p>The app now draws a 50*50 grid over a time of 200 generations &#8211; press space to reset the game and seed a new field of life cells.</p>
<p>Admittedly, it takes a lot of resources &#8211; a graphic adapter with at least 128MB is essential as the simulation might end up with 1.5 million vertices.</p>
<p><br/><br />
Hope you get to see some interesting patterns &#8211; have fun!<br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-page.net/blog/2010/06/10/conway%c2%b4s-game-of-life-3d-huge-amount-of-objects-in-unity/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Py4D Examples &#8211; particle party</title>
		<link>http://www.smart-page.net/blog/2010/04/10/py4d-examples-particle-party/</link>
		<comments>http://www.smart-page.net/blog/2010/04/10/py4d-examples-particle-party/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 15:33:42 +0000</pubDate>
		<dc:creator>flashgordon</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[boids]]></category>
		<category><![CDATA[Particles]]></category>
		<category><![CDATA[Physics]]></category>
		<category><![CDATA[py4d]]></category>
		<category><![CDATA[Stars]]></category>
		<category><![CDATA[Strange Attractor]]></category>

		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=964</guid>
		<description><![CDATA[<a href="http://www.smart-page.net/blog/2010/04/10/py4d-examples-particle-party/" title="Py4D Examples &#8211; particle party"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/py4d_title1.3t0udbr1ikmc4wk8sggk4sgoc.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="Py4D Examples &#8211; particle party" style="float:left;padding:0 10px 10px 0;" ></a>I haven´t written about Py4D for quite a while now&#8230;
In the meantime, Maxon has first announced a cooperation with &#8211; and now the acquisition of Sebastian Rath´s praised python implementation for Cinema4D.
So finally &#8211; Cinema4D meets Python!
Let´s celebrate with some cool experiments!


If you are new to this blog or Py4D &#8211; a short introduction:
Py4D enhances [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.smart-page.net/blog/2010/04/10/py4d-examples-particle-party/" title="Py4D Examples &#8211; particle party"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/py4d_title1.3t0udbr1ikmc4wk8sggk4sgoc.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="Py4D Examples &#8211; particle party" style="float:left;padding:0 10px 10px 0;" ></a><p>I haven´t written about <a href="http://www.py4d.com/" target="_blank">Py4D</a> for quite a while now&#8230;</p>
<p>In the meantime, <a href="http://www.maxon.net" target="_blank">Maxon</a> has first announced a cooperation with &#8211; and now the acquisition of Sebastian Rath´s praised python implementation for Cinema4D.</p>
<p>So finally &#8211; Cinema4D meets Python!</p>
<p><strong>Let´s celebrate with some cool experiments!</strong></p>
<p><strong><span id="more-964"></span><br />
</strong></p>
<p>If you are new to this blog or Py4D &#8211; a short introduction:</p>
<p>Py4D enhances C4D with a standard Python interpreter that provides access to the C4D SDK and allows to easily code platform indepentent scripts and plugins that control or extend C4D.</p>
<p>Basicly the same as COFFEE, C4D´s own scripting language, but Py4D has two major advantages:</p>
<ul>
<li> It follows the C++ SDK more closely and implements it further than COFFEE does.</li>
<li>It is a easy to pickup, widely known language with a huge community and tons of existing code and librarys.</li>
</ul>
<p><br/><br />
While C4D is a mighty tool in itself, this powerful scripting interface enables the user to work with external data, automate processes or build his own tools.</p>
<p>Being more the C++ type when it comes to plugin development and C4D, I enjoy being able to solve small problems just by hacking a few lines of code into the script manager.<br />
I also prototype most of my plugins in Py4D before I start developing in C++ &#8211; it´s just more convenient.<br />
The step of compiling for every test takes much more time in the long run.</p>
<p><br/></p>
<h3>So here´s the meat:</h3>
<p>Four simple examples how to have a good time with Py4D and some particles&#8230;</p>
<p>Everyone requires C4D R11.5, the Thinking Particles module and the actual version of Py4D.</p>
<p>Py4D has been through some changes since the open beta started, so I took the time to update the scripts I published in the <a href="http://www.smart-page.net/blog/2009/08/07/py4d-boids/" target="_blank">boids</a>, and <a href="http://www.smart-page.net/blog/2009/09/15/strange-attractor-c4dpy4d-particle-bench/" target="_blank">strange attractor</a> posts and included them here.</p>
<p><em>Click the images for a preview.</em><br />
<br/></p>
<h3>1. Stars4Py4D</h3>
<p><a href="http://www.smart-page.net/as3d/sp_stars" target="_blank"><img class="size-full wp-image-965 alignnone" title="py4" src="http://www.smart-page.net/blog/wp-content/uploads/2010/04/py4.jpg" alt="" width="680" height="100" /></a></p>
<p>This is a Py4D port of the <a href="http://www.smart-page.net/blog/2010/04/03/cruising-the-cosmos-sagan-style-flash-in-outer-space/" target="_blank">Sagan experiment</a> I did in flash <- check out this link, it´s fun <img src='http://www.smart-page.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>A good and simple first step with particles - position vectors get parsed from a CVS <a href="http://www.astronexus.com/node/34" target="_blank">database</a> and from a galaxy of suns&#8230; “My God. It’s full of stars!”</p>
<p>Hint: <em>this example might be the best to start with, as it includes comments &#8211; the others don´t, because they use pretty much the same pattern. </em> </p>
<p>Just <a href="http://www.smart-page.net/py4d/Stars4Py4D.zip" target="_blank">download the package</a>, load the scene and change the path to the CSV file within the &#8220;file&#8221; user data field of the Py4D Tag.</p>
<p><br/></p>
<h3>2. Phy4D</h3>
<p><a href="http://www.vconverter.de/?file=py4d_simple_phy" target="_blank"><img class="alignnonesize-full wp-image-968" title="py2" src="http://www.smart-page.net/blog/wp-content/uploads/2010/04/py2.jpg" alt="" width="680" height="100" /></a></p>
<p>A very simple adaptation of a 2D &#8220;physic engine&#8221; &#8211; works only with spheres.<br />
The direction of gravitation is animated to make this a little more interesting.</p>
<p>Have a look at the <a href="http://www.vconverter.de/?file=py4d_simple_phy" target="_blank">preview video</a> and <a href="http://www.smart-page.net/py4d/Phy4Py4D.c4d">scene file</a>.</p>
<p><br/></p>
<h3>3. Boids</h3>
<p><a href="http://www.vconverter.de/?file=sp_boids" target="_blank"><img class="alignnonesize-full wp-image-970" title="py1" src="http://www.smart-page.net/blog/wp-content/uploads/2010/04/py1.jpg" alt="" width="680" height="100" /></a></p>
<p>This is simply a revival of the <a href="http://www.smart-page.net/blog/2009/08/07/py4d-boids/" target="_blank">Py4D Boids post</a> &#8211; same beast, but updated to the Py4D release version.<br />
The script creates a flocking boids swarm, that behaves according to the <a href="http://en.wikipedia.org/wiki/Boids" target="_blank">rules</a> outlined by Craig Reynolds.</p>
<p>Checkout <a href="http://www.vconverter.de/?file=sp_boids" target="_blank">this video</a> from Sebastian and get the <a href="http://www.smart-page.net/py4d/Boids4PY4D.c4d">scenefile</a>.</p>
<p><br/></p>
<h3>4. Strange Attractor</h3>
<p><a href="http://www.vconverter.de/?file=strangeattractor" target="_blank"><img class="alignnonesize-full wp-image-969" title="py3" src="http://www.smart-page.net/blog/wp-content/uploads/2010/04/py3.jpg" alt="" width="680" height="100" /></a></p>
<p>Again just the script from the original strange attractor post, but ported to the final SDK.<br />
View the <a href="http://www.vconverter.de/?file=strangeattractor" target="_blank">final rendering</a> and the <a href="http://www.smart-page.net/blog/2009/09/15/strange-attractor-c4dpy4d-particle-bench/" target="_blank">original post</a> &#8211; you can use the <a href="http://www.smart-page.net/as3/sp_safinder/" target="_blank">Strange Attractor Finder</a> to locate your very own, chaotic attractor!</p>
<p>Here´s the <a href="http://www.smart-page.net/py4d/SA4Py4D.c4d">scene file</a>.</p>
<p><br/></p>
<h3>Conclusion</h3>
<p>Python and Cinema4D are a great team and Py4D is THE alternative to COFFEE.</p>
<p>I hope this gives everybody who is interested in Py4D and controlling particles, a small head start, some inspiration or at least something fun to play with <img src='http://www.smart-page.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<br/><br />
Thanks to Sebastian for suggestions, support &#8211; and of course Py4D.</p>
<p><br/><br />
Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-page.net/blog/2010/04/10/py4d-examples-particle-party/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cruising the cosmos Sagan style &#8211; flash in outer space</title>
		<link>http://www.smart-page.net/blog/2010/04/03/cruising-the-cosmos-sagan-style-flash-in-outer-space/</link>
		<comments>http://www.smart-page.net/blog/2010/04/03/cruising-the-cosmos-sagan-style-flash-in-outer-space/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 21:22:36 +0000</pubDate>
		<dc:creator>flashgordon</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Cosmos]]></category>
		<category><![CDATA[Fzip]]></category>
		<category><![CDATA[Galaxy]]></category>
		<category><![CDATA[Milky Way]]></category>
		<category><![CDATA[Particles]]></category>
		<category><![CDATA[Sagan]]></category>
		<category><![CDATA[Stars]]></category>

		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=933</guid>
		<description><![CDATA[<a href="http://www.smart-page.net/blog/2010/04/03/cruising-the-cosmos-sagan-style-flash-in-outer-space/" title="Cruising the cosmos Sagan style &#8211; flash in outer space"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/cosmos.7ax277njjhgk4o08ows484c48.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="Cruising the cosmos Sagan style &#8211; flash in outer space" style="float:left;padding:0 10px 10px 0;" ></a>In his TV series &#8220;Cosmos&#8221;, Carl Sagan travels the universe in a &#8220;ship of the imagination&#8221;. 
Uninfluenced by the laws of physics, &#8220;perfect as a snowflake, organic as a dandelion seed&#8221;, this vessel carries him between galaxies, stars, and planets.
And now you can cruise the cosmos too!


Recently I watched cosmos again and remembered how that [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.smart-page.net/blog/2010/04/03/cruising-the-cosmos-sagan-style-flash-in-outer-space/" title="Cruising the cosmos Sagan style &#8211; flash in outer space"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/cosmos.7ax277njjhgk4o08ows484c48.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="Cruising the cosmos Sagan style &#8211; flash in outer space" style="float:left;padding:0 10px 10px 0;" ></a><p>In his TV series <a href="http://en.wikipedia.org/wiki/Cosmos:_A_Personal_Voyage" target="_blank">&#8220;Cosmos&#8221;</a>, <a href="http://en.wikipedia.org/wiki/Carl_Sagan"  target="_blank">Carl Sagan</a> travels the universe in a &#8220;ship of the imagination&#8221;. </p>
<p>Uninfluenced by the laws of physics, &#8220;perfect as a snowflake, organic as a dandelion seed&#8221;, this vessel carries him between galaxies, stars, and planets.</p>
<p><b><a href="http://www.smart-page.net/as3d/sp_stars"  target="_blank">And now you can cruise the cosmos too!</a></b><br />
<br/><br />
<span id="more-933"></span><br />
Recently I watched cosmos again and remembered how that sequence fascinated me as kid.<br />
The sheer scale of the distances involved blew my mind. It still does today.</p>
<p>The concept has been revisited by many popular movies and media (Man in Black, The Simpsons&#8230;) and is always the same &#8211; the camera enters the universe, our galaxy, solar system and finally stops on earth &#8211; sometimes entering the microcosm, like the DNA of a cell.</p>
<p>Years ago I experimented with something like a <a href="http://www.smart-page.net/blog/2009/08/05/pyramidial-multiscale-86400px-gigapixel-image/"  target="_blank">pyramidial image</a> to archive this effect in flash, unfortunately the result didn´t create the feeling of depth that I had hoped for.</p>
<p><img src="http://www.smart-page.net/blog/wp-content/uploads/2010/04/cosmos2.jpg" alt="" title="cosmos2" width="680" height="100" class="alignnone size-full wp-image-934" /></p>
<p>But flash has advanced in those years&#8230; as I wrote before, in the strange attractor <a href="http://www.smart-page.net/blog/2009/09/15/strange-attractor-c4dpy4d-particle-bench/" target="_blank">post</a>, <a href="http://www.unitzeroone.com/blog/2009/03/18/flash-10-massive-amounts-of-3d-particles-with-alchemy-source-included/" target="_blank">Ralph Hauwert</a> and <a href="http://blog.joa-ebert.com/2009/04/03/massive-amounts-of-3d-particles-without-alchemy-and-pixelbender/" target="_blank">Joa Ebert</a> have published some astonishing code that renders nearly half a million particles in real-time!</p>
<p>First I decided that I would work with real data &#8211; otherwise this would become just another &#8220;random stars / noise flying at you&#8221; screensaver.</p>
<p>But after some research I learned that the actual distance of nearby stars (called <a href="http://en.wikipedia.org/wiki/Parallax#Stellar_parallax" target="_blank">&#8220;stellar parallax&#8221;</a>) is not always known, so that most models and databases project stars onto the inside of a virtual sphere.</p>
<p>Finally I found the <a href="http://astronexus.com/node/34" target="_blank">HYG database</a> &#8211; &#8220;a subset of the data in three major catalogs: the Hipparcos Catalog,the Yale Bright Star Catalog (5th Edition), and the Gliese Catalog of Nearby Stars (3rd Edition)&#8221;.<br />
It contains about 120.000 stars, many including their parallaxes and conveniently cartesian coordinates, so I saved the step of calculating xyz from right ascension, declination and distance &#8211; like I had to with other databases I tested.</p>
<p><img src="http://www.smart-page.net/blog/wp-content/uploads/2010/04/cosmos3.jpg" alt="" title="cosmos3" width="680" height="100" class="alignnone size-full wp-image-935" /></p>
<p>The CSV file got stripped of all additional data aside from the positions with a simple parser &#8211; that got it down from 20 to 4MB &#8211; still too big for my taste.</p>
<p>So I added the Fzip library to Joa´s AS3 only version of Ralph´s experiment, parsed the position vectors, scaled them and got my first view on our galaxy &#8211; breathtaking.</p>
<p>Scaling, controls and a simple clipping where swiftly implemented and everything was set for the voyage to the stars&#8230;</p>
<p><br/><br/></p>
<h3>Tribute &#8211; &#8220;A Glorious Dawn&#8221; displaced </h3>
<p>While watching the result, an idea struck my mind:<br />
As the z-axis movement of the camera or the zooming into the szene is done by simply scaling the particle positions, its obviously possible to change their parameters in realtime&#8230;</p>
<p>I remembered my <a href="http://www.smart-page.net/blog/2008/07/12/dynamic-displacement/" target="_blank">displacement experiment</a> with papervision and quickly added a color parameter to the particle class, loaded an flv video and compiled this:</p>
<p><a href="http://www.smart-page.net/as3d/sp_sagan" target="_blank"><br />
<strong>&#8220;A Glorious Dawn&#8221; live rendered to a displaced point cloud</strong></a></p>
<p><a href="http://www.smart-page.net/as3d/sp_sagan" target="_blank"><img src="http://www.smart-page.net/blog/wp-content/uploads/2010/04/saganvox.jpg" alt="" title="saganvox" width="680" height="362" class="alignnone size-full wp-image-1021" /></a></p>
<p><br/><br/></p>
<h3>Conclusion</h3>
<p>It´s possible to handle an awful lot of particles with flash, even more if haxe/alchemy &#8211; inlining gets involved.<br />
As the displacement experiment shows, the dataset can even be dynamic!</p>
<p>And hey &#8211; these are real stars, so this is science! <img src='http://www.smart-page.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><br/><br />
Hint: turn up your gamma adjustment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-page.net/blog/2010/04/03/cruising-the-cosmos-sagan-style-flash-in-outer-space/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Smart PRS Cinema4D Keyframe Tag</title>
		<link>http://www.smart-page.net/blog/2010/03/22/smart-prs-cinema4d-keyframe-tag/</link>
		<comments>http://www.smart-page.net/blog/2010/03/22/smart-prs-cinema4d-keyframe-tag/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 16:01:52 +0000</pubDate>
		<dc:creator>flashgordon</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[C4D]]></category>
		<category><![CDATA[Cinema4D]]></category>
		<category><![CDATA[Keyframes]]></category>
		<category><![CDATA[record]]></category>
		<category><![CDATA[Tag]]></category>

		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=916</guid>
		<description><![CDATA[<a href="http://www.smart-page.net/blog/2010/03/22/smart-prs-cinema4d-keyframe-tag/" title="Smart PRS Cinema4D Keyframe Tag"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/smartprs_blog.3bajy4ciedq8g84884oc0k4ok.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="Smart PRS Cinema4D Keyframe Tag" style="float:left;padding:0 10px 10px 0;" ></a>Smart PRS is a Cinema4D tag that allows to record position, rotation and scale of one or multiple objects to key frames.
This is especially useful for all, who want to bake Thinking Particel setups and don’t own the MOCCA module.
Take a look at the demonstration Video.  
Recently I tried to use the AfterEffects export [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.smart-page.net/blog/2010/03/22/smart-prs-cinema4d-keyframe-tag/" title="Smart PRS Cinema4D Keyframe Tag"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/smartprs_blog.3bajy4ciedq8g84884oc0k4ok.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="Smart PRS Cinema4D Keyframe Tag" style="float:left;padding:0 10px 10px 0;" ></a><p>Smart PRS is a Cinema4D tag that allows to record position, rotation and scale of one or multiple objects to key frames.</p>
<p>This is especially useful for all, who want to bake Thinking Particel setups and don’t own the MOCCA module.</p>
<p><a href="http://www.smart-page.net/smartprs" target="_blank"><strong>Take a look at the demonstration Video.</strong></a><br/> <br/> <br/><br />
<span id="more-916"></span><img src="http://www.smart-page.net/blog/wp-content/uploads/2010/03/prs.jpg" alt="" title="prs" width="340" height="322" class="alignright size-full wp-image-930" />Recently I tried to use the AfterEffects export Option from Cinema4D to pass a simple particle animation to AE.</p>
<p>Unfortunately this didn´t work out – the issue is that all animation capable export formats/plugins rely on key frames, and objects animated via Xpresso/Thinking Particles are most times not even present in the timeline as they get generated as “Particle Geometry”.</p>
<p>While this can be easily fixed by creating them manually and linking the particle positions to them, it´s still impossible to export that animation without key frames.</p>
<p>Cinema4D offers the option to “bake” certain motions to key frames, but not from simulations.<br />
Actually there is a plug-in called “Cappuccino” within the MOCCA module that allows this, but if you are not into character animation, chances are you don´t have it handy.<br />
<br/><br />
SmartPRS makes those animations export-and editable by recording them as key frames while the simulation is running.<br />
After that, the Xpresso setup can be removed from the scene and the animation edited or exported.</p>
<p>The plug-in even allows to capture the position of an object that gets moved in real-time by the mouse.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-page.net/blog/2010/03/22/smart-prs-cinema4d-keyframe-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SmartAA &#8211; reconstruct anti aliasing with Pixel Bender</title>
		<link>http://www.smart-page.net/blog/2010/02/21/smartaa-reconstruct-anti-aliasing-with-pixel-bender/</link>
		<comments>http://www.smart-page.net/blog/2010/02/21/smartaa-reconstruct-anti-aliasing-with-pixel-bender/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 00:59:43 +0000</pubDate>
		<dc:creator>flashgordon</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[After Effects]]></category>
		<category><![CDATA[aliasing]]></category>
		<category><![CDATA[anti]]></category>
		<category><![CDATA[b-spline]]></category>
		<category><![CDATA[bicubic]]></category>
		<category><![CDATA[Filter]]></category>
		<category><![CDATA[Mitchell-Netravali]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Pixel Bender]]></category>
		<category><![CDATA[reconstruct]]></category>

		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=801</guid>
		<description><![CDATA[<a href="http://www.smart-page.net/blog/2010/02/21/smartaa-reconstruct-anti-aliasing-with-pixel-bender/" title="SmartAA &#8211; reconstruct anti aliasing with Pixel Bender"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/smartaa1.3nzh85x4xvcwk4o4o08co0g40.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="SmartAA &#8211; reconstruct anti aliasing with Pixel Bender" style="float:left;padding:0 10px 10px 0;" ></a>About three decades ago, pixels where as big as toasters &#8211; and mostly green.
Today we have millions of them to deal with, and the terms anti-/aliasing are part of our daily live and every time an image is scaled, it gets interpolated to keep those bad &#8220;stairs&#8221; away from our eyes.
But what if the source [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.smart-page.net/blog/2010/02/21/smartaa-reconstruct-anti-aliasing-with-pixel-bender/" title="SmartAA &#8211; reconstruct anti aliasing with Pixel Bender"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/smartaa1.3nzh85x4xvcwk4o4o08co0g40.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="SmartAA &#8211; reconstruct anti aliasing with Pixel Bender" style="float:left;padding:0 10px 10px 0;" ></a><p>About three decades ago, pixels where as big as toasters &#8211; and mostly green.</p>
<p>Today we have millions of them to deal with, and the terms anti-/aliasing are part of our daily live and every time an image is scaled, it gets interpolated to keep those bad &#8220;stairs&#8221; away from our eyes.</p>
<p>But what if the source image is aliased in the first place?</p>
<p><b>Checkout the <a href="http://www.smart-page.net/as3/sp_smartaa" target="_blank">demo of SmartAA!</a></b><br />
<br/><br />
<span id="more-801"></span><br />
While upsaling is the most common cause of <a href="http://en.wikipedia.org/wiki/Aliasing" target="_blank">aliasing</a>, there are images that are naturally aliased &#8211; for example images from a 3D render engine.</p>
<p>Of course there are many ways to <a href="http://en.wikipedia.org/wiki/Antialiasing" target="_blank">antialias</a> cg images when generating them &#8211; for example by rendering to a higher resolution than targeted and downscaling the result (FSAA)- or by rendering and merging four slightly offset variations.</p>
<p>While this is as computational intensive as it sounds, modern GPU´s can handle this task rather easily as they have their buffers and hardwired magic to do so, but still it’s not uncommon to come along aliased images in the world of computer graphics.</p>
<p>So is all this material &#8220;useless&#8221; or can an image that has never seen any antialiasing, or has been upscaled with the <a href="http://en.wikipedia.org/wiki/Nearest-neighbor_interpolation" target="_blank">nearest neighbour</a> method, be reconstructed?</p>
<p>In fact all that modern imaging software does when rescaling an image is reconstructing its pixels to fit the new dimensions &#8211; most times with a <a href="http://en.wikipedia.org/wiki/Bicubic_interpolation" target="_blank">bicubic filter</a>.</p>
<p><img src="http://www.smart-page.net/blog/wp-content/uploads/2010/02/smartAA01.jpg" alt="" title="smartAA01" width="692" height="138" class="alignnone size-full wp-image-805" /></p>
<h3 style="margin-top:10px; margin-bottom:5px">SmartAA is a bicubic BC-spline reconstruction filter for PixelBender.</h3>
<p>Its 3&#215;3 kernel gathers all neighboring pixels of the one to reconstruct and weights them with the <a href="http://de.wikipedia.org/wiki/Mitchell-Netravali-Filter" target="_blank">Mitchell-Netravali</a>(german link) filter.</p>
<p>In essence, this means that each pixel is modified by the average color of its surrounding friends.<br />
While &#8220;average&#8221; being the wrong term here as the influence of each pixel is determined by the spline curve of the Mitchell-Netravali filter.</p>
<p>This eliminates those hard, &#8220;stair-like&#8221; artifacts of the aliasing by visually &#8220;softening&#8221; or unsharping the image.</p>
<p>However this is not simply a destructive blurring effect but a reconstructive analysis of the source &#8220;signal&#8221;.</p>
<p><br/><br />
There are many known filters that do this hard job &#8211; it´s not easy to reconstruct information that was partly lost (or never there in the first place).<br />
<img src="http://www.smart-page.net/blog/wp-content/uploads/2010/02/space.jpg" alt="" title="space" width="175" height="179" class="alignright size-full wp-image-811" /><br />
Thus all of them suffer of the same issues &#8211; the result always shows some artifacts.<br />
Mostly it’s a visible unsharping, <a href="http://en.wikipedia.org/wiki/Anisotropy" target="_blank">anisotropy </a>or the so-called &#8220;<a href="http://en.wikipedia.org/wiki/Ringing_artifacts" target="_blank">ringing</a>&#8220;.</p>
<p>In general bicubic reconstruction methods create the best results.</p>
<p>Among the various possible filter methods the windowed Sinc(<a href="http://en.wikipedia.org/wiki/Lanczos_resampling" target="_blank">Lanczos</a>)- and Mitchell-Netravali filter are chosen the most as their output is considered to be the best mix of the inevitable unsharping, anisotropy and ringing.</p>
<p>Just for the record: there are &#8220;better&#8221; solutions, the so called &#8220;adaptive&#8221; or &#8220;smart&#8221; filters that try separate methods on edges, fills and other structures.<br />
They are particularly useful when working with sequences of moving images (video) but again slow to compute.</p>
<p>SmartAA on the other hand is a quite simple implementation of the M.-N. filter and runs blazingly fast when run on the GPU &#8211; producing about 70 redraws per sec on a 1024*768 image.</p>
<p>Unfortunately it´s not nearly as fast on the CPU.<br />
If you have a rather slow machine, you will have seen the demo struggling to keep a 24fps framerate, so its just! that bit too slow to to antialias the pixelated output of a flash based C64 emulator.</p>
<p>That would have been cool&#8230; would love to see something like that.</p>
<p><br/><br />
I kept it flash compatible anyway &#8211; still there might be applications.</p>
<p>Its a matter of personal reception, but to me the M.-N. filter looks better on videos as the inbuild &#8220;smooth&#8221;-method.<br />
Anyway &#8211; flash video has been criticized enaugh for high cpu usage so lets not make things worse <img src='http://www.smart-page.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Also: like any reconstruction filter it won´t work in any given scenario as there are some natural and some specific limitations.</p>
<p><img src="http://www.smart-page.net/blog/wp-content/uploads/2010/02/smartAA02.jpg" alt="" title="smartAA02" width="690" height="133" class="alignnone size-full wp-image-815" /></p>
<p><br/><br />
<img src="http://www.smart-page.net/blog/wp-content/uploads/2010/02/smartAA04.jpg" alt="" title="smartAA04" width="254" height="175" class="alignright size-full wp-image-823" /><br />
So what can SmartAA do and what not? Here is a feature/limitation list:</p>
<p><em>Features:</em></p>
<p>- Works with Photoshop, After Effects, Flash<br />
- Supports alpha channel<br />
- Is real-time</p>
<p><em>Limitations:</em></p>
<p>- Does no up/down scaling &#8211; just reconstruction of anti aliasing<br />
- Is scenario specific &#8211; for example text will often look strange<br />
- works only with artifacts in the same pixel space.</p>
<p><br/><br />
Let me elaborate on the last point:<br />
<img src="http://www.smart-page.net/blog/wp-content/uploads/2010/02/smartAA03.jpg" alt="" title="smartAA03" width="200" height="91" class="alignright size-full wp-image-817" /><br />
As SmartAA takes only neighbouring pixels into account it isn´t able to reconstruct aliasing effects that span over greater distances than 2 pixels.<br />
For example if an image exists of 4*4 pixel blocks of the same color, those blocks would get rounded on the edges but will still be visible as rounded blocks.</p>
<p>But it works ideal on sources like aliased output from a render engine, or images that have been upscaled x2 with the nearest neighbour method.<br />
<br/><br />
<strong>Conclusion:</strong></p>
<p>Aliasing should be fought before it ends up within an image as there are more sophisticated methods to keep it from emerging than to reconstruct it after the damage is done.</p>
<p>But sometimes it´s inevitable and if you are looking for a simple but effective way to get rid of that ugly blocks within an image or video &#8211; SmartAA will do the trick.<br />
<br/><br />
<strong>Download:</strong></p>
<p><a href="http://www.smart-page.net/as3/sp_smartaa/SmartAA.zip">Grab the Shader here</a> and use it with Photoshop (<a href="http://www.adobe.com/devnet/pixelbender/" target="_blank">Pixel Bender Plugin</a> needed), After Effects or Flash!<br />
<br/><br />
<strong>Hint:</strong></p>
<p>Try to add a sharpen filter or better an unsharpen mask to the result to counter the blur effect.<br />
Don´t forget to use the width/hight properties &#8211; SmartAA will work without but there will be artifacts on the upper- and lower right corner.</p>
<p><br/><br />
I hope this is helpful to anyone out there and would love to hear some comments or ideas.</p>
<p><br/><br />
Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-page.net/blog/2010/02/21/smartaa-reconstruct-anti-aliasing-with-pixel-bender/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>The Steve Jobs IPad Adobe Flashplayer HTML5 Video rant</title>
		<link>http://www.smart-page.net/blog/2010/02/06/the-steve-jobs-ipad-adobe-flashplayer-html5-video-rant/</link>
		<comments>http://www.smart-page.net/blog/2010/02/06/the-steve-jobs-ipad-adobe-flashplayer-html5-video-rant/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 12:30:06 +0000</pubDate>
		<dc:creator>flashgordon</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[audio visualization]]></category>
		<category><![CDATA[Five3D]]></category>
		<category><![CDATA[Flashplayer]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[IPad]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[Steve Jobs]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=775</guid>
		<description><![CDATA[<a href="http://www.smart-page.net/blog/2010/02/06/the-steve-jobs-ipad-adobe-flashplayer-html5-video-rant/" title="The Steve Jobs IPad Adobe Flashplayer HTML5 Video rant"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/sp_ball1.bivt75iqsrw4kgcgwgocokkoc.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="The Steve Jobs IPad Adobe Flashplayer HTML5 Video rant" style="float:left;padding:0 10px 10px 0;" ></a>The flame wars are on!
CEOs, CTOs, platform evangelists and users are fighting the war of the worlds out there.
It´s HTML5 vs. Flash, open vs. closed, H264 vs. OGG, desktop vs. mobile, truth vs. lie.
Lets first calm down with this nice audio visualization before we dive in&#8230;


Since Steve´s presentation of the iPad and recent statements from [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.smart-page.net/blog/2010/02/06/the-steve-jobs-ipad-adobe-flashplayer-html5-video-rant/" title="The Steve Jobs IPad Adobe Flashplayer HTML5 Video rant"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/sp_ball1.bivt75iqsrw4kgcgwgocokkoc.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="The Steve Jobs IPad Adobe Flashplayer HTML5 Video rant" style="float:left;padding:0 10px 10px 0;" ></a><p>The flame wars are on!</p>
<p>CEOs, CTOs, platform evangelists and users are fighting the war of the worlds out there.<br />
It´s HTML5 vs. Flash, open vs. closed, H264 vs. OGG, desktop vs. mobile, truth vs. lie.</p>
<p><b>Lets first calm down <a href="http://www.smart-page.de/as3d/sp_ball/" target="_blank">with this nice audio visualization</a> before we dive in&#8230;</b><br />
<br/><br />
<span id="more-775"></span><br />
Since Steve´s presentation of the iPad and recent statements from him and Apple it´s clear that they are not going to support flash on their mobile devices.</p>
<p>This has triggered an ongoing debate on Flash, HTML5, browser plugins and web technology in general.</p>
<p>Unfortunately the whole discussion is rather uncivilized as there are a lot of people involved who make their living from those technologies and standards &#8211; and even more who use them on a daily basis.</p>
<p>So much has been written on this topic during the last two weeks&#8230; much was impulsive, exaggerated or plain wrong misinformation while few statements showed greater insight or were just watered down by irony and harsh language.<br />
<br/><br />
<img src="http://www.smart-page.net/blog/wp-content/uploads/2010/02/battle.jpg" alt="" title="battle" width="692" height="150" class="alignnone size-full wp-image-780" /><br />
<br/><br />
So I am not going to take part in this discussion with a detailed view on the technology involved or why one standard is superior to another etc.. sorry, but there will be no rant <img src='http://www.smart-page.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Why? </p>
<p>Because this has already been done beautifully by others and because &#8211; it doesn´t matter.</p>
<p>What really matters is to get things done! To create content and to deliver it to the widest possible range of audience. </p>
<p>As a developer I don´t have the luxury of choosing my tools based on personal favor. I have to work with what’s best suited to achive the desired result &#8211; be it HTML, Flash or Silverlight or whatever may come along.</p>
<p>As a user however I have that luxury &#8211; I vote with every click and my wallet for and against technology that I consider to be worth my time or money.</p>
<p>So there is no point for these two groups of people to lash out against each other or certain technologies.<br />
Of course this doesn´t apply to CEOs, CTOs or platform evangelists &#8211; it´s their job to influence the aforesaid groups on their opinion.</p>
<p>So what will all this mean for the web? Almost nothing.</p>
<p>The web has always been based on open standards while innovation was often driven by the &#8220;big boys&#8221; like IBM, MS, Apple and many others.<br />
Finally this innovation gets adapted to open standards &#8211; as well as the economy assimilates ideas from the open source world.</p>
<p>And all this is healthy!<br />
<img src="http://www.smart-page.net/blog/wp-content/uploads/2010/02/evolution1.jpg" alt="" title="New ClicKclic Character" width="692" height="150" class="alignnone size-full wp-image-795" /></p>
<p>Sure &#8211; like in nature, it sometimes seems cruel and unforgiving, but whatever survives in the end may stay&#8230; just to be replaced by its successor if it doesn´t evolve.</p>
<p>And in the end everybody in this constantly changing ecosystem wins:</p>
<p>Companies get to sell their products and to rant about their competitors, developers get jobs instead of finally being replaced by generators, and users get more and more for their money.</p>
<p>So I am glad we live in a world with more than one operating system, programming language, browser, or pair of socks to choose from. </p>
<p>It´s the freedom &#8220;to choose&#8221; that makes the web/live so exciting. </p>
<p><br/><br />
Cheers!<br />
<br/><br/><br />
PS: About the audio visualization experiment in the opener:</p>
<p>I wanted to do something with Five3D for a long time now and well &#8211; here it is.<br />
You can load your own mp3´s via the right click menu.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-page.net/blog/2010/02/06/the-steve-jobs-ipad-adobe-flashplayer-html5-video-rant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SmartReLight &#8211; relighting with Pixel Bender</title>
		<link>http://www.smart-page.net/blog/2009/12/27/smartrelight-relighting-with-pixel-bender/</link>
		<comments>http://www.smart-page.net/blog/2009/12/27/smartrelight-relighting-with-pixel-bender/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 15:57:15 +0000</pubDate>
		<dc:creator>flashgordon</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Normals]]></category>
		<category><![CDATA[PixelBender]]></category>
		<category><![CDATA[Relighting]]></category>
		<category><![CDATA[SmartReLight]]></category>
		<category><![CDATA[Video post]]></category>

		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=642</guid>
		<description><![CDATA[<a href="http://www.smart-page.net/blog/2009/12/27/smartrelight-relighting-with-pixel-bender/" title="SmartReLight &#8211; relighting with Pixel Bender"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/smartrelight.3itd6eb870sg4gogwo4gskgc0.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="SmartReLight &#8211; relighting with Pixel Bender" style="float:left;padding:0 10px 10px 0;" ></a>Relighting is an interesting method that is often used in video post production pipelines.
Given the vector of its surface normal, it is possible to calculate the brightness of each pixel by a pseudo 3D lightning system.
Checkout the demo of SmartReLight!


As the &#8216;object space&#8217; &#8211; or &#8216;material&#8217; normal’s have to be known, relighting is mostly used [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.smart-page.net/blog/2009/12/27/smartrelight-relighting-with-pixel-bender/" title="SmartReLight &#8211; relighting with Pixel Bender"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/smartrelight.3itd6eb870sg4gogwo4gskgc0.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="SmartReLight &#8211; relighting with Pixel Bender" style="float:left;padding:0 10px 10px 0;" ></a><p>Relighting is an interesting method that is often used in video post production pipelines.</p>
<p>Given the vector of its surface normal, it is possible to calculate the brightness of each pixel by a pseudo 3D lightning system.</p>
<p><a href="http://www.smart-page.net/as3/sp_smartrelight" target="_blank"><strong>Checkout the demo of SmartReLight!</strong></a><br />
<br/><br />
<span id="more-642"></span><br />
As the &#8216;object space&#8217; &#8211; or &#8216;material&#8217; normal’s have to be known, relighting is mostly used within the post process of CG generated images or videos.</p>
<p>It’s a convenient way to archive great lighting and gives the artist most control as he can tune it in real-time without having to re- render the footage for every adjustment.</p>
<p>As you can see from this example, the complete lighting is done by the shader using only a color pass and the object normal’s:</p>
<p><img class="alignnone size-full wp-image-648" title="smartrelight2" src="http://www.smart-page.net/blog/wp-content/uploads/2007/05/smartrelight2.jpg" alt="smartrelight2" width="680" height="170" /><br />
<br/><br />
This implementation is fairly simple as it doesn´t support reflections and refractions like <a href="http://www.minning.de/software/normality" target="_blank">Normality</a> , but its fast and does the job &#8211; and what better way to get through the last cold days of the year than playing half an hour with Pixel Bender?</p>
<p>It’s also possible to relight already lighted sources to some extend, by not using the color- , but an already phong- shaded pass:</p>
<p><embed type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" width="680" height="350" src="http://www.smart-page.net/as3/sp_smartrelight/SmartReLight_Shadertest.swf" /><br />
<br/><br />
You can <a href="http://www.smart-page.net/as3/sp_smartrelight/SmartReLight.zip">download SmartReLight here</a> and the <a href="http://www.smart-page.net/as3/sp_smartrelight/srcview" target="_blank">source of the demo</a> including the shader <a href="http://www.smart-page.net/as3/sp_smartrelight/srcview" target="_blank">here</a>.<br />
<br/><br/></p>
<h3>Compiling PB shaders at runtime</h3>
<p>Last but not least a short but very interesting story:</p>
<p>Recently I was asked if it was possible to compile a PB shader at runtime.</p>
<p>Given it some thought &#8211; why not?</p>
<p>And as it turned out the hell of a chap Nicolas Canasse already <a href="http://ncannasse.fr/projects/pbj?version=232" target="_blank">took care of that matter</a>.<br />
There is also already an <a href="http://www.jamesward.com/2009/04/29/announcing-pbjas-an-actionscript-3-pixel-bender-shader-library/" target="_blank">AS3 port</a> by James Ward.<br />
<br/><br/></p>
<h3>All the best for 2010 !</h3>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-page.net/blog/2009/12/27/smartrelight-relighting-with-pixel-bender/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Realtime SSAO with After Effects and Pixel Bender</title>
		<link>http://www.smart-page.net/blog/2009/10/05/realtime-ssao-with-after-effects-and-pixel-bender/</link>
		<comments>http://www.smart-page.net/blog/2009/10/05/realtime-ssao-with-after-effects-and-pixel-bender/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 07:00:58 +0000</pubDate>
		<dc:creator>flashgordon</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[After Effects]]></category>
		<category><![CDATA[AFX]]></category>
		<category><![CDATA[AO]]></category>
		<category><![CDATA[Pixel Bender]]></category>
		<category><![CDATA[Screen Space Ambient Occlusion]]></category>
		<category><![CDATA[Smart SSAO]]></category>
		<category><![CDATA[SSAO]]></category>

		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=471</guid>
		<description><![CDATA[<a href="http://www.smart-page.net/blog/2009/10/05/realtime-ssao-with-after-effects-and-pixel-bender/" title="Realtime SSAO with After Effects and Pixel Bender"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/sp_ssao.7aora230sz48sk0ogck8wc4k4.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="Realtime SSAO with After Effects and Pixel Bender" style="float:left;padding:0 10px 10px 0;" ></a>Screen Space Ambient Occlusion or SSAO is a method to compute an approximated AO pass in real-time! 
This is done by using the depth information of a 3D object or scene that has been stored from the Z-(depth) buffer of the renderer.
Go ahead and try the interactive demo or see a video example!


The technique was [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.smart-page.net/blog/2009/10/05/realtime-ssao-with-after-effects-and-pixel-bender/" title="Realtime SSAO with After Effects and Pixel Bender"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/sp_ssao.7aora230sz48sk0ogck8wc4k4.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="Realtime SSAO with After Effects and Pixel Bender" style="float:left;padding:0 10px 10px 0;" ></a><p>Screen Space Ambient Occlusion or <a href="http://en.wikipedia.org/wiki/Screen_Space_Ambient_Occlusion" target="_blank">SSAO</a> is a method to compute an approximated <a href="http://en.wikipedia.org/wiki/Ambient_occlusion" target="_blank">AO</a> pass in real-time! </p>
<p>This is done by using the depth information of a 3D object or scene that has been stored from the Z-(depth) buffer of the renderer.</p>
<p><b>Go ahead and try the <a href="http://www.smart-page.net/as3/sp_smartssao">interactive demo</a> or see a <a href="http://www.vconverter.de/?file=smartssao" target="_blank">video example!</a></b><br />
<br/><br />
<span id="more-471"></span></p>
<p>The technique was introduced 2007 at Siggraph by <a href="http://www.crytek.com/" target="_blank">Crytek Studios</a> and is becoming an often used feature within next generation live-3d engines or cg/video post applications.</p>
<p>After playing with the ray traced inside-out AO and having to realize that it´s not quite doable with Pixel Blender, I turned to SSAO and quickly got some nice results.</p>
<p>In short it´s all about importance sampling. </p>
<p>SmartSSAO looks up the depth information of 12 surrounding samples and checks if they get occluded to average the AO value.<br />
<img style="margin-top:10px; margin-bottom:5px;" src="http://www.smart-page.net/blog/wp-content/uploads/2009/10/sp_ssao3.jpg" alt="sp_ssao3" title="sp_ssao3" width="680" height="142" class="alignnone size-full wp-image-680" /></p>
<p>The disadvantages lie in the nature of SSAO being &#8220;screen spaced&#8221; which means that it can´t take objects from the off into account, and the result has to be blurred to reduce the inevitable noise.<br />
Also there is no ray bouncing, so classic AO is visually superior &#8211; but hey&#8230; who can argue with &#8220;real-time&#8221;?</p>
<p><strong><a href="http://www.vconverter.de/?file=smartssao2" target="_blank">View another video</a></strong> of the buffer and the solo SSAO pass without/with blurring.<br />
<span style="color: #ff6600;"><em>Please note that those strange looking anomalies on the buddahs arms originate from the badly ranged zmap I produced in a hurry.</em></span><br />
<br/><br />
<strong>To sum it all up:</strong></p>
<p>SSAO makes it possible to have AO in places where it normally isn´t possible &#8211; e.g. real-time engines (yes &#8211; even for Flash/Papervision), or within a video post process.</p>
<p>All that’s needed is the Zbuffer of a 3D rendering.<br />
<br/></p>
<p><strong>You can download the Shader <a href="http://www.smart-page.net/as3/sp_smartssao/SmartSSAO.zip" target="_blank">here </a>or get it packed with an <a href="http://www.smart-page.net/as3/sp_smartssao/SmartSSAO_example.zip" target="_blank">AFX example</a>.<br />
</strong><br/><br />
<i>Hint: As said before, the SSAO pass needs to be blurred in order to clear out the emerging noise &#8211; but don´t overdo it, as the blurring will &#8220;bleed&#8221; the result over to unwanted areas.<br />
This could be targeted by a special SSAO blur filter that would again have to take the depth map into account. </i><br />
<br/><br />
<em><a href="http://www.vconverter.de/?file=smartssao2" target="_blank">Click here to see this screenshot as video</a></em><br/><br />
<strong><img class="alignnone size-full wp-image-504" title="sp_ssao2" src="http://www.smart-page.net/blog/wp-content/uploads/2009/10/sp_ssao2.jpg" alt="sp_ssao2" width="700" height="401" /><br />
</strong></p>
<p><strong><span style="color: #ff6600;"><em><br />
Update:</em></span></strong></p>
<p>I feel like I should adress the X,Y-offset params of the filter which can be used to tweak the &#8220;shadow direction&#8221;.<br />
&#8220;Shadow direction&#8221; in quotes as (SS)AO is all about indirect lightning so this is a real &#8220;tweak&#8221; or an unrealistic param &#8211; which I thought might come in handy in some cases.</p>
<p>I was asked if the shader was performant enaugh for flash &#8211; and even if it looks a bit ugly codewise as I had to get rid of a loop &#8211; it surely is.</p>
<p>So I updated the package and made this small <a href="http://www.smart-page.net/as3/sp_smartssao" target="_blank"><strong>interactive flex demo</strong></a> :</p>
<p><embed style="margin-left:50px;" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" width="570" height="500" src="http://www.smart-page.net/as3/sp_smartssao/SmartSSAO_Shadertest.swf" /><br />
Be sure to try unchecking &#8220;color SSAO?&#8221; and &#8220;show SSAO?&#8221; to get an impression.</p>
<p>You can grab the source <strong><a href="http://www.smart-page.net/as3/sp_smartssao/srcview/index.html" target="_blank">here</a></strong>.</p>
<p><strong><span style="color: #ff6600;"><em><br />
Update 2:</em></span></strong></p>
<p>The filter now features an additional sampling radius parameter which controls the dispersion and allows to adjust it to the desired level of detail &#8211; this should also make it more useable for papervision.</p>
<p>I hope this little experiment will be of use to somebody out there and would love to hear any suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-page.net/blog/2009/10/05/realtime-ssao-with-after-effects-and-pixel-bender/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>GPU based Raytracing with Pixel Bender and After Effects</title>
		<link>http://www.smart-page.net/blog/2009/09/27/gpu-based-raytracing-with-pixel-bender-and-after-effects/</link>
		<comments>http://www.smart-page.net/blog/2009/09/27/gpu-based-raytracing-with-pixel-bender-and-after-effects/#comments</comments>
		<pubDate>Sun, 27 Sep 2009 10:29:44 +0000</pubDate>
		<dc:creator>flashgordon</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[After Effects]]></category>
		<category><![CDATA[Ambient Occlusion]]></category>
		<category><![CDATA[AO]]></category>
		<category><![CDATA[GPU]]></category>
		<category><![CDATA[Pixel Bender]]></category>
		<category><![CDATA[Raytracing]]></category>
		<category><![CDATA[rendering]]></category>

		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=426</guid>
		<description><![CDATA[<a href="http://www.smart-page.net/blog/2009/09/27/gpu-based-raytracing-with-pixel-bender-and-after-effects/" title="GPU based Raytracing with Pixel Bender and After Effects"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/afx1.bvtxxmsuo4gkogg404kgs8c4g.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="GPU based Raytracing with Pixel Bender and After Effects" style="float:left;padding:0 10px 10px 0;" ></a>Since some years the idea of harnessing the power of modern graphic cards for 2D/3D applications has become more and more popular.
Today we find GPU support in many CG applications like Photoshop or After Effects.
But first the fun part: Watch a video raytraced with PB and AFX!
 The chaos group is even working on a [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.smart-page.net/blog/2009/09/27/gpu-based-raytracing-with-pixel-bender-and-after-effects/" title="GPU based Raytracing with Pixel Bender and After Effects"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/afx1.bvtxxmsuo4gkogg404kgs8c4g.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="GPU based Raytracing with Pixel Bender and After Effects" style="float:left;padding:0 10px 10px 0;" ></a><p>Since some years the idea of harnessing the power of modern graphic cards for 2D/3D applications has become more and more popular.</p>
<p>Today we find GPU support in many CG applications like Photoshop or After Effects.</p>
<p><b>But first the fun part: <a href="http://www.vconverter.de/?file=rt_aa_ao" target="_blank">Watch a video raytraced with PB and AFX!</a></b></p>
<p><span id="more-426"></span> The <a href="http://www.chaosgroup.com" target="_blank">chaos group</a> is even working on a GPU based real time version of Vray &#8211; a widely used modern GI raytracer.</p>
<p>In fact GPU shading is often more performant plus it quasi &#8216;adds&#8217; an unused/inactive processor.</p>
<p>One could argue that Pixel Bender doesn´t quite fit the term as its mostly run in software mode (on the CPU) &#8211; for<br />
example when executing a PB shader in Flash or rendering it with AFX&#8230; for now.</p>
<p>But PB is still young and the prospect of being able to run it within multiple adobe platforms (Flash,PS,AFX) is very compelling.</p>
<p>When I saw <a href="http://www.subblue.com/blog/2009/9/20/quaternion_julia" target="_blank">Tom Beddard´s PB port</a> of Keenan Crane&#8217;s genius julia set tracer, I remembered that I had planned to get into PB GPU raytracing once I got around <a href="http://mike.newgrounds.com/news/post/156863" target="_blank">Mike Welsh´s PB raytracer</a>.</p>
<p>So I spend some time with it, created a scene similar to &#8216;<a href="http://www.smart-page.de/as3d/sp_theeye/" target="_blank">The Eye&#8217;</a> and added viewport controls as well as anti aliasing.</p>
<p>The result can be viewed <a href="http://www.vconverter.de/?file=rt_aa_ao" target="_blank">here</a>.</p>
<p><em>Rendertime was 3:10 on a Q6600 for 4700 frames.</em></p>
<p>And <a href="http://www.smart-page.net/as3/sp_smartray/SmartRayTracer.pbk" target="_blank">here</a> is the modified shader.</p>
<p>I also fiddled around with adding an inside-out AO (<a href="http://en.wikipedia.org/wiki/Ambient_occlusion" target="_blank">ambient occlusion</a>) pass but wasn´t able to get satisfying results.<br />
It even almost fried my GPU in the process so in conclusion it’s doable but sadly not practical.</p>
<p><img class="alignnone size-full wp-image-443" title="ao2" src="http://www.smart-page.net/blog/wp-content/uploads/2009/09/ao2.jpg" alt="ao2" width="426" height="210" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-page.net/blog/2009/09/27/gpu-based-raytracing-with-pixel-bender-and-after-effects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strange Attractor Finder and C4D/PY4D Particle Bench</title>
		<link>http://www.smart-page.net/blog/2009/09/15/strange-attractor-c4dpy4d-particle-bench/</link>
		<comments>http://www.smart-page.net/blog/2009/09/15/strange-attractor-c4dpy4d-particle-bench/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 14:52:51 +0000</pubDate>
		<dc:creator>flashgordon</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Bench]]></category>
		<category><![CDATA[C4D]]></category>
		<category><![CDATA[cinema 4D]]></category>
		<category><![CDATA[Generator]]></category>
		<category><![CDATA[Lyapunov]]></category>
		<category><![CDATA[Particles]]></category>
		<category><![CDATA[py4d]]></category>
		<category><![CDATA[Strange Attractor]]></category>
		<category><![CDATA[Strange Attractor Finder]]></category>

		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=399</guid>
		<description><![CDATA[<a href="http://www.smart-page.net/blog/2009/09/15/strange-attractor-c4dpy4d-particle-bench/" title="Strange Attractor Finder and C4D/PY4D Particle Bench"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/sa_copy1.ekeje4pv6xw0gogg4skkwcogo.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="Strange Attractor Finder and C4D/PY4D Particle Bench" style="float:left;padding:0 10px 10px 0;" ></a>Strange attractors are fractals that emerge at certain, sensitive parameters within the three-or more dimensional phase space.
They are are researched since the early 70s and strongly related to the chaos theory as they allow to watch the transition from chaos to order/geometry.
Good things first: see the result and try the chaotic attractor finder!


The 3D visualization [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.smart-page.net/blog/2009/09/15/strange-attractor-c4dpy4d-particle-bench/" title="Strange Attractor Finder and C4D/PY4D Particle Bench"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/sa_copy1.ekeje4pv6xw0gogg4skkwcogo.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="Strange Attractor Finder and C4D/PY4D Particle Bench" style="float:left;padding:0 10px 10px 0;" ></a><p>Strange attractors are fractals that emerge at certain, sensitive parameters within the three-or more dimensional phase space.</p>
<p>They are are researched since the early 70s and strongly related to the chaos theory as they allow to watch the transition from chaos to order/geometry.</p>
<p><b>Good things first: <a href="http://www.vconverter.de/?file=strangeattractor" target="_blank">see the result</a> and try the <a href="http://www.smart-page.net/as3/sp_safinder/" target="_blank">chaotic attractor finder!</a></b></p>
<p><span id="more-399"></span></p>
<p><a href="http://www.smart-page.net/as3/sp_safinder/" target="_blank"><img class="alignnone size-full wp-image-417" title="sas" src="http://www.smart-page.net/blog/wp-content/uploads/2009/09/sas.jpg" alt="sas" width="596" height="157" /></a></p>
<p>The 3D visualization of a strange attractor is quite resource intensive as points race around the attractors on chaotic trajectories &#8211; so it needs many iterations or particles to see a shape emerge from that chaos.</p>
<p>There are already some <a href="http://www.unitzeroone.com/blog/2009/03/18/flash-10-massive-amounts-of-3d-particles-with-alchemy-source-included/" target="_blank">great flash experiments</a> so I turned to Cinema 4D and <a href="http://www.py4d.com/" target="_blank">PY4D</a> as an advanced renderer would easily allow to raytrace and shadow the results &#8211; and to calculate even more particles of course.</p>
<p><a href="http://www.smart-page.net/py4d/sp_strange/sp_strange_attractor_py4d.txt" target="_blank">This small PY4D script</a> creates a strange attractor that Dr. Clifford Pickover had published 1990.</p>
<p>Unfortunately I had to discover that the bottleneck at C4D wasn´t the rendering of vast amounts of vertices but the allocation of many particle objects.</p>
<p>I managed to render a maximum of 50.000 particles with the R11 before C4D outmaxed my systems ram (4GB).</p>
<p>Thats less than a sixth of what can be rendered realtime with flash.<br />
Admitted that comparison is unfair for many reasons, still&#8230; there is a point.</p>
<p>But with the new R11.5 release Maxon introduced render instances to C4D allowing now to calculate up to millions of particles &#8211; depending on the system.</p>
<p>Sadly I was limited to 300.000 points so I seeded the attractor parameters and rendered four transparent animations that could be combined to a 1.2 million particle video.</p>
<p>The preparation time for each frame was ~1min while PY4D took less than a second of that duration to perform five sinus/cosinus operations for each point.<br />
Rendering itself took about five seconds per frame (CPU:Q6600).<br />
Also its worth mentioning that the viewport can actually draw more particles that C4D is able to render.</p>
<p>It would be interesting to see how for example POVRay or Blender would perform when faced with this task.</p>
<p>If you are interested you can <a href="http://www.smart-page.net/py4d/sp_strange/sp_strange_attractor_py4d.c4d">download the szenefile</a> here.<br />
(Remember to activate render instances in the PShape node of the XPresso tag when using the R11.5).</p>
<p><span style="color: #ff9900;"><strong>Update:</strong></span></p>
<p>I already knew that 3D Studio Max and Softimage could handle several millions of particles but i was surprised to hear that Maya seams to have similar problems like C4D.<br />
I also gave Blender a shot and managed to preview and render over a million with ease.</p>
<p>When I learned that you can actually identify strange attractors using the  <a href="http://en.wikipedia.org/wiki/Lyapunov_exponent" target="_blank">Lyapunov exponent</a> and found <a href="http://technocosm.org/chaos/attr-part2.html" target="_blank">John Holder´s</a> programm &#8216;lyapdemo.c&#8217;, I took a few minutes to <a href="http://www.smart-page.net/as3/sp_safinder/" target="_blank">port it to AS3</a>.<br />
So I can find more fascinating attractors for further experiments (most likely with blender) and you can use it to generate parameters for the PY4D script aswell.<a href="http://technocosm.org/chaos/attr-part2.html" target="_blank"><br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-page.net/blog/2009/09/15/strange-attractor-c4dpy4d-particle-bench/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>PY4D Boids</title>
		<link>http://www.smart-page.net/blog/2009/08/07/py4d-boids/</link>
		<comments>http://www.smart-page.net/blog/2009/08/07/py4d-boids/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 17:17:02 +0000</pubDate>
		<dc:creator>flashgordon</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[boids]]></category>
		<category><![CDATA[cinema 4D]]></category>
		<category><![CDATA[flocking]]></category>
		<category><![CDATA[py4d]]></category>

		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=309</guid>
		<description><![CDATA[<a href="http://www.smart-page.net/blog/2009/08/07/py4d-boids/" title="PY4D Boids"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/py4dboidsjpg.abn6nn944204og4sgk04ss080.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="PY4D Boids" style="float:left;padding:0 10px 10px 0;" ></a>Sebastian Rath´s PY4D is a new, alternative way to script with or to code plugins for Cinema4D &#8211; without COFFE or C++ &#8211; but in Python.
The current beta (v0.9.0001) already makes a fine impression and proves itself easy to get started with.
This video shows a little script that was adapted in a twinkling and controls [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.smart-page.net/blog/2009/08/07/py4d-boids/" title="PY4D Boids"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/py4dboidsjpg.abn6nn944204og4sgk04ss080.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="PY4D Boids" style="float:left;padding:0 10px 10px 0;" ></a><p>Sebastian Rath´s <a href="http://py4d.xpresso24.com" target="_blank">PY4D</a> is a new, alternative way to script with or to code plugins for Cinema4D &#8211; without COFFE or C++ &#8211; but in Python.</p>
<p>The current beta (v0.9.0001) already makes a fine impression and proves itself easy to get started with.</p>
<p><b><a href="http://www.vconverter.de/?file=fishboids" target="_blank">This video</a></b> shows a little script that was adapted in a twinkling and controls the particles of a TP-Storm to behave after the three flocking boids rules.<a href="http://www.py4d.com/2009/08/there-comming/" target="_blank"><br />
Don</a> has rendered a <b><a href="http://www.vconverter.de/?file=tunaboids" target="_blank">much prettyer version</a></b> of the dummy above.</p>
<p>You can download the C4D-scene <a href="http://www.smart-page.net/py4d/sp_boids/Boids4PY4D.c4d">here</a> or view the <a href="http://www.smart-page.net/py4d/sp_boids/Boids4PY4D.txt" target="_blank">scriptfile</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-page.net/blog/2009/08/07/py4d-boids/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Metabubbles</title>
		<link>http://www.smart-page.net/blog/2009/04/09/metabubbles/</link>
		<comments>http://www.smart-page.net/blog/2009/04/09/metabubbles/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 19:01:15 +0000</pubDate>
		<dc:creator>flashgordon</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[Papervision]]></category>
		<category><![CDATA[Additive]]></category>
		<category><![CDATA[Audiovisualisation]]></category>
		<category><![CDATA[Blendmode]]></category>
		<category><![CDATA[Lava Lamp]]></category>
		<category><![CDATA[Psychedelic]]></category>

		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=262</guid>
		<description><![CDATA[<a href="http://www.smart-page.net/blog/2009/04/09/metabubbles/" title="Metabubbles"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/clipboard01_copy.49gz3bdymzggg4sg840wgoo84.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="Metabubbles" style="float:left;padding:0 10px 10px 0;" ></a>This little 3D experiment is called Metabubbles as it´s behavior and look are quite similar to those of real metaballs.
In fact it is just PV3D ViewportLayers with the blend-mode &#8220;add&#8221; that produce those gooey effects when balls with a similar z-depth pass each other &#8211; &#8220;old school&#8221;.
The cpu-load is quite high but the result is [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.smart-page.net/blog/2009/04/09/metabubbles/" title="Metabubbles"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/clipboard01_copy.49gz3bdymzggg4sg840wgoo84.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="Metabubbles" style="float:left;padding:0 10px 10px 0;" ></a><p><b><a href="http://www.smart-page.de/as3d/sp_metabubbles" target="_blank">This little 3D experiment </a></b>is called Metabubbles as it´s behavior and look are quite similar to those of real metaballs.</p>
<p>In fact it is just PV3D ViewportLayers with the blend-mode &#8220;add&#8221; that produce those gooey effects when balls with a similar z-depth pass each other &#8211; &#8220;old school&#8221;.</p>
<p>The cpu-load is quite high but the result is as psychedelic and relaxing as watching a lava-lamp&#8230;</p>
<p><a href="http://www.smart-page.de/as3d/sp_metabubbles" target="_blank">Sit back and take a time out &#8230;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-page.net/blog/2009/04/09/metabubbles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smart Normal goes Pixel Bender</title>
		<link>http://www.smart-page.net/blog/2009/02/22/pixel-bender-realtime-normalmap/</link>
		<comments>http://www.smart-page.net/blog/2009/02/22/pixel-bender-realtime-normalmap/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 01:29:23 +0000</pubDate>
		<dc:creator>flashgordon</dc:creator>
				<category><![CDATA[3D]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[After Effects]]></category>
		<category><![CDATA[CS4]]></category>
		<category><![CDATA[DOT3]]></category>
		<category><![CDATA[Filter]]></category>
		<category><![CDATA[Normalmap]]></category>
		<category><![CDATA[Photoshop]]></category>
		<category><![CDATA[Pixel Bender]]></category>
		<category><![CDATA[Shader]]></category>
		<category><![CDATA[Sobel]]></category>

		<guid isPermaLink="false">http://www.smart-page.net/blog/?p=185</guid>
		<description><![CDATA[<a href="http://www.smart-page.net/blog/2009/02/22/pixel-bender-realtime-normalmap/" title="Smart Normal goes Pixel Bender"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/smartnormal.2b7vz66gmdwk4cko0os0gocgs.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="Smart Normal goes Pixel Bender" style="float:left;padding:0 10px 10px 0;" ></a>With CS4 Adobe introduced Pixel Bender to Flash, After FX and Photoshop. Pixel Bender allows to easily write and test filters witch are finally compiled to bytecode (Flash) or machine code (AFX).
For the new version of Smart Normal, its sobel-edge shader got portet to PB &#8211; making it blazing fast. Its even possible to use [...]]]></description>
			<content:encoded><![CDATA[<a href="http://www.smart-page.net/blog/2009/02/22/pixel-bender-realtime-normalmap/" title="Smart Normal goes Pixel Bender"><img src="http://www.smart-page.net/blog/wp-content/uploads/yapb_cache/smartnormal.2b7vz66gmdwk4cko0os0gocgs.h9fw4mcunnwo4cowc8k4840k.th.jpeg" width="200" height="150" alt="Smart Normal goes Pixel Bender" style="float:left;padding:0 10px 10px 0;" ></a><p>With CS4 Adobe introduced Pixel Bender to Flash, After FX and Photoshop. Pixel Bender allows to easily write and test filters witch are finally compiled to bytecode (Flash) or machine code (AFX).</p>
<p>For the new version of <a href="http://www.smart-page.net/smartnormal" target="_blank">Smart Normal</a>, its sobel-edge shader got portet to PB &#8211; making it blazing fast. Its even possible to use it <a href="http://www.smart-page.net/as3/sp_smartnormalmap" target="_blank">for realtime shading</a>.</p>
<p>Want to use Smart Normal directly within After Effects or Photoshop (CS4) ? <b><a href="http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&amp;loc=en_us&amp;extid=1817528" target="_blank">Just grab it from Adobe Exchange</a></b> and drag it into your plugin-directory.<br />
(Photoshop needs the <a href="http://labs.adobe.com/downloads/pixelbender.html" target="_blank">Pixel Bender Plugin</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-page.net/blog/2009/02/22/pixel-bender-realtime-normalmap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
