<?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>mike&#039;s digital anthology &#187; realtime</title>
	<atom:link href="http://blog.mikepan.com/tag/realtime/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mikepan.com</link>
	<description>making visuals with technology</description>
	<lastBuildDate>Fri, 16 Dec 2011 23:20:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>The most understated game engine</title>
		<link>http://blog.mikepan.com/the-most-understated-game-engine/</link>
		<comments>http://blog.mikepan.com/the-most-understated-game-engine/#comments</comments>
		<pubDate>Thu, 19 May 2011 05:22:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[realtime]]></category>

		<guid isPermaLink="false">http://blog.mikepan.com/?p=966</guid>
		<description><![CDATA[Gamekit is fully compatible with Blender, runs on Windows, Mac, Linux, iOS and Android, and uses a completely non restrictive license so you are free to sale your game without worrying about copyright issues. Chances are, you&#8217;ve never heard of &#8230; <a href="http://blog.mikepan.com/the-most-understated-game-engine/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/gamekit/">Gamekit</a> is fully compatible with Blender, runs on Windows, Mac, Linux, iOS and Android, and uses a completely non restrictive license so you are free to sale your game without worrying about copyright issues.</p>
<h1 style="text-align: left;"><span style="color: #c0c0c0;">Chances are, you&#8217;ve never heard of </span><a href="http://code.google.com/p/gamekit/"><span style="color: #c0c0c0;">Gamekit</span></a><span style="color: #c0c0c0;">.</span></h1>
<p>Despite a simple website, and a whole bunch of <a href="http://blenderartists.org/forum/showthread.php?155310-GameKit-new-Blender-game-engine-using-Ogre-Bullet-DirectX-OpenGL-Mac-Linux-iPhone/page32">confused users who want to try gamekit but don&#8217;t know how</a>, gamekit is pretty darn functional already. Within half an hour, you can make a simple 3D game that compiles and runs on an iPhone. It also supports shaders, physics, animation and lua scripting. If you a looking to replace the Blender game engine with something lighter, faster and more modern, take a look at this game engine.</p>
<p>Sure the documentation is a little sparse, but as more artists start using this engine, hopefully we&#8217;ll see more literature on the topic.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/the-most-understated-game-engine/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Realtime GPU accelerated raytracer</title>
		<link>http://blog.mikepan.com/realtime-gpu-accelerated-raytracer/</link>
		<comments>http://blog.mikepan.com/realtime-gpu-accelerated-raytracer/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 10:09:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[gpu]]></category>
		<category><![CDATA[realtime]]></category>
		<category><![CDATA[wow]]></category>

		<guid isPermaLink="false">http://blog.mikepan.com/?p=930</guid>
		<description><![CDATA[I discovered a lot of mind-blowing technologies this week. First I test-drove Ian&#8217;s OpenCL fluid particle implementation by pushing 1 million physically-accurate fluid particles around in realtime. Then I  ran across this jaw-droppingly detailed 3D map. And now, thanks to &#8230; <a href="http://blog.mikepan.com/realtime-gpu-accelerated-raytracer/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I discovered a lot of mind-blowing technologies this week. First I test-drove Ian&#8217;s <a href="http://enja.org/">OpenCL fluid particle</a> implementation by pushing <a href="http://youtu.be/s2QBRazykEA?hd=1">1 million</a> physically-accurate fluid particles around in realtime. Then I  ran across this jaw-droppingly detailed <a href="maps.ovi.com/3d/#landmark-2">3D map</a>. And now, thanks to Brecht&#8217;s latest work on the <a href="http://code.blender.org/index.php/2011/04/modernizing-shading-and-rendering/">Cycles</a> rendering engine for Blender, I am doing raytracing on the GPU in realtime.</p>
<p><img class="alignnone size-medium wp-image-935" title="Cycle GPU Renderer Screenshot" src="http://blog.mikepan.com/wp-content/uploads/Screenshot-1-640x400.png" alt="" width="640" height="400" /></p>
<p>Above is a rendering of my ubiquitous BMW.  The total rendering time to get to this quality is less than 40 seconds. (Compare to over 3 minutes using the old Blender renderer) Even more impressive, is that the rendering takes place in the 3d viewport directly, in a progressive fashion.  So one can edit the scene while the rendering refines itself.</p>
<p>No more F12, rendering just went realtime Yo.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/realtime-gpu-accelerated-raytracer/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Jaw-dropping online 3D Map</title>
		<link>http://blog.mikepan.com/jaw-dropping-online-3d-map/</link>
		<comments>http://blog.mikepan.com/jaw-dropping-online-3d-map/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 06:52:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[future]]></category>
		<category><![CDATA[realtime]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[wow]]></category>

		<guid isPermaLink="false">http://blog.mikepan.com/?p=909</guid>
		<description><![CDATA[&#8220;Any sufficiently advanced technology is indistinguishable from magic.&#8221; &#160; Paul Debevec published his seminal work on image based modelling in 1997, just over 14 years ago. By taking multiple images of an object from different angles, he was able to &#8230; <a href="http://blog.mikepan.com/jaw-dropping-online-3d-map/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2 style="text-align: center;"><span style="color: #888888;">&#8220;Any sufficiently advanced technology is indistinguishable from magic.&#8221;</span></h2>
<p>&nbsp;</p>
<p>Paul Debevec published his seminal work on image based modelling in 1997, just over 14 years ago. By taking multiple images of an object from different angles, he was able to reconstruct the 3D geometry of the bell tower at  UC Berkeley.  Programmatically generating 3D models from 2D images!  It was so revolutionary at the time that the sfx team behind the Matrix movie worked with Paul to use this exact technique in the film.</p>
<p><a href="http://ict.debevec.org/~debevec/Campanile/"><img class="alignnone size-medium wp-image-917" title="Campanile Movie, Paul Debevec" src="http://blog.mikepan.com/wp-content/uploads/camp-640x474.jpg" alt="" width="640" height="474" /></a></p>
<p>Pretty impressive eh?  Now imagine going this for an entire campus, or an entire city, or the entire world.  Without human intervention. At 10cm resolution.</p>
<p>This is what C3 Technology and Nokia came up with, and it runs inside a web browser.</p>
<p><a href="http://maps.ovi.com/3d/#landmark-2"><img class="alignnone size-medium wp-image-918" title="New York City, Ovi 3D" src="http://blog.mikepan.com/wp-content/uploads/nyc-640x377.jpg" alt="" width="640" height="377" /></a></p>
<p>A better writer might be able to describe to you the magnitude of what you are witnessing, but I am truly at a loss at conveying the significance of this to the future of mapping.  Click on the image to see the demo for yourself.  You&#8217;ll need to install a plugin, but it&#8217;s well worth the trouble.  Someone less technically might not fully appreciate the complexity of what&#8217;s going on behind the scene, and as someone who only knows enough to be dangerous, I am still not convinced technology like this even exists today.</p>
<p>Wow.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/jaw-dropping-online-3d-map/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Some more shader experiments</title>
		<link>http://blog.mikepan.com/some-more-shader/</link>
		<comments>http://blog.mikepan.com/some-more-shader/#comments</comments>
		<pubDate>Fri, 17 Dec 2010 23:21:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[realtime]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://blog.mikepan.com/?p=775</guid>
		<description><![CDATA[After seeing Ian&#8217;s latest update on his awesome particles system, I am shifting the focus of my own project a bit, moving away from the goal of making an entire particles engine in the shader to something more attainable: use &#8230; <a href="http://blog.mikepan.com/some-more-shader/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After seeing <a href="http://enja.org/2010/12/16/particles-in-bge-fluids-in-real-time-with-opencl/">Ian&#8217;s </a>latest update on his awesome particles system, I am shifting the focus of my own project a bit, moving away from the goal of making an entire particles engine in the shader to something more attainable: use GLSL shaders for what they are designed for: making visual effects.  Below is attempt at making some abstract art using pure code.  The base shape is a simple plane.</p>
<p><img class="alignnone size-medium wp-image-776" title="Geometry Shader particles" src="http://blog.mikepan.com/wp-content/uploads/IMG_3301-640x426.jpg" alt="" width="640" height="426" /></p>
<p>You might notice that some of the shader code looks strange, that&#8217;s because I am trying to keep things simple by forcing myself to use the latest version of OpenGL Shading Language available on my computer hardware, so for a Geforce 8, that&#8217;s OpenGL 3.3 | GLSL 3.3.<br />
<code><br />
#version 120<br />
#vertex shader</code></p>
<p><code> </code></p>
<p><code>in vec4 vertex;<br />
uniform float timer;</code></p>
<p><code> </code></p>
<p><code>void main() {<br />
vec4 v = vertex;<br />
v.z = sin(timer+v.y+v.x)*0.5+v.z;<br />
v.x = sin(timer*10.0+v.y+v.y)*0.2+v.x;<br />
gl_Position = gl_ModelViewProjectionMatrix * v;<br />
}</code></p>
<p><code>#==========================</code></p>
<p><code>#version 330<br />
#geometry shader</code></p>
<p><code>layout(triangles) in;<br />
layout(triangle_strip) out;<br />
out vec2 texCoord;</code></p>
<p><code>#define radius 0.01<br />
#define layer 1</code></p>
<p><code>void main() {<br />
//for(int i = 0; i &lt; gl_in.length(); i++) {		// avoid duplicate draw</p>
<p>for (int j=0; j&lt;layer; j++){</p>
<p>vec4 p =  gl_in[0].gl_Position;</p>
<p>texCoord = vec2(1.0,1.0);<br />
gl_Position =  vec4(p.r+radius, p.g+radius+j*0.05, p.b, p.a);<br />
EmitVertex();</p>
<p>texCoord = vec2(0.0,1.0);<br />
gl_Position = vec4(p.r-radius, p.g+radius+j*0.05, p.b, p.a);<br />
EmitVertex();</p>
<p>texCoord = vec2(1.0,0.0);<br />
gl_Position = vec4(p.r+radius, p.g-radius+j*0.05, p.b, p.a);<br />
EmitVertex();</p>
<p>texCoord = vec2(0.0,0.0);<br />
gl_Position =  vec4(p.r-radius, p.g-radius+j*0.05, p.b, p.a);<br />
EmitVertex();</p>
<p>EndPrimitive();<br />
}<br />
//}<br />
}</p>
<p>#========================================</p>
<p>#version 330<br />
#fragment shader<br />
in vec2 texCoord;<br />
out vec4 outColor;</p>
<p>uniform sampler2D col;<br />
uniform float emit, alpha;</p>
<p>void main(void) {</p>
<p>// load color texture<br />
vec4 color;<br />
color = texture2D(col, texCoord);</p>
<p>// apply material panel values<br />
color.rgb *= emit;<br />
color.a *= alpha;</p>
<p>outColor =  color;<br />
}</p>
<p></code></p>
<p>&nbsp;</p>
<p>The first section, the vertex shader, is executed for each vertex of the geometry, it is here that I apply the deformation to form the base shape of the particle systems.  The resulting coordinates is projected from modelspace onto viewspace.  This is important, because it saves the next step from becoming overly complex!  The geometry that follows is able to do per-primitive operations on the vertex, here I take each vertex from the previous stage(which is already projected into viewspace), and &#8216;expand&#8217; that into a billboard by creating a quad for each point.  The quad naturally faces the camera, since everything is already in viewspace.  The final stage of the pipeline is the fragment shader, which applies a texture onto the quad.</p>
<p>One blatant oversight of this approach is that it does not take into account the viewport aspect ratio, thus the generated particles will only look square on a 1:1 canvas.  None unity aspect-ratio will stretch the billboard.</p>
<p>As you can see, the code is very short, but being GLSL, the program is executed on the graphic hardware, which is highly tuned for this type of computation.  Freeing the CPU to do other things.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/some-more-shader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hardware accelerated particles</title>
		<link>http://blog.mikepan.com/hardware-accelerated-particles/</link>
		<comments>http://blog.mikepan.com/hardware-accelerated-particles/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 08:09:05 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[gpu]]></category>
		<category><![CDATA[realtime]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://blog.mikepan.com/?p=766</guid>
		<description><![CDATA[This is a test with 1million fully textured particles running in Blender&#8217;s using geometry shaders and vertex shaders to do most of the heavy-lifting.]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.mikepan.com/wp-content/uploads/1Mb.jpg"><img class="alignnone size-medium wp-image-768" title="1Mil particles" src="http://blog.mikepan.com/wp-content/uploads/1Mb-640x400.jpg" alt="" width="640" height="400" /></a></p>
<p><a href="http://blog.mikepan.com/wp-content/uploads/1M.jpg"><img class="alignnone size-medium wp-image-767" title="1Million particles" src="http://blog.mikepan.com/wp-content/uploads/1M-640x400.jpg" alt="" width="640" height="400" /></a></p>
<p>This is a test with 1million fully textured particles running in Blender&#8217;s using geometry shaders and vertex shaders to do most of the heavy-lifting.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/hardware-accelerated-particles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multi-language support in Blender</title>
		<link>http://blog.mikepan.com/multi-language-support-in-blender/</link>
		<comments>http://blog.mikepan.com/multi-language-support-in-blender/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 06:36:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[realtime]]></category>

		<guid isPermaLink="false">http://blog.mikepan.com/?p=762</guid>
		<description><![CDATA[Dalai Felinto had been working on teaching the old Blender Game Engine some new tricks. With this patch, the Game Engine can use the native  Blender &#8216;text&#8217; object type in the game, this means you can reuse the same text &#8230; <a href="http://blog.mikepan.com/multi-language-support-in-blender/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.dalaifelinto.com/">Dalai Felinto</a> had been working on teaching the old Blender Game Engine some new tricks.</p>
<p><img class="alignnone size-full wp-image-763" title="Unicode-Blender" src="http://blog.mikepan.com/wp-content/uploads/Untitled2.png" alt="" width="560" height="315" /></p>
<p>With this <a href="http://projects.blender.org/tracker/index.php?func=detail&amp;aid=25163&amp;group_id=9&amp;atid=127">patch</a>, the Game Engine can use the native  Blender &#8216;text&#8217; object type in the game, this means you can reuse the same text object inside the Game Engine, without having to fiddle with custom bitmap textures.  Further more, the text engine is now thoroughly Unicode aware, with the right font, you can make Blender talk in any language you want(as shown above).</p>
<p>Oh and in case you are wondering how get that Sony CrossMedia Bar effect in Blender, <a href="http://blog.mikepan.com/blender-game-engine-resource-kit/">click here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/multi-language-support-in-blender/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Blender Game Engine Resource Kit</title>
		<link>http://blog.mikepan.com/blender-game-engine-resource-kit/</link>
		<comments>http://blog.mikepan.com/blender-game-engine-resource-kit/#comments</comments>
		<pubDate>Sun, 12 Dec 2010 01:20:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[realtime]]></category>

		<guid isPermaLink="false">http://blog.mikepan.com/?p=741</guid>
		<description><![CDATA[Hi all, I am putting together a collection of sample files for the 2.55 game engine that intend to serve as learning material for people who is new to the Game Engine (and for all the 2.49 people who are &#8230; <a href="http://blog.mikepan.com/blender-game-engine-resource-kit/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hi all, I am putting together a collection of <a href="http://blenderartists.org/forum/showthread.php?t=204148">sample files for the 2.55 game engine</a> that intend to serve as learning material for people who is new to the Game Engine (and for all the 2.49 people who are afraid of touching the new 2.5 interface). One of the main problem with the BGE seems to be the lack of good quality &#8216;components&#8217; for people to reuse, and beginner&#8217;s tutorials are rarely advanced enough to get people through a real big production. This is my way of trying to change that&#8230;</p>
<p><a href="http://blenderartists.org/forum/showthread.php?t=204148"><img class="alignnone size-medium wp-image-892" title="Game Engine Resource Kit" src="http://blog.mikepan.com/wp-content/uploads/GEKit-640x400.jpg" alt="" width="640" height="400" /></a></p>
<p>My aim is to prepare at least 12 files before Christmas.  If this is not enough, you can always, oh I don&#8217;t know, get a <a href="http://www.amazon.com/Mastering-Blender-Game-Engine-Mike/dp/1435456629">book </a>on the topic or something. :)</p>
<p>Merry Early Christmas!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/blender-game-engine-resource-kit/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>A few pictures from work</title>
		<link>http://blog.mikepan.com/a-few-pictures-from-work/</link>
		<comments>http://blog.mikepan.com/a-few-pictures-from-work/#comments</comments>
		<pubDate>Tue, 11 May 2010 15:25:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[biology]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[realtime]]></category>
		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://blog.mikepan.com/?p=499</guid>
		<description><![CDATA[Update: This project is featured on the Italian Computer Grafica magazine!]]></description>
			<content:encoded><![CDATA[<div id="attachment_505" class="wp-caption alignnone" style="width: 570px"><a href="http://blog.mikepan.com/wp-content/uploads/Cal01.jpg"><img class="size-medium wp-image-505" title="Cal0" src="http://blog.mikepan.com/wp-content/uploads/Cal01-560x315.jpg" alt="" width="560" height="315" /></a><p class="wp-caption-text">Realtime visualization</p></div>
<div id="attachment_502" class="wp-caption alignnone" style="width: 570px"><a href="http://blog.mikepan.com/wp-content/uploads/Cal1.jpg"><img class="size-medium wp-image-502" title="Cal1" src="http://blog.mikepan.com/wp-content/uploads/Cal1-560x315.jpg" alt="" width="560" height="315" /></a><p class="wp-caption-text">Import &gt; Simulate &gt; Export</p></div>
<div id="attachment_503" class="wp-caption alignnone" style="width: 570px"><a href="http://blog.mikepan.com/wp-content/uploads/Cal2.jpg"><img class="size-medium wp-image-503" title="Cal2" src="http://blog.mikepan.com/wp-content/uploads/Cal2-560x315.jpg" alt="" width="560" height="315" /></a><p class="wp-caption-text">Going nuts with F-Curves</p></div>
<p>Update: This <a href="http://www.bioblender.com/">project </a>is featured on the Italian <a href="http://www.imagonet.it/Sommario_CG79.htm">Computer Grafica</a> magazine!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/a-few-pictures-from-work/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>This scene has a triangle count of 2.</title>
		<link>http://blog.mikepan.com/this-scene-has-a-total-triangle-count-of-2/</link>
		<comments>http://blog.mikepan.com/this-scene-has-a-total-triangle-count-of-2/#comments</comments>
		<pubDate>Tue, 04 May 2010 21:37:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[realtime]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://blog.mikepan.com/?p=461</guid>
		<description><![CDATA[You are looking at a flat plane consists of 2 triangles running in the Blender 2.5 Game Engine.  There is no run-time subdivision, no geometry shader, using only a minimum pass-through vertex shader, all the magic is happening in the &#8230; <a href="http://blog.mikepan.com/this-scene-has-a-total-triangle-count-of-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.mikepan.com/wp-content/uploads/Relief-Mapping-Terrain-demo.jpg"><img class="alignnone size-medium wp-image-485" title="Relief Mapping Terrain demo" src="http://blog.mikepan.com/wp-content/uploads/Relief-Mapping-Terrain-demo-560x315.jpg" alt="Relief Mapping Terrain demo" width="560" height="315" /></a><br />
You are looking at a flat plane consists of 2 triangles running in the Blender 2.5 Game Engine.  There is no run-time subdivision, no geometry shader, using only a minimum pass-through vertex shader, all the magic is happening in the pixel shader.  The terrain is completely 3D looking, you can fly around it, view it from different angles, there is lights, shadows, bumps, shiny lakes, and even a height-based fog.  Below is a video of the technique in motion:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/_erYebogWUw&amp;hl=en_US&amp;fs=1&amp;hd=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/_erYebogWUw&amp;hl=en_US&amp;fs=1&amp;hd=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Isn&#8217;t Relief Mapping great?</p>
<p>Apart from all games that will inevitably take advantage of this technique, another application I can think of that will reap huge benefit from this is the loading and displaying of large-scale terrain visualization at virtually no CPU overhead.  A 4096&#215;4096 DEM texture can be easily displayed at 60fps.  Whereas if the same data were to be converted to real geometry, most computers will die trying to render those 33million triangles.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/bUAY8FKMQKY&amp;hl=en_US&amp;fs=1&amp;hd=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/bUAY8FKMQKY&amp;hl=en_US&amp;fs=1&amp;hd=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>The effect is achieved by a rather complex fragment shader (pixel shader) that effectively does ray-casting on each pixel to determine the location and visibility of each pixel.  The shader requires at least 2 textures.  A diffuse color texture; and a normal-height texture that contains the surface normal stored in the RGB channel and the height value stored in the Alpha channel.  Supplied with a miminum of these two textures, the shader is able to reconstruct the 3D surface like you saw.  (I also used a specular texture to control the specularity of the lakes, but this is optional)</p>
<p><a href="http://dl.dropbox.com/u/1742071/TerrainPacked2.blend">Download the demo (4MB)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/this-scene-has-a-total-triangle-count-of-2/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Blender vehicle physics tutorial</title>
		<link>http://blog.mikepan.com/blender-vehicle-physics-tutorial/</link>
		<comments>http://blog.mikepan.com/blender-vehicle-physics-tutorial/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 21:14:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[realtime]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://blog.mikepan.com/?p=442</guid>
		<description><![CDATA[A long time ago I toyed with the idea of making an entire game by myself. Being a driving game, I spent a long time with the basics stuff like vehicle physics to make sure the driving part is stable, &#8230; <a href="http://blog.mikepan.com/blender-vehicle-physics-tutorial/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A long time ago I toyed with the idea of making an entire game by myself.  Being a driving game, I spent a long time with the basics stuff like vehicle physics to make sure the driving part is stable, bug-free, and most importantly, fun.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/RHBEJLlHz04&amp;hl=en_US&amp;fs=1&amp;hd=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/RHBEJLlHz04&amp;hl=en_US&amp;fs=1&amp;hd=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>I never finished it.  But ever since I posted the above video, I have been getting a lot of inquiries as to how I did the vehicle physics system in Blender.  So here is a quick guide followed by the <a href="http://dl.dropbox.com/u/1742071/Racer25.zip">sample file</a>.</p>
<p>The key to stable driving dynamics is to use the built-in <strong>PhysicsConstraints </strong>module within Blender&#8217;s game engine.  <strong>PhysicsConstraints </strong>is a python wrapper for the Bullet physics engine.  No any homemade setup I&#8217;ve seen is as good as what&#8217;s already provided by Bullet Physics.  So we&#8217;ll use that.  Because there isn&#8217;t a graphical interface for setting up the vehicle physics yet in Blender, we need to write a few lines of Python script.  The key component is the car body object, which is linked to the 4 wheels through a logic brick connection so that the script would recognize the linked objects as wheels.  (As you can see, all the actual driving logic is all happening on the car body, the wheels have no real logic brick attached).</p>
<p>The entire setup is a bit complex, since there is a mix of logic brick and python.  Take a look at the sample file if you are lost.  When one runs the game, the following happens:</p>
<p>0. World is initialized, but we don&#8217;t really care about that here.</p>
<p>1. The car body is initalized,<strong> scripts.carInit()</strong> is ran.  In this script, it initializes the car as a &#8220;vehicle constraint&#8221;, aka constraint type11, and stores it as a Python object called <em>vehicle</em>.  The same script then looks for the 4 wheel by access a gamelogic actuator with specific names (in this case, wheel1, wheel3, etc), then the script attaches the wheels to the car body using the settings specified in the script.  Variables such as RollInfluence, SuspensionStiffness, and TyreFriction can all be set on a per-tire basis once the <em>vehicle </em>object is created.  The job of carInit() is now done.  Our car body is now considered to be a vehicle by the Blender game engine, and it will behave like one.</p>
<p>2. Every frame,<strong> scr</strong><strong>ipts.carHandler()</strong> is ran.  This script does the actual moving of the car, it applies engine force and steering to the <em>vehicle </em>object.  But this script gets the user input (keyboard sensor inputs) from another source.  (See #3 below)   <em>Vehicle </em>objects have methods such as applyBreaking(), applyEngineForce(), getWheelRotation(), getNumWheels, which you can all call.</p>
<p><em><span style="font-style: normal;">3. Every time a key is pressed, <strong>script.keyHandler()</strong> is ran.  It figures out which key is pressed and set the intermediate variable so that #2 (i.e. <strong>scripts.carHandler</strong>) would know how much throttle to apply, where to steer, etc.  This script is separated from <strong>scripts.carHandler()</strong> not because of technical limitations, but by design so that it&#8217;s easier to manage the code.</span></em></p>
<p>That&#8217;s all there is to it.  If the script layout is a bit confusing, it&#8217;s because it is.  I originally intended it to be a bigger project, thus everything is separated into nice neat functions.  Again, you can <a href="http://dl.dropbox.com/u/1742071/Racer25.zip">DOWNLOAD </a>the whole setup for Blender 2.5 from here.</p>
<p>Controls:<br />
Arrow Keys to move the car<br />
Space bar for handbrake<br />
R to reset car if it flips over<br />
number row 1,2,3,4,5 to change camera</p>
<p>Hope that helped.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/blender-vehicle-physics-tutorial/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>

