<?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; technical</title>
	<atom:link href="http://blog.mikepan.com/tag/technical/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mikepan.com</link>
	<description>making visuals with technology</description>
	<lastBuildDate>Fri, 06 Aug 2010 17:19:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>iPhone Photography</title>
		<link>http://blog.mikepan.com/iphone-photography/</link>
		<comments>http://blog.mikepan.com/iphone-photography/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 06:09:32 +0000</pubDate>
		<dc:creator>mike pan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gadgets]]></category>
		<category><![CDATA[photography]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://blog.mikepan.com/?p=408</guid>
		<description><![CDATA[I recently got an iPhone 3GS, the camera that&#8217;s built into the phone is a pretty big disappointment for someone who shoots dSLR for the past year.  Super-noisy at base ISO 100, no manual control, shutter lag&#8230; it&#8217;s a mess.  Granted, big lenses and big cameras are super cool, and they take amazing pictures.  But [...]]]></description>
			<content:encoded><![CDATA[<p>I recently got an iPhone 3GS, the camera that&#8217;s built into the phone is a pretty big disappointment for someone who shoots dSLR for the past year.  Super-noisy at base ISO 100, no manual control, shutter lag&#8230; it&#8217;s a mess.  Granted, big lenses and big cameras are super cool, and they take amazing pictures.  But this post is about living with, and taking advantage of the tiny camera on a camera phone.</p>
<p>Lesson 1: Know the limit of your camera, and try to work around it.<br />
<a title="Vancouver sunset by mike pan, on Flickr" href="http://www.flickr.com/photos/mikepan/4430880525/"><img src="http://farm3.static.flickr.com/2713/4430880525_4db3ba6230.jpg" alt="Vancouver sunset" width="500" height="368" /></a><br />
Small cameras are known for their low dynamic range, so to get the most out of this sunset, I took two images at different exposure and merged them together with <strong>Pro HDR</strong>, right on the phone.  This increased the dynamic range dramatically, making it equal to that of a dSLR.  Then a bit of contrast and saturation boost completed the look.</p>
<p>Lesson 2: Post Processing<br />
<a title="i am {not} on a boat by mike pan, on Flickr" href="http://www.flickr.com/photos/mikepan/4435511649/"><img src="http://farm5.static.flickr.com/4030/4435511649_e4f6a21804.jpg" alt="i am {not} on a boat" width="377" height="500" /></a><br />
This picture came out very bland at first, but a few tweaks in <strong>Lightroom 3</strong>made it marginally passable.  There are enough apps in the Apple Appstore to edit your photo into oblivion and back.  Some of my favorite apps are Pro HDR, TiltShiftGen and Best Camera.  Of course, for the most control, you&#8217;d have to use a desktop-based tool like Lightroom or Aperture.</p>
<p>Lesson 3: Color<br />
<a title="Metrotown through iPhone by mike pan, on Flickr" href="http://www.flickr.com/photos/mikepan/4300911435/"><img src="http://farm5.static.flickr.com/4003/4300911435_45b80e760a.jpg" alt="Metrotown through iPhone" width="375" height="500" /></a><br />
What the tiny camera lacks in light-gathering ability, it makes up by upping the vibrancy and contrast.  iPhone photos are usually a lot more vibrant and contrasty than what you get out of a high-end dSLR.  Use this to your advantage to capture some eye popping pictures.</p>
<p>Lesson 4: Bokeh<br />
<a title="Untitled by mike pan, on Flickr" href="http://www.flickr.com/photos/mikepan/4430635019/"><img src="http://farm5.static.flickr.com/4037/4430635019_d336204818.jpg" alt="Untitled" width="375" height="500" /></a><br />
You CAN throw the background out of focus even on a tiny sensor like the iPhone camera, but only if you are shooting in macro.  Just be patient with the focus, it can take a while to get the razor sharp image that you wanted.</p>
<p>That&#8217;s all for now, I am still discovering the capability of the iPhone camera.  Let me know if you have any tips regarding digital photography.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/iphone-photography/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The perfect laptop!</title>
		<link>http://blog.mikepan.com/the-perfect-laptop/</link>
		<comments>http://blog.mikepan.com/the-perfect-laptop/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 06:37:46 +0000</pubDate>
		<dc:creator>mike pan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gadgets]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://blog.mikepan.com/?p=380</guid>
		<description><![CDATA[I was window-shopping for laptops today and discovered the amazing Asus UL30 series.  It&#8217;s truly an amazing piece of engineering: it&#8217;s thin, it&#8217;s light, it&#8217;s fast, has an insane battery life, and pretty cheap.  Let me break down the specs for you non-geeks: Core 2 Duo SU7300 Processor: It has a 1.3Ghz (up to 1.7Ghz [...]]]></description>
			<content:encoded><![CDATA[<p>I was window-shopping for laptops today and discovered the amazing Asus <a href="http://www.amazon.com/UL30Vt-A1-Light-13-3-Inch-Silver-Laptop/dp/B0032FOKXS/ref=sr_1_5?ie=UTF8&amp;s=pc&amp;qid=1265608328&amp;sr=1-5">UL30 </a>series.  It&#8217;s truly an amazing piece of engineering: it&#8217;s thin, it&#8217;s light, it&#8217;s fast, has an insane battery life, and pretty cheap.  Let me break down the specs for you non-geeks:</p>
<p><img class="alignnone size-medium wp-image-381" title="UL30" src="http://blog.mikepan.com/wp-content/uploads/17_ul30-vt-wide-20091117-600-500x306.jpg" alt="" width="500" height="306" /></p>
<p><em>Core 2 Duo SU7300 Processor:</em><br />
It has a 1.3Ghz (up to 1.7Ghz with TurboBoost technology), ultra-low-voltage processor manufactured on 45nm technology.  Which really just means the processor can do a LOT of work while barely sipping on your precious battery.  Honestly, it&#8217;s unbelievable how fast this processor is while using less than 10W of power.  [Compare with a 13 MacBook Pro: slightly slower, but uses 1/3rd the power)</p>
<p><em>Nvidia G210M 512MB and Intel 4500 Graphics:</em><br />
This .93 inch thin laptop has TWO graphics cards.  The Nvidia G210 is probably the fastest graphics card available on a 13 inch laptop.  It's build on 40nm technology, and uses a max of 14W of power, which is still impressive for a graphics card of this caliber.  The Intel is slower, but uses even less power.  You can toggle between the 2 to trade off performance for battery life. [Compare with a 13" MacBook Pro:  The Asus is twice as fast, while using the same amount of juice]</p>
<p><em>4GB DDR3 RAM:</em><br />
Also, the laptop can support a max of 8GB of memory, you know&#8230; in case you need that much. [Same as Macbooks.]</p>
<p><em>13inch LED-lit Screen:</em><br />
LED also means it&#8217;s uses less power than regular backlights. [same as Macbooks]</p>
<p><em>12 hour battery life:</em><br />
&#8230;or so Asus claims, you can probably expect 10 hours of real world usage, and maybe 4-5 hours of gaming/heavy 3D work. [much longer than the MacBook Pros]</p>
<p><em>Design:</em><br />
Not quite on par with Apple&#8217;s drool inducing one-piece aluminum finish, but it&#8217;s one of the nicer laptops I&#8217;ve seen (once you get rid of all the stickers).  The design is obviously Macbook inspired.  And it&#8217;s really light and thin.</p>
<p><em>Price:</em><br />
$800 USD.  I know you can get an even faster 15&#8243; laptop for $900, but the battery life and portability also suffers as you up the screen size.  13&#8243; with this amount of computing power is perfect.  It also comes with all the standard bells and whistles: webcam, bluetooth, 802.11n, and a half terabyte harddrive.</p>
<p><em>The bottom line:</em><br />
if you are looking for a portable powerhouse, take a closer look at this laptop.  If you want raw power and don&#8217;t care about battery life, skip this.</p>
<p><span style="color: #999999;">* I do not own this laptop, nor did I got paid to write this, I was just excited that I finally found a laptop that seems to be everything I am looking for.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/the-perfect-laptop/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Tip: How to sculpt with 4 million polygons on a laptop</title>
		<link>http://blog.mikepan.com/tip-how-to-sculpt-with-4-million-polygons-on-a-laptop/</link>
		<comments>http://blog.mikepan.com/tip-how-to-sculpt-with-4-million-polygons-on-a-laptop/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 06:21:20 +0000</pubDate>
		<dc:creator>mike pan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[x64]]></category>

		<guid isPermaLink="false">http://blog.mikepan.com/?p=361</guid>
		<description><![CDATA[With these tips, you should able to drastically increase your polygon-count limitation while sculpting. 1. Get Blender 2.5 Alpha, also go for the 64bit version if you have 3GB or more of RAM.  2.5 is simply a lot faster and refined than Blender 2.49.  The tools and interface is also much cleaner and more intuitive. [...]]]></description>
			<content:encoded><![CDATA[<p>With these tips, you should able to drastically increase your polygon-count limitation while sculpting.</p>
<p>1. Get Blender 2.5 <a href="http://www.blender.org/development/release-logs/blender-250/">Alpha</a>, also go for the 64bit version if you have 3GB or more of RAM.  2.5 is simply a lot faster and refined than Blender 2.49.  The tools and interface is also much cleaner and more intuitive.  Also, a lot of work has gone into optimizing the sculpting feature in Blender 2.5.</p>
<p>2. Start with a base mesh, then apply the <a href="http://www.blendercookie.com/2010/01/26/tip-high-poly-sculpting/">multires modifier</a>.  Do not use a default cube and rely on the multires modifier to do *all* the sub-division.  It&#8217;s always better to start with a base mesh with a few thousand polygons, and use multires with a sub-division level of 2-5.</p>
<p>3. Turn off &#8220;Double Sided&#8221; in the Object Data panel.  This will significantly speed up the redraw.</p>
<p>4. Delete UV texture data and Vertex Color data *might* help speed things up, but I don&#8217;t really know for sure.</p>
<p><span style="text-decoration: line-through;">5. Turn on VBO in the Preference menu.  This will further speed up drawing speed.  (Thanks Gustav!)</span> Okay apparently it doesn&#8217;t according to another commenter, since sculpt mode already uses VBO by default.<span style="text-decoration: line-through;"><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/tip-how-to-sculpt-with-4-million-polygons-on-a-laptop/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>SVN log parsing and analysis fun</title>
		<link>http://blog.mikepan.com/svn-log-parsing-and-analysis-fun/</link>
		<comments>http://blog.mikepan.com/svn-log-parsing-and-analysis-fun/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 23:10:19 +0000</pubDate>
		<dc:creator>mike pan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://blog.mikepan.com/?p=133</guid>
		<description><![CDATA[A few of you asked about how I got those statistics for my previous post about Blender SVN. For the inquiring minds, I got the SVN log with the following command svn log -r 25000:0 --xml https://svn.blender.org/svnroot/bf-blender/branches &#62;&#62; log.xml svn log -r 25000:0 --xml https://svn.blender.org/svnroot/bf-blender/trunk &#62;&#62; log.xml These two SVN operation fetches the SVN logs [...]]]></description>
			<content:encoded><![CDATA[<p>A few of you asked about how I got those statistics for my previous post about<a href="http://blog.mikepan.com/blender-revision-25000/"> Blender SVN</a>.</p>
<p>For the inquiring minds, I got the SVN log with the following command</p>
<pre>svn log -r 25000:0 --xml https://svn.blender.org/svnroot/bf-blender/branches &gt;&gt; log.xml
svn log -r 25000:0 --xml https://svn.blender.org/svnroot/bf-blender/trunk &gt;&gt; log.xml</pre>
<p>These two SVN operation fetches the SVN logs for both the branches and the trunk of Blender and combine them into one 8 megabyte XML file.  Please do not do this often as I imagine querying all the commit logs must put a heavy strain on the Blender SVN server.</p>
<p>Parsing the XML for the author commit frequency is done with the following python script:</p>
<pre>import xml.sax

authorList= {}

# create document handler
class SVNXMLHandler(xml.sax.handler.ContentHandler):
	def __init__(self):
		pass

	def startElement(self, name, attrs):
		self.hasAuthor = 0
		self.hasEntry = 0
		if name == "logentry":
			self.hasEntry = 1
			#print attrs.get('revision', ""),
		elif name == "author":
			self.hasAuthor = 1

	def characters(self, data):
		if self.hasAuthor:
			#print data
			try:
				authorList[data] += 1
			except:
				authorList[data] = 1

	def endElement(self, name):
		if name == "author": self.hasAuthor = 0
		if name == "logentry": self.hasEntry = 0

# load and parse log
f = open('log.xml', 'r')
xml.sax.parseString(f.read(), SVNXMLHandler())

# print to console in comma delimited format
for i in authorList:
	print i,",",authorList[i]</pre>
<p>Run the above python script like so:</p>
<pre>python logParser.py &gt;&gt; crunched.csv</pre>
<p>After a few seconds, a CSV file should be created containing all the data you need, ready to be graphed in Microsoft Office.  Yes I used Excel for the graph&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/svn-log-parsing-and-analysis-fun/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build Blender 2.5, a visual guide</title>
		<link>http://blog.mikepan.com/build-blender-2-5-a-visual-guide/</link>
		<comments>http://blog.mikepan.com/build-blender-2-5-a-visual-guide/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 23:03:50 +0000</pubDate>
		<dc:creator>mike pan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[x64]]></category>

		<guid isPermaLink="false">http://blog.mikepan.com/?p=179</guid>
		<description><![CDATA[Today I will present a simple graphical guide to build Blender 2.5 on a Windows computer.  A lot of the instructions just need to be done one time, once you have a building environment setup, updating the build is a *really* simple process.  But if you just want a cutting-edge daily release, you can find [...]]]></description>
			<content:encoded><![CDATA[<p>Today I will present a simple graphical guide to build Blender 2.5 on a Windows computer.  A lot of the instructions just need to be done one time, once you have a building environment setup, updating the build is a *really* simple process.  But if you just want a cutting-edge daily release, you can find those pre-compiled for you on <a href="http://www.graphicall.org/">Graphicall.org</a></p>
<p>Firstly, you will need a few piece of software: We are going to use <strong>Microsoft Visual Studio 2008</strong> and <strong>Cmake </strong>to help us build Blender, and to fetch the source code from blender.org, we&#8217;ll also need a SVN client, I will use <strong>TortoiseSVN</strong>.</p>
<p><strong>1. Get Visual Studio 2008.</strong> If you have access to a copy of Visual Studio, great!  But I heard the free <a href="http://www.microsoft.com/exPress/">Express Edition</a> works too.  I went with a custom installation and this is all the components you&#8217;ll need to build Blender.</p>
<p><a href="http://blog.mikepan.com/wp-content/uploads/02.png"><img class="size-medium wp-image-182 alignnone" title="Custome Installation" src="http://blog.mikepan.com/wp-content/uploads/02-500x366.png" alt="Custome Installation" width="500" height="366" /></a></p>
<p>2.<strong> Get <a href="http://www.cmake.org/">CMake </a>and install it</strong>.  It&#8217;s free.</p>
<p>3. <strong>Install <a href="http://tortoisesvn.tigris.org/">TortoiseSVN</a></strong>, also free.</p>
<p>4. Once all the software are installed, we can begin to <strong>acquire the Blender source codes</strong>!  First, navigate to an empty directory and right click to do a SVN Checkout.  Use the following URL:</p>
<pre style="font: normal normal normal 12px/18px Consolas, Monaco, 'Courier New', Courier, monospace;">https://svn.blender.org/svnroot/bf-blender/trunk/blender</pre>
<p>Put the source under C:\Blender\blender. Next, let&#8217;s also acquire the libraries needed to build Blender.  Do another check out with the following URL:</p>
<pre>https://svn.blender.org/svnroot/bf-blender/trunk/lib/windows</pre>
<p>Make sure you put the files under a directory like C:\Blender\lib\Windows.  If you want to make 64bit builds, also check out the 64bit libs:</p>
<pre> https://svn.blender.org/svnroot/bf-blender/trunk/lib/win64</pre>
<p>Put that under C:\Blender\lib\Win64</p>
<div id="attachment_185" class="wp-caption alignnone" style="width: 510px"><a href="http://blog.mikepan.com/wp-content/uploads/04.png"><img class="size-medium wp-image-185" title="Use TortoiseSVN to check-out the Blender Windows Library" src="http://blog.mikepan.com/wp-content/uploads/04-500x285.png" alt="04" width="500" height="285" /></a><p class="wp-caption-text">Use TortoiseSVN to check-out the Blender Windows Library</p></div>
<p>Once you have done the 3 check-out, your directory structure should look like this, make sure all the folders and files are in the proper place, otherwise you will have a hard time building Blender:</p>
<div id="attachment_196" class="wp-caption alignnone" style="width: 307px"><img class="size-full wp-image-196" title="Folder structure" src="http://blog.mikepan.com/wp-content/uploads/folder.png" alt="Folder structure" width="297" height="614" /><p class="wp-caption-text">Folder structure</p></div>
<p>5. Now that you have all the source files, it&#8217;s time to start the <strong>building </strong>process!</p>
<p>We are going to use CMake to generate a &#8220;solution&#8221; file for Visual Studio.  A solution is what Visual Studio would open to build the entire Blender. It&#8217;s a collection of smaller project, each project is a collection of source files.</p>
<p>Now open CMake, and In the top text box, type in where you put the Blender source code. (C:\Blender\blender, in my case)</p>
<p>In the second text box below it, select a fresh directory where you want the output file to go. I am using C:\Blender\build</p>
<p>Now click on Configure, this will bring up another dialog box where it asks you which generator to pick.  We are going to use <strong>Visual Studio 9 2008</strong>, or<strong> Visual Studio 9 2008 Win64</strong>, if you want to build a 64bit Blender.</p>
<p><a href="http://blog.mikepan.com/wp-content/uploads/cmake.png"><img class="alignnone size-medium wp-image-205" title="CMake" src="http://blog.mikepan.com/wp-content/uploads/cmake-499x352.png" alt="CMake" width="499" height="352" /></a></p>
<p>Then CMake will populate the main window with a list of options that you can disable or enable.  The default selection is good, but if you want to speed up the building process, you can deselect certain options that you are not using.</p>
<p>Certain options might also be unavailable or broken on 64bit.  For example, if you are building a 64bit release, make sure you uncheck FFMPEG, JACK, and QUICKTIME, since there is no 64bit library for these media features yet.</p>
<p><a href="http://blog.mikepan.com/wp-content/uploads/cmake2.png"><img class="alignnone size-medium wp-image-206" title="CMake Options" src="http://blog.mikepan.com/wp-content/uploads/cmake2-389x500.png" alt="CMake Options" width="389" height="500" /></a></p>
<p>For first timers, I would suggest unchecking all of these boxes to build a minimalist Blender.  It will be faster, smaller, and there is less chance of running into an error at compile time.  You can come back and re-enable these settings once your first build is successful.  <strong>Once you have made your selection, click on Configure at the bottom of the screen.  Then followed by clicking on Generate. </strong> These will generate the corresponding Visual Studio solution files in the directory you specified above.  (C:\blender\build\) in our case.  Close CMake.</p>
<p>6. Navigate to C:\blender\build, you should see the solution file you just generated.  Open &#8220;Blender.sln&#8221; with Visual Studio 2008.</p>
<p><img class="alignnone size-full wp-image-211" title="Build folder" src="http://blog.mikepan.com/wp-content/uploads/folder2.png" alt="Build folder" width="500" height="653" /></p>
<p>Once Visual Studio opens the solution, make sure you <strong>change the default build target from Debug to Release</strong>.  Otherwise you will end up with a debug build of Blender that is slower, bigger, and probably not helpful unless you are debugging.</p>
<p><img class="alignnone size-full wp-image-212" title="Visual Studio 2008" src="http://blog.mikepan.com/wp-content/uploads/vs2008.png" alt="Visual Studio 2008" width="500" height="332" /></p>
<p>After that, simply select <strong>Build Solution</strong> from the build menu.  After about 10 minutes of compiling and linking, a fully functional Blender installation should be ready under C:\Blender\build\Bin\Release.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/build-blender-2-5-a-visual-guide/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>The importance of shading</title>
		<link>http://blog.mikepan.com/the-importance-of-shading/</link>
		<comments>http://blog.mikepan.com/the-importance-of-shading/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 19:08:20 +0000</pubDate>
		<dc:creator>mike pan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://blog.mikepan.com/?p=120</guid>
		<description><![CDATA[Introducing&#8230; a flat, boring porins protein, this is how most scientific vistualization would show it. What&#8217;s wrong with the image?  Well technically nothing, it&#8217;s scientifically accurate, each atom is color coded to represent an element, and it even rotates so that you can see the overall structure of protein.  But can we do better?  You [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.mikepan.com/wp-content/uploads/porin.gif"><img class="size-full wp-image-122 alignleft" title="Porin molecule, No Ambient Occlusion" src="http://blog.mikepan.com/wp-content/uploads/porin2.gif" alt="Porin molecule, No Ambient Occlusion" width="256" height="256" /></a></p>
<p>Introducing&#8230; a flat, boring porins protein, this is how most scientific vistualization would show it.</p>
<p>What&#8217;s wrong with the image?  Well technically nothing, it&#8217;s scientifically accurate, each atom is color coded to represent an element, and it even rotates so that you can see the overall structure of protein.  But can we do better?  You bet!</p>
<p><a href="http://blog.mikepan.com/wp-content/uploads/porin.gif">Click here</a> to see the exact same porins protein, but with a much advanced shading model, I think it&#8217;s clear why this one is superior.  With ambient occlusion, in which the model is shaded based on how likely an area is occluded because of surrounding objects, the spatial structure of the protein is much easier to understand.  And with today&#8217;s super fast GPUs, doing a screen-space ambient occlusion is virtually instant.</p>
<p>And if anyone is curious, the software I used to generate the graph is <a href="http://qutemol.sourceforge.net/">CuteMol</a>, an</p>
<blockquote><p>interactive, <em>high quality molecular visualization system</em>.        QuteMol exploits the current GPU capabilites through OpenGL shaders to        offers an array of innovative visual effects. QuteMol visualization        techniques are aimed at improving clarity and an easier understanding of        the 3D shape and structure of large molecules or complex proteins.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/the-importance-of-shading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Very simple 2 player networking in Python</title>
		<link>http://blog.mikepan.com/very-simple-2player-networking-in-python/</link>
		<comments>http://blog.mikepan.com/very-simple-2player-networking-in-python/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 06:15:21 +0000</pubDate>
		<dc:creator>mike pan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[realtime]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://mikepan.homeip.net/blog/?p=75</guid>
		<description><![CDATA[A while ago, I posted a simple demo I made in the Blender game engine that let&#8217;s 2 player interact with each other over the internet, all it is required is a really simple networking script and the IP address of the two players.  Here is as youtube video of it in action, mouse-over the [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago, I posted a simple demo I made in the Blender game engine that let&#8217;s 2 player interact with each other over the internet, all it is required is a really simple networking script and the IP address of the two players.  Here is as youtube video of it in action, mouse-over the video to see some caption text.</p>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/Az8C1IW5E5s&#038;hl=en_US&#038;fs=1&#038;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Az8C1IW5E5s&#038;hl=en_US&#038;fs=1&#038;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
<p>The laptop on the left is physically separated from the desktop to the right, linked only by a wireless internet connection.  And as you can see, input made to the desktop computer is sent across the network to the laptop, in realtime.</p>
<p>And here is the script, I&#8217;ll try to explain everything as best I can:</p>
<pre># Simple Python UDP networking demo Created by Mike Pan
# Todo: auto-self IP detection would be nice

# the following line loads the game module used by Python
# to access the Blender Game Engine API, and assigns it the alias G
import GameLogic as G
# load the network socket python module, we'll need it later
import socket

# define own IP address, and stores it as a property under GameLogic
# essentially making it accessible as a global variable
G.ownIP = "xxx.xxx.xxx.xxx"
# define peer IP address, stores it as a property under GameLogic
# again, essentially making it accessible as a global variable
G.peerIP = "xxx.xxx.xxx.xxx"
# define the port number (arbitrary), and the socket buffer size
# (4096 is a good starting point)
G.port = 4000
G.buffer = 4096

# create an IPV4 address with the pre-defined IP and the port number
addr = (G.peerIP, G.port)

# We'll add this line to all our communication, so when debugging,
# we won't get confused as to who send the packets.
signature = "Sent from " + G.ownIP

def init():
	# create an UDP socket for **sending** datagram
	G.sender = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
	# time out is 10ms, pretty short for realworld application,
	#but enough for debugging over local network
	G.sender.settimeout(0.01)
	# this is important! by making this socket object a
	# non-blocking operation, all network stuff is run on
	# a separate thread, thus any network delay will not
	# cause the game to slow down
	G.sender.setblocking(0)

	# creates UDP socket for **receiving** datagram
	G.listener = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
	# same as above, time out is 10ms
	G.listener.settimeout(0.01)
	# same as above, we also need to make sure network operations
	# will not slow down the main application
	G.listener.setblocking(0)

	# Win32 needs the socket binded:
	try:
	 G.listener.bind((G.ownIP, G.port))
	except:
	 print "Binding Listener failed"

def comm():
	# get the object that is attached to this script
	own = G.getCurrentController().owner

 	# receive from peer
	try:
		data, port = G.listener.recvfrom(G.buffer)
		# data contains all the data that came through,
		# it's a string, and we can do whatever we want
		# like print it out
		print data.split(',')
	# if the receiving fails, print something to notify the user
	except:
		print "Receive failed"

	# send to peer
	# generate data to be sent here,
	# send the position data across the network:
	string = str(own.worldPosition)+ ',' + signature

	# going to try to send the data
	try:
		G.sender.sendto(string, addr)
		# if sending fails, notify with error message
	except:
		print "Send failed"</pre>
<p>That&#8217;s it!  To use this script, we simply need to call init() once at the start of the game, and then comm() everytime you wish to send/receive some data (perhaps every 1/30th of a second).  As mentioned, here is no &#8216;server&#8217; involved, the two peers connect direction to each other via a UDP socket.  All the user has to do is specify the two IP addresses.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/very-simple-2player-networking-in-python/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Compile Blender 2.45 &#8211; a how to guide</title>
		<link>http://blog.mikepan.com/compile-blender-advanced/</link>
		<comments>http://blog.mikepan.com/compile-blender-advanced/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 01:28:11 +0000</pubDate>
		<dc:creator>mike pan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://mikepan.homeip.net/blog/?p=39</guid>
		<description><![CDATA[This guide was written for Blender 2.45.  I have an updated guide for building Blender 2.5 available HERE. 1. Acquire Blender source code and libraries - Download and install tortoisesvn from: tortoisesvn.tigris.org -created a folder named &#8220;blender&#8221; under c:\build, select the folder and click on SVN checkout, and use the following location: https://svn.blender.org/svnroot/bf-blender/trunk/blender -created a [...]]]></description>
			<content:encoded><![CDATA[<p style="background:#F66; border:1px dashed; border-color: #666; padding: 10px; color:#000">This guide was written for Blender 2.45.  I have an updated guide for <a href="http://blog.mikepan.com/build-blender-2-5-a-visual-guide/">building Blender 2.5 available HERE.</a></p>
<h3>1. Acquire Blender source code and libraries</h3>
<p>- Download and install tortoisesvn from: <a href="http://tortoisesvn.tigris.org/">tortoisesvn.tigris.org</a><br />
-created a folder named &#8220;blender&#8221; under c:\build, select the folder and click on SVN checkout, and use the following location:</p>
<pre><strong>https://svn.blender.org/svnroot/bf-blender/trunk/blender</strong></pre>
<p>-created a folder named &#8220;windows&#8221; under c:\build\lib, select the folder and click on SVN checkout, and use the following location:</p>
<pre><strong>https://svn.blender.org/svnroot/bf-blender/trunk/lib/windows</strong></pre>
<p>Once the above 3 steps are done, you will have the most up-to-date blender source code and library in the world.</p>
<p style="background:#CCC; border:1px dashed; border-color: #666; padding: 10px; color:#000">OPTIONAL INFO: If you want to build an official release, you can grab the more stable source code (~10MB, library files are not included) from <a href="http://www.blender.org/download/source-code/">blender.org/download/source-code</a>.  Simply delete everything under C:\build\blender and then extract the tarball to the same directory.  Building from the official release ensures the Blender you compiled is stable and relatively bug-free.</p>
<h3>2. Acquire compiling softwares</h3>
<p>- Download and install Python 2.5.1 (9MB) from <a href="http://www.python.org/download/releases/2.5.1/"> www.python.org </a><br />
- Download Mingw 5.1.3 (~10MB) from <a href="http://sourceforge.net/project/showfiles.php?group_id=2435&amp;package_id=240780&amp;release_id=529741"> www.mingw.org </a>.  Run the installer, Pick any mirror, Select <strong>Current</strong> and install packages <strong>MinGW BASETOOLS</strong> and <strong>G++ COMPILER</strong>.<br />
- Download and install SCons 0.97 Windows (300KB) from <a href="http://prdownloads.sourceforge.net/scons/scons-0.97.win32.exe"> www.scons.org </a><br />
- Download the experimental GCC4.x for MinGW package from <a href="http://www.tdragon.net/recentgcc/">tdragon.net</a>.  Extract it to the place where you installed MinGW, and this will serve as a &#8216;drop in&#8217; replacement compiler.  From my own testing, GCC4 is faster than the one that comes with MinGW, but can cause trouble when compiling OpenAL.</p>
<h3>3. Environment setup</h3>
<p>- Go to Start Menu &gt;&gt; Control Panel &gt;&gt; System &gt;&gt; Advanced (Tab) &gt;&gt; Envoronmant Variables (button) &gt;&gt; System Variables scroll area double click on the PATH item<br />
- Add the following line to the end: <code style="background:#FCA; padding: 5px; color:#000">;C:\Python25;C:\mingw\bin</code></p>
<h3>4. Python stuff&#8230;</h3>
<p>Copy <strong>libpython25.a</strong> from <strong>C:\Python25\libs</strong> to <strong>C:\build\lib\windows\python\lib</strong></p>
<p><strong><br />
</strong></p>
<h3>5. Customization (Enable/disable features, add speed optimizations)</h3>
<p>- Create a new file named <strong>user-config.py</strong> under <strong>C:\build\blender\</strong><br />
- Open user-config.py with notepad and copy the following text into it.</p>
<p style="background:#FCA; padding: 5px; color:#000">WITH_BF_GAMEENGINE=&#8217;true&#8217;<br />
WITH_BF_BULLET = &#8216;true&#8217;<br />
WITH_BF_ODE = &#8216;true&#8217;<br />
WITH_BF_OPENEXR = &#8216;true&#8217;<br />
WITH_BF_FTGL = &#8216;true&#8217;<br />
WITH_BF_FMOD = &#8216;true&#8217;<br />
WITH_BF_FFMPEG = &#8216;true&#8217;<br />
WITH_BF_QUICKTIME = &#8216;false&#8217;<br />
WITH_BF_OPENAL = &#8216;false&#8217;<br />
WITH_BF_SDL = &#8216;false&#8217;<br />
BF_PYTHON_VERSION = &#8217;2.5&#8242;</p>
<p>CCFLAGS.extend( ['-march=i686', '-ftracer', '-fomit-frame-pointer', '-finline-functions', '-ffast-math'])<br />
CXXFLAGS.extend(['-march=i686', '-ftracer', '-fomit-frame-pointer', '-finline-functions', '-ffast-math'])</p>
<p>REL_CFLAGS = [ '-O3' ]<br />
REL_CCFLAGS = [ '-O3' ]</p>
<p><strong>&#8216;-march=&#8217;</strong> is probably the most important flag in this config file.  Newer Intel CPU (Pentium D, Core 2) owners are recommended to use <strong>&#8216;-march=nocona&#8217;</strong>, AMD (A64, X2) owners can try <strong>&#8216;-march=k8&#8242;</strong>.<br />
<strong>&#8216;-mmmx&#8217;, &#8216;-msse&#8217;, &#8216;-msse2&#8242;, &#8216;-msse3&#8242;</strong> are usually implied by using a valid <strong>march</strong> flag, therefore they are not included in the config file.<br />
<strong>&#8216;-ffast-math&#8217;</strong> are in general stable enough for daily use (I&#8217;ve never seen a crash), but if you are running a real production server or can not tolorate crashes, remove this flag.  It will make the binary a little slower.</p>
<p>This is how the directory should look like:<br />
<img class="alignnone size-full wp-image-161" title="build2" src="http://blog.mikepan.com/wp-content/uploads/build2.png" alt="build2" width="340" height="592" /></p>
<h3>6. Compile!</h3>
<p>- Open a command prompt window by click on Start &gt;&gt; Run &gt;&gt; type in &#8220;cmd&#8221; and hit OK.<br />
- Navigate to where the Blender source code is by typing this into the command prompt <code style="background:#FCA; padding: 5px; color:#000">cd C:\build\blender</code><br />
- Start the building process: <code style="background:#FCA; padding: 5px; color:#000">scons BF_TOOLSET=mingw BF_BUILDDIR=c:\install -j4</code><br />
- The above command should take about 5-10 minutes to process, and it helps if you have a dual-core processor!<br />
- When it finishes, (Hopefully without error), you can nagivate to <strong>C:\install\win32-mingw\</strong> and find a complete Blender installation ready to be zipped up and distributed!</p>
<h3>Where to go from here?</h3>
</p>
<p style="background:#CCC; border:1px dashed; border-color: #666; padding: 10px; color:#000">You might want to rid the blender.exe of extra useless debug data by entering the following command into the command line:<br />
<strong>strip C:\install\win32-mingw\blender.exe</strong><br />
This will reduce the size of the executable by 8mb or so without having any negative impact</p>
<p>The above &#8216;user-config.py&#8217; file will result in a full-featured Blender that is optimized for speed and should run on almost all modern processors.  To speed up the building process, you can chose to disable some of the features by replacing &#8216;true&#8217; with &#8216;false&#8217; (this will give you a blender binary without certain feaures such as gameengine, audio, etc&#8230;)<br />
<code style="padding: 5px; background: #ffccaa none repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; color: #000000;">scons clean BF_TOOLSET=mingw BF_BUILDDIR=C:\install</code><br />
can be used to clean the build data and getting ready for a new build</p>
<p><strong> </strong><br />
<strong>I also recommend</strong>: How to <a href="http://www.geneome.net/index.php/blender-tutorials/building-blender-with-msvc-using-cmake/">build Blender using Visual C++ Express Edition 2008</a> By Eugene (etr9j), MSVC produces faster binary, but takes a lot longer to setup for the first time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/compile-blender-advanced/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Compile Blender 2.45 &#8211; an easy how to guide</title>
		<link>http://blog.mikepan.com/compile-blender-simple/</link>
		<comments>http://blog.mikepan.com/compile-blender-simple/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 01:26:37 +0000</pubDate>
		<dc:creator>mike pan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://mikepan.homeip.net/blog/?p=37</guid>
		<description><![CDATA[This guide was written for Blender 2.45.  I have an updated guide for building Blender 2.5 available HERE. 1. Acquire Blender source code and libraries - Download and install tortoisesvn from: tortoisesvn.tigris.org -created a folder named &#8220;blender&#8221; under c:\build, select the folder and click on SVN checkout, and use the following location: https://svn.blender.org/svnroot/bf-blender/trunk/blender -created a [...]]]></description>
			<content:encoded><![CDATA[<p style="background:#F66; border:1px dashed; border-color: #666; padding: 10px; color:#000">This guide was written for Blender 2.45.  I have an updated guide for <a href="http://blog.mikepan.com/build-blender-2-5-a-visual-guide/">building Blender 2.5 available HERE</a>.</p>
<h3>1. Acquire Blender source code and libraries</h3>
<p>- Download and install tortoisesvn from: <a href="http://tortoisesvn.tigris.org/">tortoisesvn.tigris.org</a><br />
-created a folder named &#8220;blender&#8221; under c:\build, select the folder and click on SVN checkout, and use the following location:</p>
<pre><strong>https://svn.blender.org/svnroot/bf-blender/trunk/blender</strong></pre>
<p>-created a folder named &#8220;windows&#8221; under c:\build\lib, select the folder and click on SVN checkout, and use the following location:</p>
<pre><strong>https://svn.blender.org/svnroot/bf-blender/trunk/lib/windows</strong></pre>
<h3>2. Acquire compiling softwares</h3>
<p>- Download and install Python 2.5.1 (9MB) from <a href="http://www.python.org/download/releases/2.5.1/"> www.python.org </a><br />
- Download Mingw 5.1.3 (~10MB) from <a href="http://sourceforge.net/project/showfiles.php?group_id=2435&amp;package_id=240780&amp;release_id=529741"> www.mingw.org </a>.  Run the installer, Pick any mirror, Select <strong>Current</strong> and install packages <strong>MinGW BASETOOLS</strong> and <strong>G++ COMPILER</strong>.<br />
- Download and install SCons 0.97 Windows (300KB) from <a href="http://prdownloads.sourceforge.net/scons/scons-0.97.win32.exe"> www.scons.org </a></p>
<h3>3. Environment setup</h3>
<p>- Go to Start Menu &gt;&gt; Control Panel &gt;&gt; System &gt;&gt; Advanced (Tab) &gt;&gt; Envoronmant Variables (button) &gt;&gt; System Variables scroll area double click on the PATH item<br />
- Add the following line to the end: <code style="background:#FCA; padding: 5px; color:#000">;C:\Python25;C:\mingw\bin</code><br />
- Copy <strong>libpython25.a</strong> from <strong>C:\Python25\libs</strong> to <strong>C:\build\lib\windows\python\lib</strong></p>
<h3>4. Compile!</h3>
<p>Before you start, this is how the everything should look like:</p>
<p><img class="alignnone size-full wp-image-161" title="build2" src="http://blog.mikepan.com/wp-content/uploads/build2.png" alt="build2" width="340" height="592" /></p>
<p>- Open a command prompt window by click on Start &gt;&gt; Run &gt;&gt; type in &#8220;cmd&#8221; and hit OK.</p>
<p>- Navigate to where the Blender source code is by typing this into the command prompt <code style="background:#FCA; padding: 5px; color:#000">cd C:\build\blender</code></p>
<p>- Start the building process by:<br />
<code style="background:#FCA; padding: 5px; color:#000">scons BF_BUILDDIR=c:\install -j4</code></p>
<p>- The above command should take about 5-10 minutes to process, and it helps if you have a dual-core processor!</p>
<p>- When it finishes, (Hopefully without error), you can nagivate to <strong>C:\install\win32-mingw\</strong> and find a complete Blender installation ready to be zipped up and distributed!</p>
<h3>Where to go from here?</h3>
<p style="background:#CCC; border:1px dashed; border-color: #666; padding: 10px; color:#000">You might want to rid the blender.exe of extra useless debug data by entering the following command into the command line:<br />
<strong>strip C:\install\win32-mingw\blender.exe</strong><br />
This will reduce the size of the executable by 8mb or so without having any negative impact</p>
<p><strong>scons clean BF_BUILDDIR=C:\install</strong><br />
can be used to clean the build data and getting ready for a new build</p>
<p>Once you have successfully compiled Blender, you can try more customization by following the <a href="?compileblender">Advanced Guide.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/compile-blender-simple/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Blender Game networking test</title>
		<link>http://blog.mikepan.com/blender-game-networking-test/</link>
		<comments>http://blog.mikepan.com/blender-game-networking-test/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 04:36:06 +0000</pubDate>
		<dc:creator>mike pan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[realtime]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://mikepan.homeip.net/blog/?p=30</guid>
		<description><![CDATA[Now that I am working on a game, using Python cPickle and Socket, i was able to create a peer to peer, symmetrical network implementation for the multiplayer aspect of the project.   Using some 30 lines of Python, each player would &#8216;trade&#8217; data with its peers. I am using UDP, so it&#8217;s naturally faster than [...]]]></description>
			<content:encoded><![CDATA[<p>Now that I am working on a <a href="http://blenderartists.org/forum/showthread.php?t=161961">game</a>, using Python cPickle and Socket, i was able to create a  peer to peer, symmetrical network implementation for the multiplayer aspect of the project.   Using some 30 lines of Python, each player would &#8216;trade&#8217; data with its peers.</p>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/Az8C1IW5E5s&#038;hl=en_US&#038;fs=1&#038;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Az8C1IW5E5s&#038;hl=en_US&#038;fs=1&#038;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
<p>I am using UDP, so it&#8217;s naturally faster than TCP/IP, but delivery is not guranteed.  But for realtime games latency is the main concern, so UDP is definitely the way to go.  The video shows me controlling a cube on the desktop computer (monitor to the right), it&#8217;s position data is sent across the internet* to the laptop which displays a similar cube.</p>
<p>Close to the end of the video, I turned off the Wi-Fi on the laptop, killing the network connection.  As expected, the cube stops updating, when I turn it back on, it takes a few second to reconnect, and then the cube starts moving again.</p>
<p>*I route the network traffic through another computer somewhere in town to simulate a more realistic network delay.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mikepan.com/blender-game-networking-test/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
