<?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>toto.interactive</title>
	<atom:link href="http://www.tobias-tost.de/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.tobias-tost.de</link>
	<description></description>
	<lastBuildDate>Thu, 16 Jun 2011 13:44:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Game Updates</title>
		<link>http://www.tobias-tost.de/?p=543</link>
		<comments>http://www.tobias-tost.de/?p=543#comments</comments>
		<pubDate>Thu, 16 Jun 2011 13:44:34 +0000</pubDate>
		<dc:creator>ttost</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://www.tobias-tost.de/?p=543</guid>
		<description><![CDATA[With the Android market becoming more crowded, it is not as easy to become noticed anymore. While my games all got updated due to new AdMob and scoreloop libraries, the download counts decrease with each update. Also, it is very &#8230; <a href="http://www.tobias-tost.de/?p=543">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-247" title="Android-Logo-36x40" src="http://www.tobias-tost.de/wp-content/uploads/Android-Logo-36x40.jpg" alt="" width="36" height="40" />With the Android market becoming more crowded, it is not as easy to become noticed anymore. While my games all got updated due to new AdMob and scoreloop libraries, the download counts decrease with each update.<br />
<span id="more-543"></span><br />
Also, it is very hard to place a small app in the market with  a fair price, because you have to charge 0.99 $ at least (0.50 €), even if you as a developer know that this might be more expensive than the value you&#8217;re able to deliver.</p>
<p>This results in unhappy clients and very bad download counts for small, paid apps like Light Mayhem. To face this fact, I decided to remove the commercial version and merge scoreloop integration into the free app, monetizing with AdMob, again.</p>
<p>The direction, this experiment tends to point to, is not the most pleasing &#8211; even Paper Wars which was quite strong through the last months, tends to decrease ad impressions by a great amount. After all, I&#8217;m quite happy that I did not decide to go to self-employment for app-development. You will not be able to place a hit with no or low budget, anymore &#8211; good for customers because quality improved a lot during the last year, but bad for the lone developer who has no big budget to spend for art and sound.</p>
<p>Anyway, I will continue to support my games as long as it is possible in my spare time. Maybe there will come some content updates as well, but do not expect any major releases any more.</p>
<p>Big thanks go out to everyone who tried my games and was able to give some objective feedback by market comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobias-tost.de/?feed=rss2&#038;p=543</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android updates</title>
		<link>http://www.tobias-tost.de/?p=533</link>
		<comments>http://www.tobias-tost.de/?p=533#comments</comments>
		<pubDate>Mon, 11 Apr 2011 12:21:04 +0000</pubDate>
		<dc:creator>ttost</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Light Mayhem]]></category>
		<category><![CDATA[Paper Wars]]></category>
		<category><![CDATA[Update]]></category>

		<guid isPermaLink="false">http://www.tobias-tost.de/?p=533</guid>
		<description><![CDATA[During the last weeks, several rather big overhauls got through my whole android game codebase. Besides a noticeably improved  performance in Paper Wars, battle.aerobics and grav-o-balls, the result is a new game being launched: Light Mayhem. This my the first game to &#8230; <a href="http://www.tobias-tost.de/?p=533">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-523" title="icon" src="http://www.tobias-tost.de/wp-content/uploads/icon4.png" alt="" width="72" height="72" />During the last weeks, several rather big overhauls got through my whole android game codebase. Besides a noticeably improved  performance in Paper Wars, battle.aerobics and grav-o-balls, the result is a new game being launched: <a title="Android updates" href="http://www.tobias-tost.de/?p=533">Light Mayhem</a>.<span id="more-533"></span><br />
This my the first game to use a 3D OpenGL ES viewport &#8211; and it got the most polishing done at launch compared with the other projects that were more or less rushed to the market after a degree of playability.</p>
<p><a href="http://www.tobias-tost.de/wp-content/uploads/icon1.png" rel="wp-prettyPhoto[g533]"><img class="alignright size-full wp-image-160" title="Paper Wars Icon" src="http://www.tobias-tost.de/wp-content/uploads/icon1.png" alt="" width="72" height="72" /></a>Paper Wars got a huge update today and a lot of the code base was streamlined to the other titles. This means that a lot of code is currently shared which makes maintenance and updates easier and faster. This update is the preparation for some content updates to get into the game, later.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobias-tost.de/?feed=rss2&#038;p=533</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grav-o-Balls got final</title>
		<link>http://www.tobias-tost.de/?p=512</link>
		<comments>http://www.tobias-tost.de/?p=512#comments</comments>
		<pubDate>Wed, 02 Mar 2011 20:16:29 +0000</pubDate>
		<dc:creator>ttost</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Grav-O-Balls]]></category>

		<guid isPermaLink="false">http://www.tobias-tost.de/?p=512</guid>
		<description><![CDATA[After a lengthy beta-phase, Grav-O-Balls finally matured to a v 1.0 release-state. While I&#8217;m currently a bit annoyed by the android market comment system &#8211; very few &#8220;helping&#8221; words there, lots of almost insulting statements. Anyway &#8211; I&#8217;m happy that &#8230; <a href="http://www.tobias-tost.de/?p=512">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After a lengthy beta-phase, Grav-O-Balls finally matured to a v 1.0 release-state. <a href="http://www.tobias-tost.de/wp-content/uploads/icon3.png" rel="wp-prettyPhoto[g512]"><img class="alignright size-full wp-image-409" title="Grav-O-Balls icon" src="http://www.tobias-tost.de/wp-content/uploads/icon3.png" alt="" width="72" height="72" /></a>While I&#8217;m currently a bit annoyed by the android market comment system &#8211; very few &#8220;helping&#8221; words there, lots of almost insulting statements.</p>
<p>Anyway &#8211; I&#8217;m happy that the game made it this far!<span id="more-512"></span>This patch fixed a usability issue where it was possible to place balls while being in &#8220;level complete&#8221; screen. Additionally, sounds were added to the game &#8211; sounds in the sense of &#8220;something to start with&#8221;. <img src='http://www.tobias-tost.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Finally, the coarse-location-permission was removed as well &#8211; it was only needed for admob but did not made any difference. Thus less permissions, more convenience.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobias-tost.de/?feed=rss2&#038;p=512</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Still breathing &#8211; and updating</title>
		<link>http://www.tobias-tost.de/?p=507</link>
		<comments>http://www.tobias-tost.de/?p=507#comments</comments>
		<pubDate>Thu, 17 Feb 2011 07:40:41 +0000</pubDate>
		<dc:creator>ttost</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Paper Wars]]></category>
		<category><![CDATA[Update]]></category>

		<guid isPermaLink="false">http://www.tobias-tost.de/?p=507</guid>
		<description><![CDATA[After being busy with things other than Android programming, I finally got a new update for Paper Wars published. The game has been surprisingly popular even after being online quite a while. 120983 downloads in 10 months &#8211; not too &#8230; <a href="http://www.tobias-tost.de/?p=507">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-160" title="Paper Wars Icon" src="http://www.tobias-tost.de/wp-content/uploads/icon1.png" alt="" width="72" height="72" /></p>
<p>After being busy with things other than Android programming, I finally got a new update for Paper Wars published. The game has been surprisingly popular even after being online quite a while. 120983 downloads in 10 months &#8211; not too bad for being a hobby project.<span id="more-507"></span>Install base is about 25000 using android market, which is surprisingly high as well. So</p>
<p>maybe time is right to start working on a content update sooner than later? <img src='http://www.tobias-tost.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Update v1.19 should fix two crash bugs that seemed to happen on multi-touch devices. Additionally, I removed the coarse-location permission since it was only needed for admob and did not make much of a difference from a ad-view and click-count point of view.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobias-tost.de/?feed=rss2&#038;p=507</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Game live!</title>
		<link>http://www.tobias-tost.de/?p=408</link>
		<comments>http://www.tobias-tost.de/?p=408#comments</comments>
		<pubDate>Thu, 18 Nov 2010 20:29:47 +0000</pubDate>
		<dc:creator>ttost</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Game Development]]></category>
		<category><![CDATA[Grav-O-Balls]]></category>

		<guid isPermaLink="false">http://www.tobias-tost.de/?p=408</guid>
		<description><![CDATA[As the last blog about scoreloop was promising: a new project was about to go live. This time, it&#8217;s a physic-based game to exploit android devices capabilities a bit more.There are two major features I&#8217;m quite proud of: motion blur &#8230; <a href="http://www.tobias-tost.de/?p=408">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-409" title="Grav-O-Balls icon" src="http://www.tobias-tost.de/wp-content/uploads/icon3.png" alt="" width="72" height="72" />As the last blog about scoreloop was promising: a new project was about to go live. This time, it&#8217;s a physic-based game to exploit android devices capabilities a bit more.<span id="more-408"></span>There are two major features I&#8217;m quite proud of: motion blur and scoreloop. Motion blur is exploiting the graphics capabilities of the current android devices &#8211; sadly not as visually pleasing as the PC version jut because current OpenGL ES implementation is using a 16 Bit color mode. This causes some not-so-nice banding under certain conditions and edges looking darker than they should.</p>
<p>And last but not least, the scoreloop integration was easier and looks more promising than originally thought. Besides the online high scores, there are numerous really cool features waiting to be integrated&#8230; like challenging other people or social network integrations.</p>
<p>More information about the game can be found <a title="Grav-O-Balls" href="http://www.tobias-tost.de/?page_id=406">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobias-tost.de/?feed=rss2&#038;p=408</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ScoreLoop integration for the next Android project</title>
		<link>http://www.tobias-tost.de/?p=390</link>
		<comments>http://www.tobias-tost.de/?p=390#comments</comments>
		<pubDate>Mon, 15 Nov 2010 13:55:02 +0000</pubDate>
		<dc:creator>ttost</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[ScoreLoop]]></category>
		<category><![CDATA[Threads]]></category>

		<guid isPermaLink="false">http://www.tobias-tost.de/?p=390</guid>
		<description><![CDATA[For Paper Wars, I already did a aHighscore integration because it is was really easy to handle and fast to implement. But it is rather limited as well because it is a hobby project. Thus a new online-feature backend has &#8230; <a href="http://www.tobias-tost.de/?p=390">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tobias-tost.de/wp-content/uploads/sl_icon_badge_124.png" rel="wp-prettyPhoto[g390]"><img class="alignright size-full wp-image-391" title="sl_icon_badge_124" src="http://www.tobias-tost.de/wp-content/uploads/sl_icon_badge_124.png" alt="" width="124" height="80" /></a>For Paper Wars, I already did a aHighscore integration because it is was really easy to handle and fast to implement. But it is rather limited as well because it is a hobby project. Thus a new online-feature backend has been chosen for the next project.<br />
<span id="more-390"></span>The complete framework is quite extensive &#8211; if you take a look to <a href="http://www.scoreloop.com/">http://www.scoreloop.com/</a> you&#8217;ll find out that there are much more things supported than just highscores. This is quite challenging as well &#8211; for a proper integration, you might need to create certain game functionality just to match scoreloop features like friend lists, challenges, highscores and maybe even in-game currency.</p>
<p>For my next project &#8211; which is about to go to public beta, soon &#8211; I decided to start with high-score integration but move on to support much more functionalities later. Because I am using a OpenGL renderer, I can&#8217;t use the CoreUI Package which provides a nice pre-built UI. My architecture is built to support platform-independence. This means:</p>
<p>Platform Application-&gt;Game Instance</p>
<p>To make internal communication in the game easier, the Game Instance is a singleton that gets created by the platform dependent application which also creates a update thread and calls a render method of the game. This is quite efficient and flexible &#8211; I&#8217;m still able to create the whole game mechanics on the Desktop with faster turn-around times and easier debugging and switch to mobile devices once I need.</p>
<p>The problem with scoreloop: it must be called by the main thread of the android application &#8211; which is the starting activity. But for my projects, I have three threads running:</p>
<ol>
<li>The Main Activity</li>
<li>The Update Thread</li>
<li>The OpenGL Thread</li>
</ol>
<p>Number 2+3 are the actual game instance, which is knowing nothing of thread 1. If things go wrong, funny error messages like this are likely to be thrown to the DDMS:</p>
<blockquote><p>11-15 10:54:45.493: INFO/dalvikvm(11024): WOW: somebody generated [Landroid/server/data/StackTraceElementData; simultaneously</p></blockquote>
<p>This happens when an issue is causing my threads 2 and 3 to crash &#8211; something like updating and rendering a null pointer. Luckily, the android developers already had a good idea to handle issues like this: the message handler system. This persistent message system if manages state switches by the activities.</p>
<p>The rendering of the scoreloop results happens in the Game interface, but how is it possible to get the data there, if you must access the scoreloop client by the main thread?</p>
<ol>
<li>Create a new message in the update-thread that sends the request to poll data from the scoreloop client</li>
<li>Fetch the message in the main thread and trigger a ScoresControllerObserver</li>
<li>Display a wait-dialog until a response from the scoreloop server arrives</li>
<li>push the retrieved data into the game instance</li>
<li>update and render the game user interface</li>
</ol>
<p>Of cause I can&#8217;t easily call a method to push the retrieved data into the game &#8211; chances are high that 5th step interferes with the game update and render calles (remember: the push into the game happenes by thread 1 while threads 2 and 3 are still working). But this problem can easily be solved by synchronizing the update, render and push-methods like this:</p>
<pre class="brush:java">public synchronized void updateScores(LinkedList scoreResults) {};
public synchronized void update() {};
public synchronized void render(){};</pre>
<p>Well &#8211; if this solution works for things like challenges might be arguable at the moment. But at least it provides a defined interface to get the scoreloop data into the OpenGL game.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobias-tost.de/?feed=rss2&#038;p=390</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Android Updates</title>
		<link>http://www.tobias-tost.de/?p=311</link>
		<comments>http://www.tobias-tost.de/?p=311#comments</comments>
		<pubDate>Thu, 07 Oct 2010 17:15:23 +0000</pubDate>
		<dc:creator>ttost</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[BattleAerobics]]></category>
		<category><![CDATA[Paper Wars]]></category>
		<category><![CDATA[Update]]></category>

		<guid isPermaLink="false">http://www.tobias-tost.de/?p=311</guid>
		<description><![CDATA[The latest updates for Paper Wars and battle.aerobics arrived. Besides some crashes that got fixed, both applications can now be installed to the SD-Card. Since this functionality works only on Android 2.2 and higher, a similar trick to the Paper &#8230; <a href="http://www.tobias-tost.de/?p=311">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-307" title="Battle.Aerobics logo" src="http://www.tobias-tost.de/wp-content/uploads/icon2.png" alt="" width="72" height="72" /><img class="alignright size-full wp-image-160" title="Paper Wars Icon" src="http://www.tobias-tost.de/wp-content/uploads/icon1.png" alt="" width="72" height="72" />The latest updates for Paper Wars and battle.aerobics arrived.</p>
<p><span id="more-311"></span>Besides some crashes that got fixed, both applications can now be installed to the SD-Card.</p>
<p>Since this functionality works only on Android 2.2 and higher, a similar trick to the Paper Wars multi-touch support has been used: the Applications are linked against SDK version 8, while min-SDK stays 4 (Android 1.6) which means that the apps still support older devices.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobias-tost.de/?feed=rss2&#038;p=311</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Battle.Aerobics update</title>
		<link>http://www.tobias-tost.de/?p=304</link>
		<comments>http://www.tobias-tost.de/?p=304#comments</comments>
		<pubDate>Wed, 22 Sep 2010 18:39:06 +0000</pubDate>
		<dc:creator>ttost</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[BattleAerobics]]></category>
		<category><![CDATA[Update]]></category>

		<guid isPermaLink="false">http://www.tobias-tost.de/?p=304</guid>
		<description><![CDATA[Version 1.1 of battle.aerobics has been released to the android marketplace. This maintenance patch is finally adding the soundtrack &#8211; the data was shipped some weeks, already, but there were issues during playback. Also, the enemy tanks are behaving as &#8230; <a href="http://www.tobias-tost.de/?p=304">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Version 1.1 of battle.aerobics has been<img class="alignright size-full wp-image-307" title="Battle.Aerobics logo" src="http://www.tobias-tost.de/wp-content/uploads/icon2.png" alt="" width="72" height="72" /> released to the android marketplace.</p>
<p>This maintenance patch is finally adding the soundtrack &#8211; the data was shipped some weeks, already, but there were issues during playback. Also, the enemy tanks are behaving as expected and several crashes have been fixed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tobias-tost.de/?feed=rss2&#038;p=304</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Paris Short Trip</title>
		<link>http://www.tobias-tost.de/?p=286</link>
		<comments>http://www.tobias-tost.de/?p=286#comments</comments>
		<pubDate>Fri, 17 Sep 2010 08:32:23 +0000</pubDate>
		<dc:creator>ttost</dc:creator>
				<category><![CDATA[Photography]]></category>

		<guid isPermaLink="false">http://www.tobias-tost.de/?p=286</guid>
		<description><![CDATA[Some impressions from a short trip to Paris.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tobias-tost.de/wp-content/uploads/P5154503.jpg" rel="wp-prettyPhoto[g286]"><img class="alignright size-thumbnail wp-image-287" title="OLYMPUS DIGITAL CAMERA" src="http://www.tobias-tost.de/wp-content/uploads/P5154503-150x150.jpg" alt="" width="150" height="150" /></a>Some impressions from a short trip to Paris.<span id="more-286"></span></p>
<div id="attachment_288" class="wp-caption alignnone" style="width: 310px"><a href="http://www.tobias-tost.de/wp-content/uploads/P5154527.jpg" rel="wp-prettyPhoto[g286]"><img class="size-medium wp-image-288" title="OLYMPUS DIGITAL CAMERA" src="http://www.tobias-tost.de/wp-content/uploads/P5154527-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Palais de Chaillot and La Défense</p></div>
<div id="attachment_290" class="wp-caption alignnone" style="width: 310px"><a href="http://www.tobias-tost.de/wp-content/uploads/P5164817.jpg" rel="wp-prettyPhoto[g286]"><img class="size-medium wp-image-290" title="OLYMPUS DIGITAL CAMERA" src="http://www.tobias-tost.de/wp-content/uploads/P5164817-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Typical: Showmen and street vendors</p></div>
<div id="attachment_289" class="wp-caption alignnone" style="width: 310px"><a href="http://www.tobias-tost.de/wp-content/uploads/P5154731.jpg" rel="wp-prettyPhoto[g286]"><img class="size-medium wp-image-289" title="OLYMPUS DIGITAL CAMERA" src="http://www.tobias-tost.de/wp-content/uploads/P5154731-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">musicians in Montmartre</p></div>
<div id="attachment_291" class="wp-caption alignnone" style="width: 310px"><a href="http://www.tobias-tost.de/wp-content/uploads/P5164987.jpg" rel="wp-prettyPhoto[g286]"><img class="size-medium wp-image-291" title="OLYMPUS DIGITAL CAMERA" src="http://www.tobias-tost.de/wp-content/uploads/P5164987-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Notre Dame with art vendors</p></div>
<div id="attachment_292" class="wp-caption alignnone" style="width: 310px"><a href="http://www.tobias-tost.de/wp-content/uploads/P5154652.jpg" rel="wp-prettyPhoto[g286]"><img class="size-medium wp-image-292" title="OLYMPUS DIGITAL CAMERA" src="http://www.tobias-tost.de/wp-content/uploads/P5154652-300x225.jpg" alt="" width="300" height="225" /></a><p class="wp-caption-text">Market at Place Louis Lépine</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.tobias-tost.de/?feed=rss2&#038;p=286</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fast and Simple 2-Pass Depth of Field</title>
		<link>http://www.tobias-tost.de/?p=276</link>
		<comments>http://www.tobias-tost.de/?p=276#comments</comments>
		<pubDate>Fri, 17 Sep 2010 08:10:03 +0000</pubDate>
		<dc:creator>ttost</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[GLSL]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Postprocessing]]></category>

		<guid isPermaLink="false">http://www.tobias-tost.de/?p=276</guid>
		<description><![CDATA[Depth of Field is a photographic effect caused by aperture and focal length. A very interesting article about this topic has been published in istockphoto.com. It provides a reliable depth-cue for two-dimensional, projected material. In other words: It makes pictures &#8230; <a href="http://www.tobias-tost.de/?p=276">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tobias-tost.de/wp-content/uploads/gnome-dof.jpg" rel="wp-prettyPhoto[g276]"><img class="alignright size-thumbnail wp-image-277" title="gnome-dof" src="http://www.tobias-tost.de/wp-content/uploads/gnome-dof-150x150.jpg" alt="Gnome Depth-Of-Field" width="150" height="150" /></a>Depth of Field is a photographic effect caused by aperture and focal length. A very interesting article about this topic has been published in <a href="http://www.istockphoto.com/article_view.php?ID=109">istockphoto.com</a>. It provides a reliable depth-cue for two-dimensional, projected material. In other words: It makes pictures look 3D while they&#8217;re still 2D projections.<span id="more-276"></span></p>
<p>In current generation of graphics hardware, it is possible to render a lot of fancy post-processing effects &#8211; an besides soft shadows and the motion blur, depth of field (DOF) might be on of the most often used effect to enhance visual quality. There is a vast coverage on different techniques in creating pleasing DOF effects &#8211; a simple google for &#8220;depth of field shader&#8221; gave me a about 74.000 hits. For a demo I wanted to write, I decided to use a simple, alpha-channel-based approach because it is simple, fast and looks nice.</p>
<p>The idea is easy: If you already have a shader that does things like per-pixel-lighting, just put the depth information into the resulting color&#8217;s alpha channel. All that has to be done in the second pass: render the image again and blur the image with a suitable kernel. As kernel, I chose a Poisson-Disc-Filter with CPU-precomputed data &#8211; this is less &#8220;jaggy&#8221; than using a simple quadratic kernel, giving better visual quality by less samples. To prevent nasty halos around the edges of areas that have high depth-differences, the result is not simply a blurred picture, but the focal-length also controls how much blurred image data get into the final result.</p>
<pre class="brush:c">vec4 vColor = texture2D(sceneMap, gl_TexCoord[0].xy);
float fBlurAmount = abs(vColor.a*2.0-1.0);
float fTexel = 16.0/mapSize;
vec4 vResult;
for (int i=0; i&lt;16; ++i) {
    vResult += texture2D(blurMap, gl_TexCoord[0].xy + fBlurAmount*fTexel*poisson[i].xy*poisson[i].z);
}
vResult/=16.0;
gl_FragColor = mix(vColor, vResult, fBlurAmount);</pre>
<p>I am aware that this approach is quite limited &#8211; as soon as the alpha channel is needed for other effects (like a glow-pass or velocity), it can&#8217;t be used like this. But anyway, I&#8217;m happy with the results. <img src='http://www.tobias-tost.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<table>
<tbody>
<tr>
<td><a href="http://www.tobias-tost.de/wp-content/uploads/dof_demo_1.png" rel="wp-prettyPhoto[g276]"><img class="alignleft size-medium wp-image-279" title="dof_demo_1" src="http://www.tobias-tost.de/wp-content/uploads/dof_demo_1-300x187.png" alt="" width="300" height="187" /></a><a href="http://www.tobias-tost.de/wp-content/uploads/dof_demo_2.png" rel="wp-prettyPhoto[g276]"></a></td>
<td><a href="http://www.tobias-tost.de/wp-content/uploads/dof_demo_2.png" rel="wp-prettyPhoto[g276]"><img class="alignright size-medium wp-image-280" title="dof_demo_2" src="http://www.tobias-tost.de/wp-content/uploads/dof_demo_2-300x187.png" alt="" width="300" height="187" /></a></td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.tobias-tost.de/?feed=rss2&#038;p=276</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
