<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DUQGRn4-fip7ImA9WhRaFEs.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522</id><updated>2012-02-17T00:28:47.056-08:00</updated><category term="Personal" /><category term="Questrade" /><category term="Python" /><category term="Antec" /><category term="Hash" /><category term="Online Broker" /><category term="Career Advice" /><category term="String" /><category term="Thoughts" /><category term="My Work" /><category term="Game Industry" /><category term="Scribbles" /><category term="Parts" /><category term="Shader" /><category term="Photoshop" /><category term="C++" /><category term="KGC" /><category term="Garbage" /><category term="Games" /><category term="Graphics" /><category term="Git" /><category term="Vancouver" /><category term="Svn" /><category term="animation" /><category term="Debugging" /><category term="Google Fanboy" /><category term="Money" /><category term="Video" /><category term="Health" /><category term="Autodesk" /><category term="x65599" /><category term="Recommends" /><category term="Housekeeping" /><category term="Coding" /><category term="Selfhelp Guide" /><category term="This and That" /><category term="Copyright" /><category term="Music" /><category term="Physics" /><category term="Server" /><category term="Workaround" /><category term="Fun" /><category term="PHP" /><category term="Interests" /><category term="Web Dev" /><category term="VCS" /><category term="Rants" /><category term="Coding Standards" /><category term="Linux" /><category term="investment" /><category term="Scrum" /><category term="Tools" /><category term="Hardware" /><category term="Shadow" /><category term="Education" /><category term="Optimization" /><category term="P4" /><category term="unity" /><category term="Books" /><title>Blind Renderer</title><subtitle type="html">I once said "unless side-tracked, this will be my professional blog on game development".  Scratch that. I will just write about whatever I do: coding, ranting and being an emo</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://www.popekim.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://www.popekim.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>85</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/BlindRenderer" /><feedburner:info uri="blindrenderer" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="license" type="text/html" href="http://creativecommons.org/licenses/by-nc-sa/3.0/" /><entry gd:etag="W/&quot;CkQNRHo5fCp7ImA9WhRaEU8.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-678850565238756571</id><published>2012-02-12T23:35:00.000-08:00</published><updated>2012-02-13T00:06:35.424-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-13T00:06:35.424-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Health" /><category scheme="http://www.blogger.com/atom/ns#" term="Personal" /><title>Crazy Eye Pain &amp; Headache = MSG Side Effects?</title><content type="html">This morning, I woke up with some crazy eye pain, headache and nausea and I had no clue what caused it. &amp;nbsp;This is my 2nd time having these symptoms. &amp;nbsp;The first one was sometime last year when I had to call in sick. &amp;nbsp;I usually don't have headaches. &amp;nbsp;Just this one is too strong for me to do any normal works: the only thing I can do is just to lie down and do nothing.&lt;br /&gt;
&lt;br /&gt;
Once I got better around 11 PM, I did some web search and now I think it might be related to the high intake of MSG. &amp;nbsp;According to&amp;nbsp;&lt;a href="http://www.healthy-holistic-living.com/msg-side-effects.html"&gt;this site&lt;/a&gt;, my symptoms are MSG side effects, and guess what?&amp;nbsp;I went to a Chinese restaurant last night and ate a lot! &amp;nbsp;Too bad, I don't remember what I ate last time I had this problem. &amp;nbsp;If I remembered, I would be more certain. :)&lt;br /&gt;
&lt;br /&gt;
Oh well, MSG can be unhealthy anyways, so I guess it's time to cut, or reduce, MSG out of my diet?&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-678850565238756571?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oE7c1Rei2RoCATtbpBofLOqFL8M/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oE7c1Rei2RoCATtbpBofLOqFL8M/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/oE7c1Rei2RoCATtbpBofLOqFL8M/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oE7c1Rei2RoCATtbpBofLOqFL8M/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=ZK7yJNi8Nac:NsE2lY3uLFw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=ZK7yJNi8Nac:NsE2lY3uLFw:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=ZK7yJNi8Nac:NsE2lY3uLFw:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=ZK7yJNi8Nac:NsE2lY3uLFw:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=ZK7yJNi8Nac:NsE2lY3uLFw:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=ZK7yJNi8Nac:NsE2lY3uLFw:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=ZK7yJNi8Nac:NsE2lY3uLFw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=ZK7yJNi8Nac:NsE2lY3uLFw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=ZK7yJNi8Nac:NsE2lY3uLFw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=ZK7yJNi8Nac:NsE2lY3uLFw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=ZK7yJNi8Nac:NsE2lY3uLFw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=ZK7yJNi8Nac:NsE2lY3uLFw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=ZK7yJNi8Nac:NsE2lY3uLFw:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=ZK7yJNi8Nac:NsE2lY3uLFw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=ZK7yJNi8Nac:NsE2lY3uLFw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=ZK7yJNi8Nac:NsE2lY3uLFw:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/ZK7yJNi8Nac" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/678850565238756571/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2012/02/crazy-eye-pain-headache-msg-side.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/678850565238756571?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/678850565238756571?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/ZK7yJNi8Nac/crazy-eye-pain-headache-msg-side.html" title="Crazy Eye Pain &amp; Headache = MSG Side Effects?" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><thr:total>2</thr:total><feedburner:origLink>http://www.popekim.com/2012/02/crazy-eye-pain-headache-msg-side.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUUESHoyfSp7ImA9WhRbGEQ.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-1173678541089062823</id><published>2012-02-10T09:00:00.000-08:00</published><updated>2012-02-10T09:00:09.495-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-10T09:00:09.495-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Music" /><category scheme="http://www.blogger.com/atom/ns#" term="Personal" /><title>[WIP] Music: Out of Reach Intro</title><content type="html">This is something I wrote last night.. It's still intro to a song I, for now, call Out of Reach. &amp;nbsp;I quite like it, so I might finish it one day.. yes one day...&lt;br /&gt;
&lt;br /&gt;
&lt;iframe frameborder="no" height="166" scrolling="no" src="http://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F36148040&amp;amp;show_artwork=true" width="100%"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For comments, use &lt;a href="http://www.facebook.com/popekim"&gt;my Facebook (one-man) band page&lt;/a&gt; I guess?&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-1173678541089062823?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KpU71blZKFWRxBbt7VTQiDPeslc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KpU71blZKFWRxBbt7VTQiDPeslc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KpU71blZKFWRxBbt7VTQiDPeslc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KpU71blZKFWRxBbt7VTQiDPeslc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=mVfd83M5XB4:WQPj7Jf6XoE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=mVfd83M5XB4:WQPj7Jf6XoE:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=mVfd83M5XB4:WQPj7Jf6XoE:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=mVfd83M5XB4:WQPj7Jf6XoE:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=mVfd83M5XB4:WQPj7Jf6XoE:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=mVfd83M5XB4:WQPj7Jf6XoE:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=mVfd83M5XB4:WQPj7Jf6XoE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=mVfd83M5XB4:WQPj7Jf6XoE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=mVfd83M5XB4:WQPj7Jf6XoE:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=mVfd83M5XB4:WQPj7Jf6XoE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=mVfd83M5XB4:WQPj7Jf6XoE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=mVfd83M5XB4:WQPj7Jf6XoE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=mVfd83M5XB4:WQPj7Jf6XoE:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=mVfd83M5XB4:WQPj7Jf6XoE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=mVfd83M5XB4:WQPj7Jf6XoE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=mVfd83M5XB4:WQPj7Jf6XoE:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/mVfd83M5XB4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/1173678541089062823/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2012/02/wip-music-out-of-reach-intro.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/1173678541089062823?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/1173678541089062823?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/mVfd83M5XB4/wip-music-out-of-reach-intro.html" title="[WIP] Music: Out of Reach Intro" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.popekim.com/2012/02/wip-music-out-of-reach-intro.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEAQX0zeSp7ImA9WhRbGEk.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-2050250280528838830</id><published>2012-02-09T19:14:00.000-08:00</published><updated>2012-02-09T19:14:00.381-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-09T19:14:00.381-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Game Industry" /><category scheme="http://www.blogger.com/atom/ns#" term="investment" /><category scheme="http://www.blogger.com/atom/ns#" term="Personal" /><title>TFSA over RRSP? Probably Not for Game Devs</title><content type="html">&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-kmgce1xXa-U/TzH-oekJ6uI/AAAAAAAAA08/5sPYY8zmhNA/s1600/TFSA-vs-RRSP.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-kmgce1xXa-U/TzH-oekJ6uI/AAAAAAAAA08/5sPYY8zmhNA/s1600/TFSA-vs-RRSP.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;b&gt;Image Source&lt;/b&gt;:&amp;nbsp;http://chelleyc.uibcsites.com/files/2011/02/TFSA-vs-RRSP.jpg&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Since TFSA is introduced a few years ago, there has been good debates on which one one should max out first between TFSA and RRSP. &amp;nbsp;And nowadays, a lot of financial advisers seem to advise TFSA over RRSP.&lt;br /&gt;
&lt;br /&gt;
I don't think so, at least for game developers, who tend to get easily laid off, thus forced to be out of the job, compared to people in other industries. (TFSA over RRSP might make sense for people in other industries, but I don't really care).&lt;br /&gt;
&lt;br /&gt;
Okay, here is the deal. &amp;nbsp;You can buy up to 18% of last year's income. &amp;nbsp;Let's say you make $100,000 am year. (for easy calculation) &amp;nbsp;If you don't buy RRSP, you will be taxed $25,454 in BC according to &lt;a href="http://www.taxtips.ca/calculators/basiccalculator.htm"&gt;this online calculator&lt;/a&gt; whether you buy TFSA or not. &amp;nbsp;But if you max out your RRSP($18,000) you will only be taxed $18,623. &amp;nbsp;So $6,831 saving.&lt;br /&gt;
&lt;br /&gt;
Sure, you pay tax when you withdraw the RRSP, but based on the income of the year when you make the withdrawal. &amp;nbsp;That's what makes RRSP a better choice for game developers. &amp;nbsp;Say, you get laid off next year and you are out of the job for 6 months. &amp;nbsp;Then your income and tax will be $50,000 and &amp;nbsp;$8,848. &amp;nbsp;You think this is not enough money to pay all your bills. &amp;nbsp;So you withdraw RRSP, $18,000. &amp;nbsp;Then your income and tax become $68,000 and $14,194. &amp;nbsp;It's $5,346 extra tax for you for that year.&lt;br /&gt;
&lt;br /&gt;
Since you saved $6,831 last year, but paid $5,346 this year your overall saving is $1,485. &amp;nbsp;If you had put $18,000 in TFSA, do you think you can make $1,485 / $18,000 = 8.25% return? &amp;nbsp;Doubt it. &amp;nbsp;So to me, RRSP is a better choice in this industry. &amp;nbsp;Well, maybe you haven't laid off so far, but it can happen anytime even if you are super competent. &amp;nbsp;Sometimes, companies have to lay off people to show investors they are doing something to turn around.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-2050250280528838830?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/L-CPkrodMieFyn_Iu9Cfhzdc-Gc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/L-CPkrodMieFyn_Iu9Cfhzdc-Gc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/L-CPkrodMieFyn_Iu9Cfhzdc-Gc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/L-CPkrodMieFyn_Iu9Cfhzdc-Gc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=CxEzh9aEJNU:y2BRaYdKsvo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=CxEzh9aEJNU:y2BRaYdKsvo:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=CxEzh9aEJNU:y2BRaYdKsvo:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=CxEzh9aEJNU:y2BRaYdKsvo:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=CxEzh9aEJNU:y2BRaYdKsvo:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=CxEzh9aEJNU:y2BRaYdKsvo:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=CxEzh9aEJNU:y2BRaYdKsvo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=CxEzh9aEJNU:y2BRaYdKsvo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=CxEzh9aEJNU:y2BRaYdKsvo:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=CxEzh9aEJNU:y2BRaYdKsvo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=CxEzh9aEJNU:y2BRaYdKsvo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=CxEzh9aEJNU:y2BRaYdKsvo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=CxEzh9aEJNU:y2BRaYdKsvo:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=CxEzh9aEJNU:y2BRaYdKsvo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=CxEzh9aEJNU:y2BRaYdKsvo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=CxEzh9aEJNU:y2BRaYdKsvo:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/CxEzh9aEJNU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/2050250280528838830/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2012/02/tfsa-over-rrsp-probably-not-for-game.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/2050250280528838830?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/2050250280528838830?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/CxEzh9aEJNU/tfsa-over-rrsp-probably-not-for-game.html" title="TFSA over RRSP? Probably Not for Game Devs" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-kmgce1xXa-U/TzH-oekJ6uI/AAAAAAAAA08/5sPYY8zmhNA/s72-c/TFSA-vs-RRSP.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.popekim.com/2012/02/tfsa-over-rrsp-probably-not-for-game.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUICQXczfyp7ImA9WhRbFko.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-4611648021545930520</id><published>2012-02-07T20:08:00.000-08:00</published><updated>2012-02-07T21:06:00.987-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-07T21:06:00.987-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Game Industry" /><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><category scheme="http://www.blogger.com/atom/ns#" term="Personal" /><category scheme="http://www.blogger.com/atom/ns#" term="Selfhelp Guide" /><category scheme="http://www.blogger.com/atom/ns#" term="Career Advice" /><category scheme="http://www.blogger.com/atom/ns#" term="Garbage" /><title>Lying Throughout Your Career</title><content type="html">There was someone who did (have to) leave my company recently. &amp;nbsp;He is one of those people who have to jump around companies after short stays. Yeah, you know why. &amp;nbsp;And today, I happened to read his blog post explaining why he was leaving. A lot of my co-workers enjoyed it because it reminded us of the Lord of the Rings, arguably the best fantasy fiction to date.&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-709r3JsPAqo/TzH16omZqrI/AAAAAAAAA0w/SOtgAO6QwyM/s1600/Smeagol.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-709r3JsPAqo/TzH16omZqrI/AAAAAAAAA0w/SOtgAO6QwyM/s1600/Smeagol.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;b&gt;Image Source:&lt;/b&gt;&amp;nbsp;http://images.wikia.com/lotr/images/9/9e/Smeagol.jpg&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
I am not going to point out all the lies because 'someone' desperately needs those to stay in this industry. &amp;nbsp;I just suspect pretty soon 'someone' will have to find a job outside of this beautiful city, Vancouver, because he seems to be very well-known here. &amp;nbsp;Furthermore, dealing with a possible defamation charge is not something I want to do at this moment although I'm pretty sure I would enjoy it because I'll win no matter what: my claim is not false, that is. (after all, I'm still a lawyer, hah!) &amp;nbsp;Just it's a headache dealing with an idiot with no clue, but if anyone asks me personally, I wouldn't hesitate to tell him/her. I'm an honest guy and can't lie or hide anything.&lt;br /&gt;
&lt;br /&gt;
Oh, speaking of lies, I know how to&amp;nbsp;distinguish facts from opinions or judgement. &amp;nbsp;That's one thing I was trained for really hard at my&amp;nbsp;lawschool. &amp;nbsp;For the same reason, I call him a liar for claiming false facts, not because of his out-of-mind judgement or opinions. &amp;nbsp;But if he truly believes in what he claims, I guess he has absolutely no minimum required skillset to be an engineer, or &lt;a href="http://www.bcmhas.ca/"&gt;this place&lt;/a&gt;&amp;nbsp;will be his new home.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-1GtuWmfQc7Y/TzHxID7riZI/AAAAAAAAA0k/WcSapXOodB8/s1600/funny-pictures-you-say-psycho-like-its-a-bad-thing.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-1GtuWmfQc7Y/TzHxID7riZI/AAAAAAAAA0k/WcSapXOodB8/s1600/funny-pictures-you-say-psycho-like-its-a-bad-thing.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-4611648021545930520?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/-jFZCwAABcIb4oRm3ONFw8Ub2HU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-jFZCwAABcIb4oRm3ONFw8Ub2HU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/-jFZCwAABcIb4oRm3ONFw8Ub2HU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/-jFZCwAABcIb4oRm3ONFw8Ub2HU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=l5r9Nwv-duM:6VDRvbLcvjo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=l5r9Nwv-duM:6VDRvbLcvjo:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=l5r9Nwv-duM:6VDRvbLcvjo:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=l5r9Nwv-duM:6VDRvbLcvjo:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=l5r9Nwv-duM:6VDRvbLcvjo:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=l5r9Nwv-duM:6VDRvbLcvjo:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=l5r9Nwv-duM:6VDRvbLcvjo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=l5r9Nwv-duM:6VDRvbLcvjo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=l5r9Nwv-duM:6VDRvbLcvjo:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=l5r9Nwv-duM:6VDRvbLcvjo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=l5r9Nwv-duM:6VDRvbLcvjo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=l5r9Nwv-duM:6VDRvbLcvjo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=l5r9Nwv-duM:6VDRvbLcvjo:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=l5r9Nwv-duM:6VDRvbLcvjo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=l5r9Nwv-duM:6VDRvbLcvjo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=l5r9Nwv-duM:6VDRvbLcvjo:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/l5r9Nwv-duM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/4611648021545930520/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2012/02/lying-throughout-your-career.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/4611648021545930520?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/4611648021545930520?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/l5r9Nwv-duM/lying-throughout-your-career.html" title="Lying Throughout Your Career" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-709r3JsPAqo/TzH16omZqrI/AAAAAAAAA0w/SOtgAO6QwyM/s72-c/Smeagol.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.popekim.com/2012/02/lying-throughout-your-career.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D04HQXs8fCp7ImA9WhRbFUg.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-1756994401761038030</id><published>2012-02-04T11:39:00.000-08:00</published><updated>2012-02-06T11:18:50.574-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-06T11:18:50.574-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="unity" /><category scheme="http://www.blogger.com/atom/ns#" term="animation" /><category scheme="http://www.blogger.com/atom/ns#" term="Graphics" /><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><title>Animation Sharing between Different Characters with Same Topology in Unity</title><content type="html">&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;a href="http://2.bp.blogspot.com/-mBOZNyARPrU/TzAnKMXEGfI/AAAAAAAAA0U/HI9rrxk1PQY/s1600/sharing_anim.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="446" src="http://2.bp.blogspot.com/-mBOZNyARPrU/TzAnKMXEGfI/AAAAAAAAA0U/HI9rrxk1PQY/s640/sharing_anim.jpg" width="640" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="font-size: 13px;"&gt;&lt;b&gt;Image Source&lt;/b&gt;: http://answers.unity3d.com/questions/191282/sharing-animations-between-models.html&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br class="Apple-interchange-newline" /&gt;&lt;br /&gt;
So let's say you have multiple characters with different bone lengths, but you just don't have manpower to author&amp;nbsp;different animations for all of them. Can we share animations, instead? &amp;nbsp;Sure, why not, if you can live without transition and scale animations on joints: in other words, you are only gonna use rotations. Think it this way. When you rotate your right elbow inward by 90 degrees, your pose will look same as your shorter friend applying the exactly same rotation on his right elbow.&amp;nbsp;Got it?&lt;br /&gt;
&lt;br /&gt;
Okay, so I was searching Unity forum to see if rotation-only animation is officially supported. &amp;nbsp;Didn't look like it. &amp;nbsp;Then next up. &amp;nbsp;Can we somehow trim out non-rotational info from an anim file in the pipeline? I was not able to find the answer again&lt;strike&gt;, or even anyone asking&lt;/strike&gt;. (Sorry, after finishing this post, I actually found &lt;a href="http://answers.unity3d.com/questions/191282/sharing-animations-between-models.html#comment-191370"&gt;someone asking, but noone really answered.&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
And the good news is....... -drum rolls- .... I figured it out! :D&lt;br /&gt;
&lt;br /&gt;
So this is what I came up with and it works great: (code shown below)&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Make a script called ConvertToRotationOnlyAnim.cs inside of Assets/Editor folder.&lt;/li&gt;
&lt;li&gt;Add a menu item invoking this script.&lt;/li&gt;
&lt;li&gt;Import your animation into Unity. &amp;nbsp;(doesn't matter where it's from as long as Unity sees it as animation)&lt;/li&gt;
&lt;li&gt;Right-click on the imported animation asset and select the menu item we just added at step #2.&lt;/li&gt;
&lt;li&gt;In the Script, copy over only the curves which have "m_LocalRotation" as propertyName field.&lt;/li&gt;
&lt;li&gt;Now set the new _rot animation clip to your game object's animation component.&lt;/li&gt;
&lt;li&gt;Hit play and enjoy... :)&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
And here is the full source code I wrote for this. &amp;nbsp;Hopefully the comment is self-explanatory:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;using UnityEditor;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;using UnityEngine;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;using System.IO;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;public class ConvertToRotationOnlyAnim&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; [MenuItem("Assets/Convert To Rotation Animation")]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; static void ConvertToRotationAnimation()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Get Selected Animation Clip&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AnimationClip sourceClip = Selection.activeObject as AnimationClip;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (sourceClip == null)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Debug.Log("Please select an animation clip");&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Rotation only anim clip will have "_rot" post fix at the end&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; const string destPostfix = "_rot";&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string sourcePath = AssetDatabase.GetAssetPath(sourceClip);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string destPath = Path.Combine(Path.GetDirectoryName(sourcePath), sourceClip.name) + destPostfix + ".anim";&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // first try to open existing clip to avoid losing reference to this animation from other meshes that are already using it.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AnimationClip destClip = AssetDatabase.LoadAssetAtPath(destPath, typeof(AnimationClip)) as AnimationClip;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (destClip == null)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // existing clip not found. &amp;nbsp;Let's create a new one&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Debug.Log("creating a new rotation only animation at " + destPath);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; destClip = new AnimationClip();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; destClip.name = sourceClip.name + destPostfix;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AssetDatabase.CreateAsset(destClip, destPath);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AssetDatabase.Refresh();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // and let's load it back, just to make sure it's created?&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; destClip = AssetDatabase.LoadAssetAtPath(destPath, typeof(AnimationClip)) as AnimationClip;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (destClip == null)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Debug.Log("cannot create/open the rotation only anim at " + destPath);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // clear all the existing curves from destination.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; destClip.ClearCurves();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // Now copy only rotation curves&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AnimationClipCurveData[] curveDatas = AnimationUtility.GetAllCurves(sourceClip, true);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (AnimationClipCurveData curveData in curveDatas)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (curveData.propertyName.Contains("m_LocalRotation"))&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AnimationUtility.SetEditorCurve(&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; destClip,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curveData.path,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curveData.type,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curveData.propertyName,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; curveData.curve&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Debug.Log("Hooray! Coverting to rotation-only anim to " + destClip.name + " is done");&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-1756994401761038030?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5FaElYCLSvFtpFG21hZOWt5IQpc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5FaElYCLSvFtpFG21hZOWt5IQpc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5FaElYCLSvFtpFG21hZOWt5IQpc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5FaElYCLSvFtpFG21hZOWt5IQpc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=hYkTX9YcK3Q:EMt9NJ7FtPs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=hYkTX9YcK3Q:EMt9NJ7FtPs:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=hYkTX9YcK3Q:EMt9NJ7FtPs:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=hYkTX9YcK3Q:EMt9NJ7FtPs:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=hYkTX9YcK3Q:EMt9NJ7FtPs:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=hYkTX9YcK3Q:EMt9NJ7FtPs:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=hYkTX9YcK3Q:EMt9NJ7FtPs:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=hYkTX9YcK3Q:EMt9NJ7FtPs:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=hYkTX9YcK3Q:EMt9NJ7FtPs:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=hYkTX9YcK3Q:EMt9NJ7FtPs:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=hYkTX9YcK3Q:EMt9NJ7FtPs:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=hYkTX9YcK3Q:EMt9NJ7FtPs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=hYkTX9YcK3Q:EMt9NJ7FtPs:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=hYkTX9YcK3Q:EMt9NJ7FtPs:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=hYkTX9YcK3Q:EMt9NJ7FtPs:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=hYkTX9YcK3Q:EMt9NJ7FtPs:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/hYkTX9YcK3Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/1756994401761038030/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2012/02/sharing-animations-between-different.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/1756994401761038030?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/1756994401761038030?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/hYkTX9YcK3Q/sharing-animations-between-different.html" title="Animation Sharing between Different Characters with Same Topology in Unity" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-mBOZNyARPrU/TzAnKMXEGfI/AAAAAAAAA0U/HI9rrxk1PQY/s72-c/sharing_anim.jpg" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://www.popekim.com/2012/02/sharing-animations-between-different.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4CQX88cCp7ImA9WhRbEEs.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-1624143752874530761</id><published>2012-01-31T18:56:00.000-08:00</published><updated>2012-01-31T18:56:00.178-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-31T18:56:00.178-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Workaround" /><category scheme="http://www.blogger.com/atom/ns#" term="Photoshop" /><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><title>"Fix" for ESC Not Working While Photoshop CS3 is Open</title><content type="html">So I have had this problem where ESC stops working globally while Adobe Photoshop CS3 is open for a few years. &amp;nbsp;CS5 doesn't suffer from this problem, but getting upgrade to CS5 was not easy because CS3 was the version we were using for Space Marine.&lt;br /&gt;
&lt;br /&gt;
So finally I spent some time to find a "fix": it was quite simple.. just open the task manager and kill ccc.exe (it's ATI control panel... so I don't give a shit). &amp;nbsp;Now re-launching CS3 solved the problem. Yay.&lt;br /&gt;
&lt;br /&gt;
Then I ran msconfig from Windows + Run, and then disabled CCC from launching when my machine starts up. &amp;nbsp;If I need to use CCC, I'll manually launch it. &amp;nbsp;I barely use it anyways, so not a big deal.&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-1624143752874530761?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/EAQO9MwfJ9qFOc5ujaJgm0IM7sg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EAQO9MwfJ9qFOc5ujaJgm0IM7sg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/EAQO9MwfJ9qFOc5ujaJgm0IM7sg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/EAQO9MwfJ9qFOc5ujaJgm0IM7sg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=DYOvUG7Bw_k:zuKMeQETxBM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=DYOvUG7Bw_k:zuKMeQETxBM:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=DYOvUG7Bw_k:zuKMeQETxBM:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=DYOvUG7Bw_k:zuKMeQETxBM:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=DYOvUG7Bw_k:zuKMeQETxBM:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=DYOvUG7Bw_k:zuKMeQETxBM:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=DYOvUG7Bw_k:zuKMeQETxBM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=DYOvUG7Bw_k:zuKMeQETxBM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=DYOvUG7Bw_k:zuKMeQETxBM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=DYOvUG7Bw_k:zuKMeQETxBM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=DYOvUG7Bw_k:zuKMeQETxBM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=DYOvUG7Bw_k:zuKMeQETxBM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=DYOvUG7Bw_k:zuKMeQETxBM:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=DYOvUG7Bw_k:zuKMeQETxBM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=DYOvUG7Bw_k:zuKMeQETxBM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=DYOvUG7Bw_k:zuKMeQETxBM:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/DYOvUG7Bw_k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/1624143752874530761/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2012/01/fix-for-esc-not-working-while-photoshop.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/1624143752874530761?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/1624143752874530761?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/DYOvUG7Bw_k/fix-for-esc-not-working-while-photoshop.html" title="&quot;Fix&quot; for ESC Not Working While Photoshop CS3 is Open" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.popekim.com/2012/01/fix-for-esc-not-working-while-photoshop.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUMMRXk6fCp7ImA9WhRVFE0.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-1415296274923310628</id><published>2012-01-11T21:00:00.000-08:00</published><updated>2012-01-12T13:24:44.714-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-12T13:24:44.714-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="x65599" /><category scheme="http://www.blogger.com/atom/ns#" term="Hash" /><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><category scheme="http://www.blogger.com/atom/ns#" term="C++" /><category scheme="http://www.blogger.com/atom/ns#" term="String" /><title>Compile-Time Hash String Generation</title><content type="html">&lt;b&gt;&lt;span style="font-size: x-large;"&gt;Motivation&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Recently, I worked on a code-base where everything was referenced by strings. &amp;nbsp;It was quite expensive as you can imagine, so to avoid the cost of string comparison, hash values(ints) were used. &amp;nbsp;This system had a giant hash string registry, which generates a hash value and stores both the hash and actual strings whenever the code sees a new string, well all during run-time.&lt;br /&gt;
&lt;br /&gt;
I personally did not enjoy this system for a number of reasons:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;it takes up too much memory&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;almost 90% of those strings were never really used as real char * string representation&lt;/li&gt;
&lt;li&gt;they were simply just look-up keys&lt;/li&gt;
&lt;li&gt;so no need to store actual string representations: just hash values were enough&lt;/li&gt;
&lt;li&gt;then we can generate hash values offline&lt;/li&gt;
&lt;/ul&gt;
&lt;li&gt;hash string registry was quite slow to be multithread-safe. New strings can be registered by any thread, so we had to have a locking mechanism, which turned out to be a bottle neck time to time&lt;/li&gt;
&lt;li&gt;strings in the executable or data files are easy to read by anyone with a hex editor. Maybe it makes attackers' life a bit easier?&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So I thought of doing something better...... (as follows)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style="font-size: x-large;"&gt;We Need Two Different String Types&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
I think we should adopt two different ways of handling strings for those 90% and 10%.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;1. Pure char* String (10%)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Any string that needs actual string representations should be in this format:&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;filenames that the game needs to load sometime (unless your filenames are hashed, too. If you wanna go nuts sure.. but I think it's too extreme)
&lt;/li&gt;
&lt;li&gt;any string that needs to be printed out on the screen. &amp;nbsp;You really don't want your users to read some hex number like 0xFFFFF, 0x888888 or 0x000000, right? (looking at the picture below.. I think it might be okay... lol)&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-6wkX03iwTq0/TwYbMVUwjcI/AAAAAAAAAw0/gxerqfvI4Ik/s1600/funny-pictures-hexcode-colors.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto; text-align: left;"&gt;&lt;img border="0" height="298" src="http://1.bp.blogspot.com/-6wkX03iwTq0/TwYbMVUwjcI/AAAAAAAAAw0/gxerqfvI4Ik/s400/funny-pictures-hexcode-colors.jpg" width="400" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Image Source:&amp;nbsp;&lt;a href="http://icanhascheezburger.com/2007/11/15/ffffff-888888-000000/"&gt;icanhascheeszburger.com&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Since they would be only 10% of the string for most games, probably you can just do strcmp() on them instead of generating and storing hash values for them. &amp;nbsp;But if you really insist, you can still do the similar thing to what our hash string manger used to do. (still better than having 10 times more strings stored on memory)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;2. Hash-Valued String (90%)&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
So all the other strings, of which char* representations are never used, will be just a simple hash value, an int. &amp;nbsp;A good example is any strings&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;only used for comparison&lt;/li&gt;
&lt;li&gt;only used as look-up key&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
#1(pure char* string) is very straight forward, so&amp;nbsp;from now on I'll only focus on #2(Hash-Valued String) in this post.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style="font-size: x-large;"&gt;Choosing a Good Hash Function: x65599&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
We all know what hash function is. &amp;nbsp;Just in case you don't, it's just a function that will "hopefully" generate unique integer values for different strings. (I said "hopefully" because there is chance to have a same vale for tow different strings: we call it hash collision.) &amp;nbsp;Once you have a unique hash value for each strings, you can simply compare two strings by those hash values instead of comparing every single characters in them What you get out of this? It's faster and simpler.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Then how do you generate a unique hash value for each string? &amp;nbsp;Well, there&amp;nbsp;a lot of different hash functions. Some have less collisions while the others have more. &amp;nbsp;Some are faster while the others are slow. You can choose whatever based on your need. &amp;nbsp;For me, a hash function for game should:&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;have near-zero collision&lt;/li&gt;
&lt;li&gt;versatile enough to be used as run-time function: you will possibly need to&amp;nbsp;concatenate strings and then generate hash value to compare in your game&amp;nbsp;&lt;/li&gt;
&lt;li&gt;be fast enough to be used in game&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
I did some research and found &lt;a href="http://chrissavoie.com/articles-mainmenu-29/15/65-hash2"&gt;this amazing comparison chart by Chris Savoie&lt;/a&gt;, and I decided the best one for me is x65599. (Also I liked the name quite a lot. &amp;nbsp;Anything that starts with X = a badass )&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I also looked into the implementation (shown below). &amp;nbsp;It's simple. You keep multiplying 65599. A-Ha! that's why it's called x65599 :D&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;// A hash function with multiplier 65599 (from Red Dragon book)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;unsigned int generateHash(const char *string, size_t len)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; unsigned int hash = 0;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; for(size_t i = 0; i &amp;lt; len; ++i)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;hash = 65599 * hash + string[i];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; return hash ^ (hash &amp;gt;&amp;gt; 16);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Alright, now I picked the hash function. &amp;nbsp;Let's move onto what to do in tools-side and code-side.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style="font-size: x-large;"&gt;Saving Data from Tools&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
If there is any tool that used to save useless char* values into the game data, it's time to change it to save out a hash value, instead. &amp;nbsp;It's simple. &amp;nbsp;Just call that function from your tool (or implement same function if the tools use different language from your game).&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Simply done. &amp;nbsp;Moving onto in-game code.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style="font-size: x-large;"&gt;Generating Compile-time Hash Value in Code&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Alright let's say, I want to find a bone named "funny_bone". &amp;nbsp;I would usually write a code like this:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;bones.find("funny_bone");&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
but now the tools export a hash value for this string, so I have to write something like this:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;const char * boneToFind = "funny_bone";&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;bones.find( generateHash(boneToFind, strlen(boneToFind) );&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Sure, it would work. &amp;nbsp;But wouldn't the string "funny_bone" into our executable? &amp;nbsp;If so, it will use the same or more amount of memory than our old string registry. &amp;nbsp;But this string is a const string, and compiler "might" know about it. &amp;nbsp;Can we make sure the compiler does all the&amp;nbsp;necessary&amp;nbsp;computation during compile time and somehow magically spits out assembly code&amp;nbsp;equivalent&amp;nbsp;to this?&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;// yup 0XF1C66FD7F is the real hash value for "funny_bone"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;bones.find(&amp;nbsp;0xF1C6FD7F&amp;nbsp;); &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
I think we can if these two things can happen:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;inlining the hash function: if compiler choose to not inline the hash function, there is no way it can calculate an int value during the compile-time. So this is a must. &amp;nbsp;inline keyword is kinda a guideline on most compilers, but I don't think it's a hard thing to achieve.&lt;/li&gt;
&lt;li&gt;unrolling the hash loop: we are dealing with constant length string, so if we have a way to tell compiler to unroll this and do all the calculation during compile-time, it would work. &amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;Help Inlining generateHash(const char *, size_t)&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
First off, I want to make sure the&amp;nbsp;implementation&amp;nbsp;of &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;generateHash(const char*, size_t)&lt;/span&gt; function is available for inlining when the compiler compiles the code. &amp;nbsp;Also I want to allow programmers to use a simple macro without calling &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;strlen(const char *)&lt;/span&gt; specifically. &amp;nbsp;So I decided to add a define like this:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;#define HASH_STRING(str) generateHash(str, strlen(str));&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
With this, my &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;hash.h&lt;/span&gt; looks like this:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;// compiile-time hash string test&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;// author: Pope Kim (www.popekim.com)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;#include &amp;lt;string.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;#define HASH_STRING(str) generateHash(str, strlen(str));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;// A hash function with multiplier 65599 (from Red Dragon book).&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;// we put this implementation into header file so that compiler can&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;// always inline it.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;inline unsigned int generateHash(const char *string, size_t len)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; unsigned int hash = 0;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; for(size_t i = 0; i &amp;lt; len; ++i)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; hash = 65599 * hash + string[i];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; return hash ^ (hash &amp;gt;&amp;gt; 16);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;Test Code&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
Now I made a test code to see if different compilers and optimization options can flat down HASH_STRING(str) into a single integer value in compile-time.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This is my main.cpp:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;// compiile-time hash string test&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;// author: Pope Kim (www.popekim.com)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;#include "hash.h"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;int main(int args, char** argv)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; unsigned int hashValue = HASH_STRING("funny_bone");&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; printf("hash value is 0x%8x\n", hashValue);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; return 0;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now, let's see if the compilers do a good job on this.&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;With Visual Studio 2010 SP1&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
I've created a quick win32 console application project and tested it with different optimization flag. &amp;nbsp;This is what I did.&lt;/div&gt;
&lt;div&gt;
&lt;ol&gt;
&lt;li&gt;Change project configuration to Release&lt;/li&gt;
&lt;li&gt;To output assembly file, I went to Project Properties &amp;gt; C/C++ &amp;gt; Output Files &amp;gt; Assembler Output, and chose Assembly-Only Listing (/FA)&lt;/li&gt;
&lt;li&gt;Then to test different optimization flag, I went to Project Properties &amp;gt; C/C++ &amp;gt; Optimization and compiled with the following settings:&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Disabled (/Od)&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Two findings:&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;generateHash()&lt;/span&gt; function call is not inlined, as expected&lt;/li&gt;
&lt;li&gt;interestingly, &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;strlen()&lt;/span&gt; is optimized: look at &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;push 10&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;_main&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;PROC&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;; COMDAT&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; File e:\temp\x65599\x65599\main.cpp&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 11&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;push&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ebp&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;mov&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ebp, esp&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;push&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ecx&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 12&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;push&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;10&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;; 0000000aH&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;push&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;OFFSET $SG-5&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;?generateHash@@YAIPBDI@Z&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;; generateHash&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;add&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;esp, 8&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;mov&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;DWORD PTR _hashValue$[ebp], eax&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 13&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;mov&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax, DWORD PTR _hashValue$[ebp]&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;push&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;push&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;OFFSET $SG-6&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;DWORD PTR __imp__printf&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;add&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;esp, 8&lt;/span&gt;&lt;/div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;
&lt;div&gt;
; Line 15&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xor&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax, eax&lt;/div&gt;
&lt;div&gt;
; Line 16&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;mov&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;esp, ebp&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;pop&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ebp&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ret&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;0&lt;/div&gt;
&lt;div&gt;
_main&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ENDP&lt;/div&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Minimize Size(/O1)&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
same as disabled, but the function call is inlined at least.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;_main&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;PROC&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;; COMDAT&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; File e:\temp\x65599\x65599\main.cpp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 12&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xor&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ecx, ecx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xor&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax, eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$LL5@main:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movsx&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;edx, BYTE PTR ??_C@_0L@DDOFCBGB@funny_bone?$AA@[eax]&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;imul&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ecx, 65599&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;; 0001003fH&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;add&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ecx, edx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;inc&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;cmp&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax, 10&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;; 0000000aH&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;jb&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;SHORT $LL5@main&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;mov&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax, ecx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;shr&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax, 16&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;; 00000010H&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xor&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax, ecx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 13&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;push&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;push&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;OFFSET ??_C@_0BF@DJEFNLLJ@hash?5value?5is?50x?$CF8x?6?$AA@&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;DWORD PTR __imp__printf&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;pop&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ecx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;pop&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ecx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 15&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xor&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax, eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 16&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ret&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;_main&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ENDP&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Maximize Speed(/O2)&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
You see the first line? &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;push -238617217&lt;/span&gt; which is &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;0xF1C6FDF&lt;/span&gt;? &amp;nbsp;IT IS ALL FLATTENED DOWN TO AN INT!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 13&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;u&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;push&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;-238617217&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;; f1c6fd7fH&lt;/u&gt;&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;push&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;OFFSET ??_C@_0BF@DJEFNLLJ@hash?5value?5is?50x?$CF8x?6?$AA@&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;DWORD PTR __imp__printf&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;add&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;esp, 8&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 15&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xor&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax, eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 16&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ret&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;_main&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ENDP&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
So I opened the resulting .exe file in a text editor to see if there's any string named "funny_bone". &amp;nbsp;And I couldn't find any! YAY!&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-T7j2kIQ8ugA/TwwFXqHZniI/AAAAAAAAAy0/x1wq7mFKnuA/s1600/no_funnybone.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="400" src="http://4.bp.blogspot.com/-T7j2kIQ8ugA/TwwFXqHZniI/AAAAAAAAAy0/x1wq7mFKnuA/s640/no_funnybone.jpg" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Full Optimization(/Ox)&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Walla! again!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;_main&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;PROC&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;; COMDAT&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; File e:\temp\x65599\x65599\main.cpp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 13&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;push&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;-238617217&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;; f1c6fd7fH&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;push&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;OFFSET $SG-6&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;DWORD PTR __imp__printf&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;add&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;esp, 8&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 15&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xor&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax, eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 16&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ret&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;_main&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ENDP&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div&gt;
But when I searched "funny_bone" in the exe file...&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;a href="http://1.bp.blogspot.com/-18wx-LJYOYM/TwwF2zOYoCI/AAAAAAAAAy8/xflxhlociPw/s1600/yes_funny_bone.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" height="402" src="http://1.bp.blogspot.com/-18wx-LJYOYM/TwwF2zOYoCI/AAAAAAAAAy8/xflxhlociPw/s640/yes_funny_bone.jpg" width="640" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="font-size: 13px;"&gt;&lt;b&gt;WTF? Why are you there, funny_bone?&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Seriously? &amp;nbsp;Full Optimization option doesn't strip unused strings? &amp;nbsp;To be sure I tested with another simple program, but the result was same. &amp;nbsp;Even this very simple string doesn't get stripped out with this compiler option.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;void idiot()&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; const char* idiot = "OMG";&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
I talked to this to &lt;a href="http://twitter.com/IoNPulse"&gt;Karl&lt;/a&gt;, and he found String Pooling option is off for /Ox by default while it is on for both /O1 and /O2. Strange eh? &amp;nbsp;As soon as I enabled C/C++ &amp;gt; Code Generation &amp;gt; Enable String Polling the string disappeared. &amp;nbsp;YAY!&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;With G++&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
How can I finish a test without trying G++? &amp;nbsp;I used G++ 4.5.3 to test this with this compiler flags:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;g++ *.cpp -pedantic -Wall -S &amp;lt;optimization-flag&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Note that &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;-S&lt;/span&gt; flag is to stop generating after assembler&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;-O0&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
-O0 flag means no optimization pretty much, so i didn't expect anything. &amp;nbsp;Still &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;strlen()&lt;/span&gt; function seems to be converted to 10, at least.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LFE4:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.def&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;___main;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.scl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;2;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.type&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;32;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.endef&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.section .rdata,"dr"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LC0:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.ascii "funny_bone\0"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LC1:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.ascii "hash value is 0x%8x\12\0"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.text&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;.globl _main&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.def&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;_main;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.scl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;2;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.type&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;32;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.endef&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;_main:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LFB5:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;pushl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%ebp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI4:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%esp, %ebp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI5:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;andl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$-16, %esp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI6:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;subl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$32, %esp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI7:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;___main&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$10, 4(%esp)&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$LC0, (%esp)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;__Z12generateHashPKcj&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%eax, 28(%esp)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;28(%esp), %eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%eax, 4(%esp)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$LC1, (%esp)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;_printf&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$0, %eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;leave&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI8:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ret&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;-O1&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
now &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;generateHash()&lt;/span&gt; function is inlined too. &amp;nbsp;But still doing all the calculation.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;.def&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;___main;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.scl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;2;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.type&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;32;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.endef&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.section .rdata,"dr"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LC0:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.ascii "funny_bone\0"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LC1:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.ascii "hash value is 0x%8x\12\0"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.text&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;.globl _main&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.def&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;_main;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.scl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;2;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.type&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;32;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.endef&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;_main:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LFB5:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;pushl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%ebp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI0:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%esp, %ebp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI1:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;andl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$-16, %esp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI2:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;pushl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%ebx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI3:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;subl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$28, %esp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI4:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;___main&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$LC0, %eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$LC0+10, %ebx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$0, %edx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;L2:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;imull&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$65599, %edx, %edx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movsbl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;(%eax), %ecx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;addl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%ecx, %edx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;addl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$1, %eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;cmpl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%ebx, %eax&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;jne&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;L2&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%edx, %eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;shrl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$16, %eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xorl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%eax, %edx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%edx, 4(%esp)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$LC1, (%esp)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;_printf&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$0, %eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;addl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$28, %esp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;popl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%ebx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI5:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%ebp, %esp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI6:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;popl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%ebp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI7:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ret&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;-O2&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Same as -O1. &amp;nbsp;Of course, loop unroll optimization is only enabled with -O3.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.def&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;___main;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.scl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;2;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.type&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;32;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.endef&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.section .rdata,"dr"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LC0:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.ascii "funny_bone\0"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LC1:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.ascii "hash value is 0x%8x\12\0"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.text&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.p2align 4,,15&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;.globl _main&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.def&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;_main;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.scl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;2;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.type&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;32;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.endef&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;_main:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LFB5:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;pushl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%ebp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI0:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%esp, %ebp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI1:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;andl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$-16, %esp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI2:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;subl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$16, %esp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI3:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;___main&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$LC0, %eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xorl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%edx, %edx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.p2align 4,,7&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;L2:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;imull&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$65599, %edx, %edx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movsbl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;(%eax), %ecx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;addl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$1, %eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;addl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%ecx, %edx&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;cmpl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$LC0+10, %eax&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;jne&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;L2&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%edx, %eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;shrl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$16, %eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xorl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%edx, %eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%eax, 4(%esp)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$LC1, (%esp)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;_printf&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xorl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%eax, %eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;leave&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI4:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ret&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
Also I tried to search the string in the exe file, but it was not there.. YAY!&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;-O3&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Finally... Seeing &amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace; font-weight: bold;"&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$-238617217, 4(%esp)&lt;/span&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif;"&gt;? &amp;nbsp;It's flattened down!&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.def&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;___main;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.scl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;2;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.type&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;32;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.endef&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.section .rdata,"dr"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LC0:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.ascii "hash value is 0x%8x\12\0"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.text&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.p2align 4,,15&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;.globl _main&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.def&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;_main;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.scl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;2;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.type&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;32;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.endef&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;_main:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LFB5:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;pushl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%ebp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI0:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%esp, %ebp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI1:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;andl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$-16, %esp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI2:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;subl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$16, %esp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI3:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;___main&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;u&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$-238617217, 4(%esp)&lt;/u&gt;&lt;/i&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$LC0, (%esp)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;_printf&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xorl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%eax, %eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;leave&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI4:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ret&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;b&gt;-Os&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;-Os&lt;/span&gt; stands for size. &amp;nbsp;And it didn't do good :(&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LFE4:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.def&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;___main;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.scl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;2;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.type&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;32;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.endef&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.section .rdata,"dr"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LC0:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.ascii "funny_bone\0"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LC1:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.ascii "hash value is 0x%8x\12\0"&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.text&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;.globl _main&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.def&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;_main;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.scl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;2;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.type&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;32;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.endef&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;_main:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LFB5:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;pushl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%ebp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI7:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%esp, %ebp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI8:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;andl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$-16, %esp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI9:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;subl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$16, %esp&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI10:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;___main&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$10, 4(%esp)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$LC0, (%esp)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;u&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;__Z12generateHashPKcj&lt;/b&gt;&lt;/u&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$LC1, (%esp)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%eax, 4(%esp)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;_printf&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xorl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%eax, %eax&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;leave&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI11:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ret&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;Quick Summary&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
So let me quickly summarize which optimization flags you should use for VS 2010 SP1 and G++ to use this amazing(maybe a bit stupid if you are cynical :P) trick.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Visual Studio 2010 SP1&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;/O2&lt;/li&gt;
&lt;li&gt;/Ox with Enable String Pooling on&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;b&gt;G++ 4.5.3&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;-O3&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style="font-size: x-large;"&gt;Debugging&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Alright. &amp;nbsp;It's good we removed the string representations from code. &amp;nbsp;The size of the executable is smaller, but it's horrible for debugging. &amp;nbsp;When I got a crash on a bone "named" &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;0xF1C6FD7F&lt;/span&gt;, how do I know which bone I have to look at in 3DS Max? &amp;nbsp;ARRGHH.. Okay, so apparently we really need char* string for at least debugging!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So should I revert everything I did so far? I don't want to. :) &amp;nbsp;This data is only useful for debugging, so I should devise a way of debugging it without affecting the disc build. &amp;nbsp;Actually, it is a very easy problem. I just need a string database, which has both pairs of &amp;lt;hash key, char*&amp;gt; for all the strings saved out from the data baking tools and used in our code.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;Generating Debug String Database&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
In what format, should I store our string database? Using a light-weight SQL DB file is definitely an option. &amp;nbsp;What about SQL-lite? &amp;nbsp;I heard good things about it. &amp;nbsp;Or I can simply outputs a list of pairs of &amp;lt;int, char*&amp;gt; values into a text file. I would probably choose a plain text file, or compressed text file, to make it easier to load the file in C++ codebase. Whatever it is, the filename will be&amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;debug.string_db&lt;/span&gt;.
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Saving Debug String DB from Tools&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
So now I just need to change my tools to open &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;debug.string_db&lt;/span&gt; file and insert any new string entries into this while it's saving game-ready data.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Very simply done!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Saving Debug String DB from Codebase&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Then what do we do with the strings in the code? &amp;nbsp;Luckily enough, I defined HASH_STRING("") macro. &amp;nbsp;I can just write a C# or python script searching through all the text files in my codebase to find any char* strings wrapped by that macro. &amp;nbsp;Regular expression? sure. &amp;nbsp;Then I would run same hash generation code to get the hash key, and write this into&amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;debug.string_db&lt;/span&gt;&amp;nbsp;file.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Not very simple. &amp;nbsp;But easy and fast enough.... done!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Looking Up String Values&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
So now the question is how we can easily find what string it is while we are in Visual Studio.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;String Lookup Tool&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Do you remember using DirectX Error Lookup tool that comes with DirectX SDK? &amp;nbsp;It looks like this:&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-hTXT8fcSnrA/Twdpe_fq60I/AAAAAAAAAxI/5Fq2tYwVm5M/s1600/error_lookup.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-hTXT8fcSnrA/Twdpe_fq60I/AAAAAAAAAxI/5Fq2tYwVm5M/s1600/error_lookup.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Maybe I can write a tool like this. &amp;nbsp;This tool would simply open&amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;debug.string_db&lt;/span&gt;&amp;nbsp;file and find any hash value I type in. &amp;nbsp;Yeah I can just&amp;nbsp;copy and paste the hash value from Visual Studio Watch window into this. &amp;nbsp;Yup, it's a bit annoying but it's easy to make.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Visual Studio Plug-in?&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Next thought I have is something I'm not sure if it's possible because I don't know too much about making a Visual Studio plug-in.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
If a Visual Studio plug-in is allowed to read a text file(or a SQL DB) and modifies what shows up in Watch window, maybe I can do this. &amp;nbsp;It's just something I need to take some time and see if it's possible.. I haven't done it so far. &amp;nbsp;I think I'll be fine with the string lookup tool for now&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;In-Game Hash/String Registry&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Or I can make a debug-only hash/string registry, which simply loads&amp;nbsp;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;debug.string_db&lt;/span&gt;&amp;nbsp;file. &amp;nbsp;Then anyone can find out the actual string representation easily in the code. &amp;nbsp;This will be only available on debug build, and the loading code will simply disappear in the disc build.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style="font-size: x-large;"&gt;Maybe I'm Crazy But&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
While I was thinking about the last option for looking up string values, I found this is actually very close to how the localization database works. &amp;nbsp;You have a string id(key) and the value of the given language. &amp;nbsp;If you want to swap to different language you will just load different localization database file. &amp;nbsp;In the files, all the keys are same as before, just the string values are different.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
So, if one decides to implement the in-game hash/string registry option for debugging, maybe he can use the same architecture for localization? &amp;nbsp;I don't know too much about localization database, so I might be just being stupid. I just had this crazy idea. heh =)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-size: x-large;"&gt;&lt;b&gt;One BIG Problem, Though&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
I was excited for a while. &amp;nbsp;Then Noel, my buddie and one of the best programmers I've met in this industry, asked me if the loop unroll works if it the string length is longer. &amp;nbsp;So I did a quick test.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;With Visual Studio 2010 SP1&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;b&gt;I found Visual Studio 2010 SP1 works only up to 10 characters&lt;/b&gt;. &amp;nbsp;This is the result I got when I used 11 character-long string "funny_bone1".&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;_main&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;PROC&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;; COMDAT&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; File e:\temp\x65599\main.cpp&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 12&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xor&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ecx, ecx&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xor&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax, eax&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;npad&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;12&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$LL5@main:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movsx&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;edx, BYTE PTR $SG-5[eax]&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;imul&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ecx, 65599&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;; 0001003fH&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;inc&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;add&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ecx, edx&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;u&gt;&lt;i&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;cmp&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax, 11&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;; 0000000bH&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;u&gt;&lt;i&gt;&lt;b&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;jb&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;SHORT $LL5@main&lt;/b&gt;&lt;/i&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;mov&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax, ecx&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;shr&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax, 16&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;; 00000010H&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xor&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax, ecx&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 13&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;push&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;push&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;OFFSET $SG-6&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;DWORD PTR __imp__printf&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;add&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;esp, 8&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 15&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xor&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;eax, eax&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;; Line 16&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ret&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;0&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;_main&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ENDP&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;With G++&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
G++ did a better job. &amp;nbsp;&lt;b&gt;G++ works up to 17 characters&lt;/b&gt;. This is the result I got when i used 18 character-long string "funny_bone12345678"&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.def&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;_main;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.scl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;2;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.type&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;32;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.endef&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;_main:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LFB5:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;pushl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%ebp&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI0:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%esp, %ebp&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI1:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;andl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$-16, %esp&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI2:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;subl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$16, %esp&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI3:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;___main&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$LC0, %eax&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xorl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%edx, %edx&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;.p2align 4,,7&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;L2:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;imull&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$65599, %edx, %edx&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movsbl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;(%eax), %ecx&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;addl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$1, %eax&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;addl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%ecx, %edx&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;b&gt;&lt;u&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;cmpl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$LC0+18, %eax&lt;/u&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;i&gt;&lt;b&gt;&lt;u&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;jne&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;L2&lt;/u&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%edx, %eax&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;shrl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$16, %eax&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xorl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%edx, %eax&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%eax, 4(%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;movl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;$LC1, (%esp)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;call&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;_printf&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;xorl&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;%eax, %eax&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;leave&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;LCFI4:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;ret&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: large;"&gt;&lt;b&gt;What Does This Mean?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
This means it will optimize strings with length equal to or less than 10 or 17 depending on your compilers. For other strings, it'll do all the calculation during run-time. Is it still worth it? &amp;nbsp;I think so. You will just need to follow this guideline:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;if possible, keep look-up key strings short&lt;/li&gt;
&lt;li&gt;don't call HASH_STRING() macro multiple times on a same string. &amp;nbsp;In other words, cache the hash value somewhere(e.g, as a member variable of an object)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
Also there's a chance that future compilers do a better job at unrolling this. &amp;nbsp;Up to 64 characters would be nice. (Unfortunately, VS 2011 Preview doesn't do any better job....)&lt;br /&gt;
&lt;br /&gt;
Or &lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;constexpr&lt;/span&gt; from C++11 can be used for this one day? &amp;nbsp;It's not even being supported by VS 2011 Preview... so whateva......&lt;br /&gt;
&lt;br /&gt;
The best solution would be a compiler switch like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;inline unsigned int generateHash(const char *string, size_t len)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; unsigned int hash = 0;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;&amp;nbsp; #pragma unroll&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; for(size_t i = 0; i &amp;lt; len; ++i)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; hash = 65599 * hash + string[i];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; return hash ^ (hash &amp;gt;&amp;gt; 16);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
This would unroll the loop if len is constant. &amp;nbsp;I believe the IBM compiler supports something similar to this. &amp;nbsp;And we have this kinda switch in HLSL. &amp;nbsp;So why can't we have it in our C++ compilers?&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-family: Verdana, sans-serif;"&gt;Microsoft, can we please have this option, pretty please?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="font-size: large;"&gt;Walkaround (for now)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Since my original was posted,&amp;nbsp;&lt;a href="http://twitter.com/pixelmager"&gt;Mikkel Gjoel&lt;/a&gt; let me know Humus had &lt;a href="http://humus.name/index.php?page=Comments&amp;amp;ID=296&amp;amp;start=24"&gt;a way to generate compile-time hash more than this limit&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
I tested it quickly and it works great. &amp;nbsp;I tested up to 64 chars! &lt;strike&gt;There is an usability issue: you can't have a generic generateHash(const char*) function with specialized generateHash(const char &amp;amp;(string)[N]); functions together. &amp;nbsp;Compiler gets confused. &amp;nbsp;So now I have to make two different versions.&lt;/strike&gt;&lt;br /&gt;
&lt;br /&gt;
From the &lt;a href="http://altdevblogaday.com/2011/10/27/quasi-compile-time-string-hashing/"&gt;altdevblogaday link posted in the comment&lt;/a&gt; I found a nice way to get around the striked-through issue:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;struct ConstCharWrapper&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; inline ConstCharWrapper(const char* str) : m_str(str) {}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; const char* m_str;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;};&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;inline unsigned int generateHash(ConstCharWrapper wrapper, size_t len)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; const char* string = wrapper.m_str;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; // same as before&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Also I found VS 2010 is not smart enough to know these two are same, thus not flattening down the first even with my way: (g++ is smart enough to know it).&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;#1&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;const char * const funny = "funny_bone";&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;unsigned int hashValue = HASH_STRING(funny);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;#2&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;unsigned int hashValue = HASH_STRING("funny_bone");&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But using #1 confuses regex when generating the debug string DB anyways, so probably I can just ignore it. &amp;nbsp;But how would I &lt;strike&gt;force&lt;/strike&gt; educate other programmers to use the first form if the string is const? &amp;nbsp;That's something I'm trying to figure out. &lt;br /&gt;
&lt;br /&gt;
Anyways, if I figure out a nice way to use this new info in a less painful way, I'll write another post. &amp;nbsp;This post has gotten too long already.. ugggh...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-1415296274923310628?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8bcX8PnE3W9Usc8Y1LAHDdELnOw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8bcX8PnE3W9Usc8Y1LAHDdELnOw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8bcX8PnE3W9Usc8Y1LAHDdELnOw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8bcX8PnE3W9Usc8Y1LAHDdELnOw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=OzHmFQuIHNM:1BtItmYQLew:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=OzHmFQuIHNM:1BtItmYQLew:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=OzHmFQuIHNM:1BtItmYQLew:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=OzHmFQuIHNM:1BtItmYQLew:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=OzHmFQuIHNM:1BtItmYQLew:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=OzHmFQuIHNM:1BtItmYQLew:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=OzHmFQuIHNM:1BtItmYQLew:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=OzHmFQuIHNM:1BtItmYQLew:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=OzHmFQuIHNM:1BtItmYQLew:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=OzHmFQuIHNM:1BtItmYQLew:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=OzHmFQuIHNM:1BtItmYQLew:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=OzHmFQuIHNM:1BtItmYQLew:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=OzHmFQuIHNM:1BtItmYQLew:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=OzHmFQuIHNM:1BtItmYQLew:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=OzHmFQuIHNM:1BtItmYQLew:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=OzHmFQuIHNM:1BtItmYQLew:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/OzHmFQuIHNM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/1415296274923310628/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2012/01/compile-time-hash-string-generation.html#comment-form" title="8 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/1415296274923310628?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/1415296274923310628?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/OzHmFQuIHNM/compile-time-hash-string-generation.html" title="Compile-Time Hash String Generation" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-6wkX03iwTq0/TwYbMVUwjcI/AAAAAAAAAw0/gxerqfvI4Ik/s72-c/funny-pictures-hexcode-colors.jpg" height="72" width="72" /><thr:total>8</thr:total><feedburner:origLink>http://www.popekim.com/2012/01/compile-time-hash-string-generation.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0cBR3o7cCp7ImA9WhRVEEs.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-9197506957602872351</id><published>2012-01-08T15:23:00.000-08:00</published><updated>2012-01-08T15:24:16.408-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-08T15:24:16.408-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Antec" /><category scheme="http://www.blogger.com/atom/ns#" term="Parts" /><category scheme="http://www.blogger.com/atom/ns#" term="Hardware" /><category scheme="http://www.blogger.com/atom/ns#" term="Personal" /><title>Antec 900 Hard Disk Cage Screws</title><content type="html">A few weeks ago, I got a free used Antec 900 computer case, and I like it a lot. &amp;nbsp;Lots of room inside, good air flow, and easy to detach HDD cages.&lt;br /&gt;
&lt;br /&gt;
&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-FLV8xJYDsKg/Twok-RmkDTI/AAAAAAAAAys/Ve_FNId117U/s1600/front_drive_cages.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-FLV8xJYDsKg/Twok-RmkDTI/AAAAAAAAAys/Ve_FNId117U/s1600/front_drive_cages.jpg" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;&lt;b&gt;Cages look like this&lt;/b&gt;. &amp;nbsp;(Image source:&amp;nbsp;&lt;a href="http://hardwarelogic.com/articles/reviews/case/ANTEC_Nine_Hundred/front_drive_cages.jpg"&gt;http://hardwarelogic.com&lt;/a&gt;)&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
But I quickly found out there is a problem when I tried to add a couple more HDD. &amp;nbsp;It uses a very long screws to fasten HDDs inside the cage, and extra screws didn't come with the case. :(&lt;br /&gt;
&lt;br /&gt;
So I went to Home Depot and found matching screws: &lt;b&gt;Machine Screws 6-32 X 1&lt;/b&gt;. &amp;nbsp;This matches perfectly :) The only downside is the screw top is not cross. &amp;nbsp;But I can still use the flat screw drivers instead the square ones. &amp;nbsp;So oh well...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-QA2ijGGO7PU/Twoj2BJO1uI/AAAAAAAAAyk/5lodCfKAQlc/s1600/6-32x1.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="480" src="http://4.bp.blogspot.com/-QA2ijGGO7PU/Twoj2BJO1uI/AAAAAAAAAyk/5lodCfKAQlc/s640/6-32x1.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-9197506957602872351?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5FlrNJDvRuTv1eb8DLhKwXH6UW8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5FlrNJDvRuTv1eb8DLhKwXH6UW8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5FlrNJDvRuTv1eb8DLhKwXH6UW8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5FlrNJDvRuTv1eb8DLhKwXH6UW8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=SbPreD6ixYA:VcZuuggZuQg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=SbPreD6ixYA:VcZuuggZuQg:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=SbPreD6ixYA:VcZuuggZuQg:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=SbPreD6ixYA:VcZuuggZuQg:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=SbPreD6ixYA:VcZuuggZuQg:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=SbPreD6ixYA:VcZuuggZuQg:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=SbPreD6ixYA:VcZuuggZuQg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=SbPreD6ixYA:VcZuuggZuQg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=SbPreD6ixYA:VcZuuggZuQg:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=SbPreD6ixYA:VcZuuggZuQg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=SbPreD6ixYA:VcZuuggZuQg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=SbPreD6ixYA:VcZuuggZuQg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=SbPreD6ixYA:VcZuuggZuQg:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=SbPreD6ixYA:VcZuuggZuQg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=SbPreD6ixYA:VcZuuggZuQg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=SbPreD6ixYA:VcZuuggZuQg:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/SbPreD6ixYA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/9197506957602872351/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2012/01/antec-900-hard-disk-cage-screws.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/9197506957602872351?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/9197506957602872351?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/SbPreD6ixYA/antec-900-hard-disk-cage-screws.html" title="Antec 900 Hard Disk Cage Screws" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-FLV8xJYDsKg/Twok-RmkDTI/AAAAAAAAAys/Ve_FNId117U/s72-c/front_drive_cages.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.popekim.com/2012/01/antec-900-hard-disk-cage-screws.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkMMQXczcSp7ImA9WhRWFkw.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-3163726153633192452</id><published>2012-01-02T10:00:00.000-08:00</published><updated>2012-01-03T11:21:20.989-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-03T11:21:20.989-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Games" /><category scheme="http://www.blogger.com/atom/ns#" term="Personal" /><title>All the games I shipped</title><content type="html">Apparently I've shipped 13 SKUs so far.... and gonna add 3 soon-ish... jesus&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-dL8FAzKzTrU/TwCsHbE2JsI/AAAAAAAAAwM/dHobLpbJDd4/s1600/allgamesByPope.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://4.bp.blogspot.com/-dL8FAzKzTrU/TwCsHbE2JsI/AAAAAAAAAwM/dHobLpbJDd4/s640/allgamesByPope.png" width="602" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-3163726153633192452?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wohVSOi6LlAzS0bYezHq5qpOxaY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wohVSOi6LlAzS0bYezHq5qpOxaY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wohVSOi6LlAzS0bYezHq5qpOxaY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wohVSOi6LlAzS0bYezHq5qpOxaY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TGqwj_wc9T4:FWSH_fTD8xg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TGqwj_wc9T4:FWSH_fTD8xg:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TGqwj_wc9T4:FWSH_fTD8xg:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=TGqwj_wc9T4:FWSH_fTD8xg:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TGqwj_wc9T4:FWSH_fTD8xg:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=TGqwj_wc9T4:FWSH_fTD8xg:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TGqwj_wc9T4:FWSH_fTD8xg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=TGqwj_wc9T4:FWSH_fTD8xg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TGqwj_wc9T4:FWSH_fTD8xg:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TGqwj_wc9T4:FWSH_fTD8xg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=TGqwj_wc9T4:FWSH_fTD8xg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TGqwj_wc9T4:FWSH_fTD8xg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TGqwj_wc9T4:FWSH_fTD8xg:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TGqwj_wc9T4:FWSH_fTD8xg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=TGqwj_wc9T4:FWSH_fTD8xg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TGqwj_wc9T4:FWSH_fTD8xg:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/TGqwj_wc9T4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/3163726153633192452/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2012/01/all-game-i-shipped.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/3163726153633192452?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/3163726153633192452?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/TGqwj_wc9T4/all-game-i-shipped.html" title="All the games I shipped" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-dL8FAzKzTrU/TwCsHbE2JsI/AAAAAAAAAwM/dHobLpbJDd4/s72-c/allgamesByPope.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.popekim.com/2012/01/all-game-i-shipped.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQGRn48cCp7ImA9WhRaFEs.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-5869184213808596020</id><published>2011-12-05T09:30:00.000-08:00</published><updated>2012-02-17T00:28:47.078-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-02-17T00:28:47.078-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="KGC" /><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><category scheme="http://www.blogger.com/atom/ns#" term="Personal" /><title>Pictures of Me Presenting at KGC</title><content type="html">&lt;div class="separator" style="clear: both; text-align: left;"&gt;
I received some pictures from KGC organizers:&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-NHnqmprGAGk/Tz4O_bbDJkI/AAAAAAAAA1I/OCT8XL11MfY/s1600/Profile+Pic.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="640" src="http://4.bp.blogspot.com/-NHnqmprGAGk/Tz4O_bbDJkI/AAAAAAAAA1I/OCT8XL11MfY/s640/Profile+Pic.jpg" width="426" /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-VvN1yezez9A/TtMC4ERpJeI/AAAAAAAAArc/LqxdpyWppQs/s1600/KGC_01.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="426" src="http://4.bp.blogspot.com/-VvN1yezez9A/TtMC4ERpJeI/AAAAAAAAArc/LqxdpyWppQs/s640/KGC_01.JPG" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-5869184213808596020?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lgnuaKDw4mX0T6_9U2pbJMOKEdU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lgnuaKDw4mX0T6_9U2pbJMOKEdU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lgnuaKDw4mX0T6_9U2pbJMOKEdU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lgnuaKDw4mX0T6_9U2pbJMOKEdU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=3c553X_6L-A:QcLaMjJQpn8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=3c553X_6L-A:QcLaMjJQpn8:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=3c553X_6L-A:QcLaMjJQpn8:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=3c553X_6L-A:QcLaMjJQpn8:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=3c553X_6L-A:QcLaMjJQpn8:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=3c553X_6L-A:QcLaMjJQpn8:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=3c553X_6L-A:QcLaMjJQpn8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=3c553X_6L-A:QcLaMjJQpn8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=3c553X_6L-A:QcLaMjJQpn8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=3c553X_6L-A:QcLaMjJQpn8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=3c553X_6L-A:QcLaMjJQpn8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=3c553X_6L-A:QcLaMjJQpn8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=3c553X_6L-A:QcLaMjJQpn8:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=3c553X_6L-A:QcLaMjJQpn8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=3c553X_6L-A:QcLaMjJQpn8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=3c553X_6L-A:QcLaMjJQpn8:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/3c553X_6L-A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/5869184213808596020/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2011/12/pictures-of-me-presenting-at-kgc.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/5869184213808596020?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/5869184213808596020?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/3c553X_6L-A/pictures-of-me-presenting-at-kgc.html" title="Pictures of Me Presenting at KGC" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-NHnqmprGAGk/Tz4O_bbDJkI/AAAAAAAAA1I/OCT8XL11MfY/s72-c/Profile+Pic.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.popekim.com/2011/12/pictures-of-me-presenting-at-kgc.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU8EQXY9cSp7ImA9WhRRFUU.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-6860714949859611359</id><published>2011-11-29T09:30:00.000-08:00</published><updated>2011-11-29T09:30:00.869-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-29T09:30:00.869-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Money" /><category scheme="http://www.blogger.com/atom/ns#" term="investment" /><category scheme="http://www.blogger.com/atom/ns#" term="Personal" /><title>New myFinancialTracker from RBC</title><content type="html">RBC just rolled out new &lt;a href="http://www.rbcroyalbank.com/mft/available/index.html?ProspectID=E977DC61A23B4A7A998A0CD75269BC85"&gt;myFinancialTracker&lt;/a&gt;, which seems to be very close to &lt;a href="http://mint.com/"&gt;mint.com&lt;/a&gt;. &amp;nbsp;I loved mint.com's ability to show all your bank accounts and assets at one place, but my concern was having all my account info in their database.&lt;br /&gt;
&lt;br /&gt;
RBC's new myFinancial Tracker says:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;myFinanceTracker now gives you complete control of your finances by letting you view all your accounts in one place.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;Link your RBC Royal Bank mortgage, investments and loans.&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Link accounts you have at other financial institutions.&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;i&gt;Even add assets or liabilities not linked to a financial institution like a loan from a family member or the equity in your house.&lt;/i&gt;&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
See? Now it's same as mint.com, so if you are a RBC customer, why don't you give it a try?&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-6860714949859611359?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PHZl4QuKiriV2_iIZtVR0SScJnY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PHZl4QuKiriV2_iIZtVR0SScJnY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PHZl4QuKiriV2_iIZtVR0SScJnY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PHZl4QuKiriV2_iIZtVR0SScJnY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=wkRp4DJ9dn0:VId1VBpYPc8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=wkRp4DJ9dn0:VId1VBpYPc8:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=wkRp4DJ9dn0:VId1VBpYPc8:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=wkRp4DJ9dn0:VId1VBpYPc8:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=wkRp4DJ9dn0:VId1VBpYPc8:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=wkRp4DJ9dn0:VId1VBpYPc8:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=wkRp4DJ9dn0:VId1VBpYPc8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=wkRp4DJ9dn0:VId1VBpYPc8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=wkRp4DJ9dn0:VId1VBpYPc8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=wkRp4DJ9dn0:VId1VBpYPc8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=wkRp4DJ9dn0:VId1VBpYPc8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=wkRp4DJ9dn0:VId1VBpYPc8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=wkRp4DJ9dn0:VId1VBpYPc8:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=wkRp4DJ9dn0:VId1VBpYPc8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=wkRp4DJ9dn0:VId1VBpYPc8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=wkRp4DJ9dn0:VId1VBpYPc8:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/wkRp4DJ9dn0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/6860714949859611359/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2011/11/new-myfinancialtracker-from-rbc.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/6860714949859611359?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/6860714949859611359?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/wkRp4DJ9dn0/new-myfinancialtracker-from-rbc.html" title="New myFinancialTracker from RBC" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.popekim.com/2011/11/new-myfinancialtracker-from-rbc.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4EQ3g4fCp7ImA9WhRSFkk.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-7341294139798351314</id><published>2011-11-16T12:34:00.001-08:00</published><updated>2011-11-18T11:01:42.634-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-18T11:01:42.634-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Shader" /><category scheme="http://www.blogger.com/atom/ns#" term="Graphics" /><category scheme="http://www.blogger.com/atom/ns#" term="KGC" /><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><title>Optimized Oren-Nayar Approximation Shader Code</title><content type="html">We presented this approximation code as part of &lt;a href="http://www.popekim.com/2011/11/slides-rendering-tech-of-space-marine.html"&gt;our KGC 2011 presentation&lt;/a&gt;.&amp;nbsp;Let me just show the code for those people who don't want to read the whole presentation. &amp;nbsp;I've also mentioned this to Wolfgang Engel during KGC 2011 because our previous Oren-Nayar code was from &lt;a href="http://content.gpwiki.org/index.php/D3DBook:(Lighting)_Oren-Nayar"&gt;his wiki book&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The best part of this approximation code is that we eliminated the texture look-up, which turned out to be bottleneck for us. It&amp;nbsp;is not mathematically correct, but worked fine for our game, Warhammer 40,000: Space Marine.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;half ComputeOrenNayarLighting_Fakey( half3 N, half3 L, half3 V, half roughness )&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; // Through brute force iteration I found this approximation. Time to test it out.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; half LdotN = dot( L, N );&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; half VdotN = dot( V, N );&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; half result = saturate(LdotN);&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; half soft_rim = saturate(1-VdotN/2); //soft view dependant rim&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; half fakey = pow(1-result*soft_rim,2);//modulate lambertian by rim lighting&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; half fakey_magic = 0.62;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; //(1-fakey)*fakey_magic to invert and scale down the lighting&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; fakey = fakey_magic - fakey*fakey_magic;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; return lerp( result, fakey, roughness );&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Related Posts:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.popekim.com/2011/05/oren-nayar-lighting-in-light-prepass.html"&gt;Oren-Nayar Lighting in Light Prepass Renderer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.popekim.com/2009/02/performance-comparison-for-lighting.html"&gt;Performance Comparison of Lighting Models&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-7341294139798351314?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/yWlALSJoaXB29IzRj0z-bWH8kVY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yWlALSJoaXB29IzRj0z-bWH8kVY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/yWlALSJoaXB29IzRj0z-bWH8kVY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/yWlALSJoaXB29IzRj0z-bWH8kVY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=uL3N0s4EyaQ:_h6U0qAmUCs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=uL3N0s4EyaQ:_h6U0qAmUCs:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=uL3N0s4EyaQ:_h6U0qAmUCs:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=uL3N0s4EyaQ:_h6U0qAmUCs:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=uL3N0s4EyaQ:_h6U0qAmUCs:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=uL3N0s4EyaQ:_h6U0qAmUCs:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=uL3N0s4EyaQ:_h6U0qAmUCs:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=uL3N0s4EyaQ:_h6U0qAmUCs:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=uL3N0s4EyaQ:_h6U0qAmUCs:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=uL3N0s4EyaQ:_h6U0qAmUCs:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=uL3N0s4EyaQ:_h6U0qAmUCs:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=uL3N0s4EyaQ:_h6U0qAmUCs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=uL3N0s4EyaQ:_h6U0qAmUCs:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=uL3N0s4EyaQ:_h6U0qAmUCs:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=uL3N0s4EyaQ:_h6U0qAmUCs:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=uL3N0s4EyaQ:_h6U0qAmUCs:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/uL3N0s4EyaQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/7341294139798351314/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2011/11/optimized-oren-nayar-approximation.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/7341294139798351314?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/7341294139798351314?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/uL3N0s4EyaQ/optimized-oren-nayar-approximation.html" title="Optimized Oren-Nayar Approximation Shader Code" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.popekim.com/2011/11/optimized-oren-nayar-approximation.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0cDQnc8eSp7ImA9WhRRFk0.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-883348043766325167</id><published>2011-11-15T19:23:00.001-08:00</published><updated>2011-11-29T13:11:13.971-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-29T13:11:13.971-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Shader" /><category scheme="http://www.blogger.com/atom/ns#" term="Graphics" /><category scheme="http://www.blogger.com/atom/ns#" term="KGC" /><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><title>Slides: The Rendering Tech of Space Marine</title><content type="html">One that Daniel and I presented at KGC 2011. &amp;nbsp;First half is a quick overview of our rendering passes, and second half is about Screen Space Decal and World Occlusion technique we used for Space Marine.&lt;br /&gt;
&lt;br /&gt;
&lt;div id="__ss_10388476" style="width: 595px;"&gt;
&lt;strong style="display: block; margin: 12px 0 4px;"&gt;&lt;a href="http://www.slideshare.net/blindrenderer/rendering-tech-of-space-marinekgc-2011" target="_blank" title="Rendering Tech of Space Marine"&gt;Rendering Tech of Space Marine&lt;/a&gt;&lt;/strong&gt; &lt;iframe frameborder="0" height="497" marginheight="0" marginwidth="0" scrolling="no" src="http://www.slideshare.net/slideshow/embed_code/10388476?rel=0" width="595"&gt;&lt;/iframe&gt; &lt;br /&gt;
&lt;div style="padding: 5px 0 12px;"&gt;
View more &lt;a href="http://www.slideshare.net/" target="_blank"&gt;presentations&lt;/a&gt; from &lt;a href="http://www.slideshare.net/blindrenderer" target="_blank"&gt;Pope Kim&lt;/a&gt; &lt;/div&gt;
&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-883348043766325167?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/KPoPP30_vRZ54sahv9KNzZTz_L0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KPoPP30_vRZ54sahv9KNzZTz_L0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/KPoPP30_vRZ54sahv9KNzZTz_L0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/KPoPP30_vRZ54sahv9KNzZTz_L0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=LDMlunGqQhA:sfwbpP_833I:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=LDMlunGqQhA:sfwbpP_833I:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=LDMlunGqQhA:sfwbpP_833I:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=LDMlunGqQhA:sfwbpP_833I:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=LDMlunGqQhA:sfwbpP_833I:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=LDMlunGqQhA:sfwbpP_833I:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=LDMlunGqQhA:sfwbpP_833I:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=LDMlunGqQhA:sfwbpP_833I:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=LDMlunGqQhA:sfwbpP_833I:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=LDMlunGqQhA:sfwbpP_833I:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=LDMlunGqQhA:sfwbpP_833I:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=LDMlunGqQhA:sfwbpP_833I:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=LDMlunGqQhA:sfwbpP_833I:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=LDMlunGqQhA:sfwbpP_833I:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=LDMlunGqQhA:sfwbpP_833I:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=LDMlunGqQhA:sfwbpP_833I:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/LDMlunGqQhA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/883348043766325167/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2011/11/slides-rendering-tech-of-space-marine.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/883348043766325167?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/883348043766325167?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/LDMlunGqQhA/slides-rendering-tech-of-space-marine.html" title="Slides: The Rendering Tech of Space Marine" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.popekim.com/2011/11/slides-rendering-tech-of-space-marine.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUHQn0zeSp7ImA9WhRSFEo.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-7362957141127230791</id><published>2011-11-15T12:55:00.001-08:00</published><updated>2011-11-16T13:00:33.381-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-16T13:00:33.381-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Shader" /><category scheme="http://www.blogger.com/atom/ns#" term="Graphics" /><category scheme="http://www.blogger.com/atom/ns#" term="KGC" /><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><title>Feedback on My KGC 2011 Presentation</title><content type="html">&lt;br /&gt;
After I presented The Rendering Tech of Warhammer 40,000: Space Marine at KGC 2011 with my co-worker, &lt;a href="http://danielbarrero.com/"&gt;Dr. Daniel Barrero&lt;/a&gt;, I was curious what the audience thinks about our presentation. &amp;nbsp;So, here I compiled all the feedback I was able to find on the net. &amp;nbsp;All feedback is pretty positive so far.&lt;br /&gt;
&lt;br /&gt;
1.&amp;nbsp;&lt;a href="http://agebreak.blog.me/60146508810"&gt;http://agebreak.blog.me/60146508810&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;Original Text:&lt;/b&gt; 그래픽스 관련 강연을 주로 많이 들었는데, 괜찮은 강연들이 꽤 많았습니다. 새로운 기술을 설명하는 강연부터, 상용화된 게임에서 어떻게 적용하는지에 대한 내용들이 괜찮았습니다. 특히나 워해머 강연은.. 강추…ㅠ.ㅠ (자세한 내용은 다음 글에…)&lt;/blockquote&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;Google Translation:&lt;/b&gt; I've heard a lot of graphics related primarily lecture, were many there are quite a good speech. From lectures to explain the new technology commercially available in the game of how to apply it was fine for the information. Especially Warhammer lecture. Gangchu ... tires screech (the following article for more information.)&lt;/blockquote&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;My Translation:&lt;/b&gt; I attended mostly graphics-related presentations and a lot of them were pretty good. &amp;nbsp;Some explained actual theory, and the other explained how to apply those to&amp;nbsp;commercial&amp;nbsp;games. Especially, I highly recommend Warhammer 40K lecture. (Will post more about this in another post later)&lt;/blockquote&gt;
&lt;br /&gt;
2.&amp;nbsp;&lt;a href="http://twitter.com/#!/TranosTria/status/133826484547764224"&gt;http://twitter.com/#!/TranosTria/status/133826484547764224&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;Original Text:&lt;/b&gt; kgc 1일차 2일차를 통 틀어서 워해머 스페이스 마린의 렌더링 기술 섹셕이 가장 좋은 세미나가 아닌가 싶다. 특히 "우린 수학적인 검증따윈 신경안쓴다. 오직 룩만 좋으면 그걸로 끝이다"라는 얘기가 무한 공감간다 ㅋㅋㅋ&lt;/blockquote&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;Google Translation:&lt;/b&gt; &amp;nbsp;kgc 1 Day 2 through Day Warhammer Space Marines lay seksyeokyi rendering technology like Is not the best seminars. In particular, "We do not care anymore mathematical verification, only if you're rukman're done with it," the story takes an infinite gonggam ㅋ ㅋ ㅋ&lt;/blockquote&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;My Translation:&lt;/b&gt; Among the lectures presented on 1st and 2nd day of KGC 2011, I think the best one was The Rendering Tech of Warhammer 40,000: Space Marine. Especially, I completely agree with what they said during the presentation: "We are not really Nazi about&amp;nbsp;mathematical correctness. &amp;nbsp;If it looks right to artists, that's the end of the story".&lt;/blockquote&gt;
&lt;br /&gt;
3.&amp;nbsp;&lt;a href="http://beaumale.blog.me/80144986487"&gt;http://beaumale.blog.me/80144986487&lt;/a&gt;&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;Original Text:&lt;/b&gt; ...해외 유명게임 개발자가 와서 강연해 주고 있는데(클라 프로그래머라면 누구든 꿈꾸는 그런 인물!) 맨 앞자리에서 쳐 졸고 있질 않나...(그래, 워해머40K 스페이스마린 렌더링 기술 강연때 맨 왼쪽 앞에 앉은 너희 두놈) 밖에서 받은 기념품 봉지를 뽀시락거리면서 싱경 거슬리게 하지 않나...&lt;/blockquote&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;Google Translation:&lt;/b&gt;&amp;nbsp;... Internationally renowned game developers, and which came gangyeonhae (client programmers dream of such a person with anyone!), Hit the top in the front seat asleep, is not it displaced ... (yeah, Warhammer 40K Space Marines sitting in front of the left-rendering technology, you two clowns gangyeonttae ) received gift bags from outside, is not disturbed singgyeong pposirakgeorimyeonseo ...&lt;/blockquote&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;My Translation:&lt;/b&gt; ... While famous foreign game developers, who any client programmers would look up to, were presenting, some stupid students were dozing at the first row. &amp;nbsp;Yes I'm talking about you two who were sitting at the very front in the Rendering Tech of Warhammer 40,000: Space Marine presentation. Also some students annoyed me by making noise from the gift wrapping paper ...&lt;/blockquote&gt;
&lt;br /&gt;
4.&amp;nbsp;&lt;a href="http://m.inven.co.kr/powerbbs/powerbbs.php?come_idx=2813&amp;amp;l=38"&gt;http://m.inven.co.kr/powerbbs/powerbbs.php?come_idx=2813&amp;amp;l=38&lt;/a&gt;&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;Original Text:&lt;/b&gt; ... 꼭 듣고 싶은 강의는... 11월 8일...&amp;nbsp;16:30~18:40 = 스페이스 마린의 렌더링 기술&lt;/blockquote&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;Google Translation:&lt;/b&gt;&amp;nbsp;... Lecturers want to hear it ... Nov. 8. 16:30 to 18:40 = rendering technology of the Space Marines&lt;/blockquote&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;My Translation:&lt;/b&gt; Lectures I really want to attend... Nov 8, 16:30 ~ 18:40 = the Rendering Tech of Space Marine&lt;/blockquote&gt;
&lt;br /&gt;
5.&amp;nbsp;&lt;a href="http://blog.naver.com/taiger11/20141997930"&gt;http://blog.naver.com/taiger11/20141997930&lt;/a&gt;&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;Original Text:&lt;/b&gt; 제가 존경하는 게임개발자이신 포프님입니다 ㅇㅂㅇ....&amp;nbsp;처음엔 게임개발에 관심가지고 정보 찾아보다가 포프님 블로그에서 북미게임기업취업에 대해 다루는 글을 보게 되었고 댓글을 달면서 소통하다가 알게된분이심. 작년엔 일이있으셔서 KGC 강연에 참가 못하셨는데 올해는 KGC에 참가하시네요 ㅇㅂㅇ ....(프로그래밍 잘 못하지만 가고싶은...근데 수능이랑 겹치지 ㅋㅋ OTL) 나도 커서 포프님처럼 남들앞에서 떨지않고 뭔가 발표하거나 강연해보고 싶은...&lt;/blockquote&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;Google Translation:&lt;/b&gt;&amp;nbsp;Hi I am Pope, who is a respected game developers ㅇ ㅇ f. .... At first I got interested in game development popeunim search of information on a blog that covers some of North America, game companies look for employment and have learned a comment dalmyeonseo minutes hadaga eccentric communication. Have you participated in twelve lectures last year for letting KGC KGC Did not participate in this year was rubbish ....( ㅇ ㅇ Programming f. .. Then I want to go but do not overlap and ㅋ ㅋ SAT OTL) I tremble at the cursor in front of others like you Pope announced, but something or willing to talk ...&lt;/blockquote&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;My Translation:&lt;/b&gt; Pope, the game programmer I respect, is presenting at KGC 2011. I did get to know him while reading and replying to his blog posts on being a game developer in North America. (Although I'm not a good programmer yet, I wish I could attend his presentation. &amp;nbsp;But I have to take SAT test that day.. -shrugs-)... In the future, I hope to present something in front of people confidently just like Pope.&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;
6.&amp;nbsp;&lt;a href="http://media.daum.net/society/nation/others/view.html?cateid=100011&amp;amp;newsid=20110929141208516"&gt;http://media.daum.net/society/nation/others/view.html?cateid=100011&amp;amp;newsid=20110929141208516&lt;/a&gt;&lt;br /&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;Original Text:&lt;/b&gt; 다니엘 베리노 렐릭엔터테인먼트 프로그래머와 킴 포프 수석 그래픽 프로그래머도 공동연사로 나선다. 둘 다 게임엔진과 게임그래픽 분야의 대가다.&lt;/blockquote&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;Google Translation:&lt;/b&gt;&amp;nbsp;Daniel and Kim Pope berino relrikenteoteinmeonteu senior graphics programmer programmer co-speakers out there. Both the soldier in the field of game engine and game graphics.&lt;/blockquote&gt;
&lt;blockquote class="tr_bq"&gt;
&lt;b&gt;My Translation:&lt;/b&gt; Also Daniel Barrero (Graphics Programmer) and Pope Kim (Senior Graphics Programmer) from Relic Entertainment are co-presenting at KGC 2011. &amp;nbsp;Both are the masters of Game Engines and Computer Graphics.&lt;/blockquote&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-7362957141127230791?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/8dO_9aIao0qAplJf01WDFA_tUGo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8dO_9aIao0qAplJf01WDFA_tUGo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/8dO_9aIao0qAplJf01WDFA_tUGo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/8dO_9aIao0qAplJf01WDFA_tUGo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=oQLarNgomNw:ZyoC1pPByXQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=oQLarNgomNw:ZyoC1pPByXQ:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=oQLarNgomNw:ZyoC1pPByXQ:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=oQLarNgomNw:ZyoC1pPByXQ:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=oQLarNgomNw:ZyoC1pPByXQ:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=oQLarNgomNw:ZyoC1pPByXQ:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=oQLarNgomNw:ZyoC1pPByXQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=oQLarNgomNw:ZyoC1pPByXQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=oQLarNgomNw:ZyoC1pPByXQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=oQLarNgomNw:ZyoC1pPByXQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=oQLarNgomNw:ZyoC1pPByXQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=oQLarNgomNw:ZyoC1pPByXQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=oQLarNgomNw:ZyoC1pPByXQ:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=oQLarNgomNw:ZyoC1pPByXQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=oQLarNgomNw:ZyoC1pPByXQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=oQLarNgomNw:ZyoC1pPByXQ:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/oQLarNgomNw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/7362957141127230791/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2011/11/feedback-on-my-kgc-2011-presentation.html#comment-form" title="5 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/7362957141127230791?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/7362957141127230791?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/oQLarNgomNw/feedback-on-my-kgc-2011-presentation.html" title="Feedback on My KGC 2011 Presentation" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><thr:total>5</thr:total><feedburner:origLink>http://www.popekim.com/2011/11/feedback-on-my-kgc-2011-presentation.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0UHR3k9fip7ImA9WhdaF0o.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-838693038951982779</id><published>2011-10-27T22:20:00.000-07:00</published><updated>2011-10-27T22:20:36.766-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-10-27T22:20:36.766-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Music" /><category scheme="http://www.blogger.com/atom/ns#" term="Personal" /><title>I Figured Out Wild and Free Chords</title><content type="html">&lt;br /&gt;
I have been trying to find the &lt;b&gt;correct&lt;/b&gt; guitar chords for Wild and Free by Damian Rice for a while without any success. &amp;nbsp;The closest one was &lt;a href="http://tabs.ultimate-guitar.com/d/damien_rice/wild_and_free_crd.htm"&gt;this&lt;/a&gt;, but still not 100% correct.&lt;br /&gt;
&lt;br /&gt;
So I just did it by myself.... Enjoy.. if you know how to play guitar and you are a fan of Damian Rice just like me. For lyrics, take a look at the above link. meh...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;verse e - bm - c#m - g#m&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;prechrous a - e - bm - c#m&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;chrus f#m - c#m&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
(Damian does a simple finger trick with the last c#m chord. Lift and press again fourth finger at the first time and then fifth finger at the 2nd time)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-838693038951982779?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pdMP0dRIHCzPCmVGpgcKFYv3IZk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pdMP0dRIHCzPCmVGpgcKFYv3IZk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/pdMP0dRIHCzPCmVGpgcKFYv3IZk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pdMP0dRIHCzPCmVGpgcKFYv3IZk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=JvElzkwVUNY:szq-xl88khQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=JvElzkwVUNY:szq-xl88khQ:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=JvElzkwVUNY:szq-xl88khQ:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=JvElzkwVUNY:szq-xl88khQ:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=JvElzkwVUNY:szq-xl88khQ:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=JvElzkwVUNY:szq-xl88khQ:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=JvElzkwVUNY:szq-xl88khQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=JvElzkwVUNY:szq-xl88khQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=JvElzkwVUNY:szq-xl88khQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=JvElzkwVUNY:szq-xl88khQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=JvElzkwVUNY:szq-xl88khQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=JvElzkwVUNY:szq-xl88khQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=JvElzkwVUNY:szq-xl88khQ:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=JvElzkwVUNY:szq-xl88khQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=JvElzkwVUNY:szq-xl88khQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=JvElzkwVUNY:szq-xl88khQ:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/JvElzkwVUNY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/838693038951982779/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2011/10/i-figured-out-wild-and-free-chords.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/838693038951982779?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/838693038951982779?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/JvElzkwVUNY/i-figured-out-wild-and-free-chords.html" title="I Figured Out Wild and Free Chords" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.popekim.com/2011/10/i-figured-out-wild-and-free-chords.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkQMQH44cSp7ImA9WhZbFU4.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-2196263377375940592</id><published>2011-06-19T17:39:00.000-07:00</published><updated>2011-06-19T17:39:41.039-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-19T17:39:41.039-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Debugging" /><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><category scheme="http://www.blogger.com/atom/ns#" term="C++" /><title>I use int 3 for assert()</title><content type="html">C has &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;assert()&lt;/span&gt; function. &amp;nbsp;Sure.. I don't use it. &amp;nbsp;I don't like the call stack it gives me. &amp;nbsp;It is rather confusing: I want the line with the problem at the top of my call stack. Sure, there's a way to unroll stack for sure. Too much hassle. Instead, I use this for my own assert.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;#define ASSERT(expr, ...) if(!expr) __asm{ int 3 }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
What it does is basically breaking at the code where this ASSERT happens. &amp;nbsp;So when I use this assert I would do something like this:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;ASSERT( life == sucks, "LIFE CAN ONLY SUCK");&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
This string message is for my own reference. &amp;nbsp;When the code breaks in debugger, it simply shows that code line, so I know what it is right away.&lt;br /&gt;
&lt;br /&gt;
As it relies on HW interrupt, it only works on PC. &amp;nbsp;If you want this to work on PowerPC CPUs, &lt;a href="http://stackoverflow.com/questions/37299/xcode-equivalent-of-asm-int-3-debugbreak-halt"&gt;I heard&lt;/a&gt; you have to use this instead.&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;#define ASSERT(expr, ...) if(!expr) asm{trap}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Happy coding. Yay?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-2196263377375940592?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/DAOJjd7iFLzc3cMhabxaXAv_wyk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DAOJjd7iFLzc3cMhabxaXAv_wyk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/DAOJjd7iFLzc3cMhabxaXAv_wyk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/DAOJjd7iFLzc3cMhabxaXAv_wyk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=zK_pGJqUXgk:ainlc_9Z5y8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=zK_pGJqUXgk:ainlc_9Z5y8:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=zK_pGJqUXgk:ainlc_9Z5y8:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=zK_pGJqUXgk:ainlc_9Z5y8:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=zK_pGJqUXgk:ainlc_9Z5y8:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=zK_pGJqUXgk:ainlc_9Z5y8:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=zK_pGJqUXgk:ainlc_9Z5y8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=zK_pGJqUXgk:ainlc_9Z5y8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=zK_pGJqUXgk:ainlc_9Z5y8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=zK_pGJqUXgk:ainlc_9Z5y8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=zK_pGJqUXgk:ainlc_9Z5y8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=zK_pGJqUXgk:ainlc_9Z5y8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=zK_pGJqUXgk:ainlc_9Z5y8:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=zK_pGJqUXgk:ainlc_9Z5y8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=zK_pGJqUXgk:ainlc_9Z5y8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=zK_pGJqUXgk:ainlc_9Z5y8:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/zK_pGJqUXgk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/2196263377375940592/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2011/06/i-use-int-3-for-assert.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/2196263377375940592?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/2196263377375940592?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/zK_pGJqUXgk/i-use-int-3-for-assert.html" title="I use int 3 for assert()" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.popekim.com/2011/06/i-use-int-3-for-assert.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08ASXo6eyp7ImA9WhZUFko.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-5671828072676499587</id><published>2011-06-09T09:18:00.001-07:00</published><updated>2011-06-09T21:24:08.413-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-09T21:24:08.413-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><category scheme="http://www.blogger.com/atom/ns#" term="C++" /><title>Inside of char* string buffer initialization</title><content type="html">&lt;div&gt;
&lt;br /&gt;
I used to initialize a string buffer this way:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;char temp[64];&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;temp[0] = 0;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
A few years ago, one of my coworkers at my previous studio, Capcom Vancouver, told me the following way is better:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;char temp[64] = {0, };&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I don't remember why he said it was better. I've been just using this way since I'm a nice guy who trusts one's coworkers. &amp;nbsp;But finally I figured it out.... well... by accident...&lt;br /&gt;
&lt;br /&gt;
The other day I was doing some profile captures on Xbox 360 and I happened to see how the above code gets compiled into. Once compiled, it turns into this:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;char temp[64];&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;memset(temp, 0, sizeof(char) * 64);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Interesting, huh? It takes a few micro secs, so not that bad, but now I think this type of initialization is not always necessary if the buffer is always filled by &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;strcpy&lt;/span&gt; or similar functions right after. (so as long as it eventually becomes null-terminated)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-5671828072676499587?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cJzQ6OQpRxiWjuOpWWQA-KQ8ztU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cJzQ6OQpRxiWjuOpWWQA-KQ8ztU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cJzQ6OQpRxiWjuOpWWQA-KQ8ztU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cJzQ6OQpRxiWjuOpWWQA-KQ8ztU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=02D7hgZlSWs:0Up-Ul5u4lQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=02D7hgZlSWs:0Up-Ul5u4lQ:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=02D7hgZlSWs:0Up-Ul5u4lQ:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=02D7hgZlSWs:0Up-Ul5u4lQ:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=02D7hgZlSWs:0Up-Ul5u4lQ:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=02D7hgZlSWs:0Up-Ul5u4lQ:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=02D7hgZlSWs:0Up-Ul5u4lQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=02D7hgZlSWs:0Up-Ul5u4lQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=02D7hgZlSWs:0Up-Ul5u4lQ:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=02D7hgZlSWs:0Up-Ul5u4lQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=02D7hgZlSWs:0Up-Ul5u4lQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=02D7hgZlSWs:0Up-Ul5u4lQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=02D7hgZlSWs:0Up-Ul5u4lQ:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=02D7hgZlSWs:0Up-Ul5u4lQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=02D7hgZlSWs:0Up-Ul5u4lQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=02D7hgZlSWs:0Up-Ul5u4lQ:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/02D7hgZlSWs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/5671828072676499587/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2011/06/inside-of-char-string-buffer.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/5671828072676499587?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/5671828072676499587?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/02D7hgZlSWs/inside-of-char-string-buffer.html" title="Inside of char* string buffer initialization" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.popekim.com/2011/06/inside-of-char-string-buffer.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YEQXg5fCp7ImA9WhZVF0U.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-3171971099522083635</id><published>2011-05-30T11:45:00.000-07:00</published><updated>2011-05-30T11:45:00.624-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-30T11:45:00.624-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Graphics" /><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><title>Screen-space Lens-Flare in HomeFront?</title><content type="html">I consider myself a practical graphics programmer. I believe mathematically correctness is less important than what looks right(or okay) to gamers.&lt;br /&gt;
&lt;br /&gt;
I recently saw an interesting lens-flare technique that goes along with my belief in a game called HomeFront.&lt;br /&gt;
In this game, lens-flare effect is a mere full-screen overlay of a bubble patterned image, which is revealed only on the pixels where bright lights are.&lt;br /&gt;
&lt;br /&gt;
Look at my awesome picture below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-hmCA5qIywdg/TdgIkA9aj5I/AAAAAAAAAhY/H6uKYivA0gw/s1600/homefront_lensflare.jpg" imageanchor="1"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-hmCA5qIywdg/TdgIkA9aj5I/AAAAAAAAAhY/H6uKYivA0gw/s1600/homefront_lensflare.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;br /&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
So from the left top picture, let's say the yellow part is where bright light is. (and the chance is you probably have some type of HDR buffer already to do effects like bloom.) &amp;nbsp;Then it'll use the luminance on each pixel as blend factor for lens flare bubble texture, making the final scene reveal bubble pattern on those bright pixels&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
I found this lens flare technique looks good enough when the high&amp;nbsp;luminance&amp;nbsp;area is small enough. The only time it looked a bit weird was when a large light, such as campfire, covers a lot of pixel spaces, revealing too much bubbles altogether. It almost made me feel like I was doing bubble bath. Hah! But I won't complain.&amp;nbsp;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
Given that HomeFront was made by our sister studio, Kaos, I can probably ask them if my speculation(?) is correct, &amp;nbsp;But if I do so, I won't be able to write this blog post without going through our legal team. So let's just leave it as my own speculation.&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
I liked this technique. That's all I wanted to say.&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
p.s. &amp;nbsp;I saw this technique on PC version.&lt;/div&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-3171971099522083635?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ZMp5n6l1B6-rC869k3JL9z6D_aU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZMp5n6l1B6-rC869k3JL9z6D_aU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ZMp5n6l1B6-rC869k3JL9z6D_aU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ZMp5n6l1B6-rC869k3JL9z6D_aU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Is2QtqLk28s:KOB8fFLu7Yg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Is2QtqLk28s:KOB8fFLu7Yg:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Is2QtqLk28s:KOB8fFLu7Yg:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=Is2QtqLk28s:KOB8fFLu7Yg:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Is2QtqLk28s:KOB8fFLu7Yg:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=Is2QtqLk28s:KOB8fFLu7Yg:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Is2QtqLk28s:KOB8fFLu7Yg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=Is2QtqLk28s:KOB8fFLu7Yg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Is2QtqLk28s:KOB8fFLu7Yg:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Is2QtqLk28s:KOB8fFLu7Yg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=Is2QtqLk28s:KOB8fFLu7Yg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Is2QtqLk28s:KOB8fFLu7Yg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Is2QtqLk28s:KOB8fFLu7Yg:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Is2QtqLk28s:KOB8fFLu7Yg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=Is2QtqLk28s:KOB8fFLu7Yg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Is2QtqLk28s:KOB8fFLu7Yg:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/Is2QtqLk28s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/3171971099522083635/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2011/05/screen-space-lens-flare-in-homefront.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/3171971099522083635?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/3171971099522083635?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/Is2QtqLk28s/screen-space-lens-flare-in-homefront.html" title="Screen-space Lens-Flare in HomeFront?" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-hmCA5qIywdg/TdgIkA9aj5I/AAAAAAAAAhY/H6uKYivA0gw/s72-c/homefront_lensflare.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.popekim.com/2011/05/screen-space-lens-flare-in-homefront.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MGSXk4fSp7ImA9WhZVEEQ.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-3686263279367676999</id><published>2011-05-21T13:58:00.000-07:00</published><updated>2011-05-22T14:23:48.735-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-22T14:23:48.735-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Tools" /><category scheme="http://www.blogger.com/atom/ns#" term="Graphics" /><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><title>How to Add Generic Convolution Filter to NVTT</title><content type="html">A few month ago, &lt;a href="http://www.popekim.com/2011/03/added-generic-convolution-filter-to.html"&gt;I said I would write a post about how to add a generic convolution filter to NVidia Texture Tool&lt;/a&gt;&amp;nbsp;once I get a clearance from our legal team. &amp;nbsp;And finally they got back to me.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;Background&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
The reason why I added this feature at work was because our artists wanted a sharpening filter on mipmaps. &amp;nbsp;This feature was present with the original NVTT 1, but removed from NVTT 2. &amp;nbsp;Given that sharpening filter is a simple 3x3 or 5x5 convolution filter, I've decided to add a generic convolution filter support which can take any arbitrary&amp;nbsp;coefficients. With this approach, anyone can run almost every image processing algorithms based on on convolution.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;NVTT Modification&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
So here's how. &amp;nbsp;It requires only a few lines of change on 6 files. So I'll just walk you through.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Step 1. Get revision 1277 from &lt;a href="http://code.google.com/p/nvidia-texture-tools/"&gt;NVidia Texture Tools project&lt;/a&gt; page.&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
I haven't tested this on later revisions, but I think it should work unless there were major changes in that source code.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Step 2. Open up&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;src/nvimage/Filter.h&lt;/span&gt; and add this constructor.&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Kernel2(uint width, const float * data);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Step 3. Open up&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt; src/nvimage/Filter.cpp&lt;/span&gt; and add this function.&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Kernel2::Kernel2(uint ws, const float* data) : m_windowSize(ws)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; m_data = new float[m_windowSize * m_windowSize];&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; memcpy(m_data, data, sizeof(float) * m_windowSize * m_windowSize);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Step 4. Open up &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;src/nvimage/FloatImage.h&lt;/span&gt; and add this function prototype.&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;NVIMAGE_API void doConvolution(uint size, const float* data);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Step 5. Open up &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;src/nvimage/FloatImage.cpp&lt;/span&gt; and add this function implementation.&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;void FloatImage::doConvolution(uint size, const float* data)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Kernel2 k(size, data);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; AutoPtr&lt;floatimage&gt; tmpImage = clone();&lt;/floatimage&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for(uint y = 0; y &amp;lt; height(); y++)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for(uint x = 0; x &amp;lt; width(); x++)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (uint c = 0; c &amp;lt; 4; ++c )&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pixel(x, y, c) = tmpImage-&amp;gt;applyKernel(&amp;amp;k, x, y, c, WrapMode_Clamp);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;			&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Step 6. Open up &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;src/nvtt/nvtt.h&lt;/span&gt; and add this function prototype under &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;struct TexImage&lt;/span&gt;.&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;NVTT_API void doConvolution(unsigned int size, const float* data);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Step 7. Open up &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;src/nvtt/TexImage.cpp&lt;/span&gt; and add this function implementation.&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;void TexImage::doConvolution(unsigned int size, const float* data)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; if (m-&amp;gt;image == NULL) return;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; detach();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; m-&amp;gt;image-&amp;gt;doConvolution(size, data);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;How to Use&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
How to use this is very straight forward. Assuming you already have a &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;TexImage &lt;/span&gt;object named &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;image&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;,&lt;/span&gt; you can do this.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;const int kernelSize = 3; &amp;nbsp; &amp;nbsp;// let's use 3 x 3 kernel&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;// Some random&amp;nbsp;coefficients&amp;nbsp;I found working great for sharpening.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;const float sharpenKernel [] =&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; -1/16.0f, -2/16.0f, &amp;nbsp; &amp;nbsp; -1/16.0f,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; -2/16.0f, 1 + 12/16.0f, -2/16.0f,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; -1/16.0f, -2/16.0f, &amp;nbsp; &amp;nbsp; -1/16.0f,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;image.doConvolution(kernelSize,&amp;nbsp;sharpenKernel);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
YAY!&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
p.s. I've also emailed the patch file to &lt;a href="http://www.ludicon.com/castano/blog/"&gt;Ignacio&lt;/a&gt;, the creator/maintainer of NVTT project. &amp;nbsp;Let's see if it ever makes into the codebase. :)&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-3686263279367676999?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/c2s_KNZxcf6bEpg6LpZczP6UgPI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/c2s_KNZxcf6bEpg6LpZczP6UgPI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/c2s_KNZxcf6bEpg6LpZczP6UgPI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/c2s_KNZxcf6bEpg6LpZczP6UgPI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=iE5wf0ZLuWU:zu3tC9wE7U4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=iE5wf0ZLuWU:zu3tC9wE7U4:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=iE5wf0ZLuWU:zu3tC9wE7U4:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=iE5wf0ZLuWU:zu3tC9wE7U4:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=iE5wf0ZLuWU:zu3tC9wE7U4:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=iE5wf0ZLuWU:zu3tC9wE7U4:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=iE5wf0ZLuWU:zu3tC9wE7U4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=iE5wf0ZLuWU:zu3tC9wE7U4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=iE5wf0ZLuWU:zu3tC9wE7U4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=iE5wf0ZLuWU:zu3tC9wE7U4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=iE5wf0ZLuWU:zu3tC9wE7U4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=iE5wf0ZLuWU:zu3tC9wE7U4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=iE5wf0ZLuWU:zu3tC9wE7U4:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=iE5wf0ZLuWU:zu3tC9wE7U4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=iE5wf0ZLuWU:zu3tC9wE7U4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=iE5wf0ZLuWU:zu3tC9wE7U4:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/iE5wf0ZLuWU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/3686263279367676999/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2011/05/how-to-add-generic-convolution-filter.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/3686263279367676999?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/3686263279367676999?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/iE5wf0ZLuWU/how-to-add-generic-convolution-filter.html" title="How to Add Generic Convolution Filter to NVTT" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.popekim.com/2011/05/how-to-add-generic-convolution-filter.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0AEQXg_eSp7ImA9WhZWGE8.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-6145216735261794276</id><published>2011-05-19T09:15:00.000-07:00</published><updated>2011-05-19T09:15:00.641-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-19T09:15:00.641-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Graphics" /><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><category scheme="http://www.blogger.com/atom/ns#" term="Rants" /><category scheme="http://www.blogger.com/atom/ns#" term="Career Advice" /><title>Theorycraft = Witchcraft? Maybe</title><content type="html">&lt;br /&gt;
Although I can't deny that posts from a lot graphics programming blogs help us to learn new cool stuff, I'm also often worried about the quality of posts, especially when people claim something not entirely true from a pure "theorycraft" instead of actual experience. &amp;nbsp;Things that make sense on theory don't&amp;nbsp;necessary&amp;nbsp;make sense in reality, that is.&lt;br /&gt;
&lt;br /&gt;
If you are a decent graphics programmer, you should take only&amp;nbsp;empirical&amp;nbsp;results as truth.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-6145216735261794276?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2F2x94y85iaa4AnNaDmmHMUprDU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2F2x94y85iaa4AnNaDmmHMUprDU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2F2x94y85iaa4AnNaDmmHMUprDU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2F2x94y85iaa4AnNaDmmHMUprDU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Y2QZ8z-q15A:tXynMwi6w5Q:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Y2QZ8z-q15A:tXynMwi6w5Q:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Y2QZ8z-q15A:tXynMwi6w5Q:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=Y2QZ8z-q15A:tXynMwi6w5Q:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Y2QZ8z-q15A:tXynMwi6w5Q:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=Y2QZ8z-q15A:tXynMwi6w5Q:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Y2QZ8z-q15A:tXynMwi6w5Q:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=Y2QZ8z-q15A:tXynMwi6w5Q:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Y2QZ8z-q15A:tXynMwi6w5Q:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Y2QZ8z-q15A:tXynMwi6w5Q:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=Y2QZ8z-q15A:tXynMwi6w5Q:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Y2QZ8z-q15A:tXynMwi6w5Q:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Y2QZ8z-q15A:tXynMwi6w5Q:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Y2QZ8z-q15A:tXynMwi6w5Q:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=Y2QZ8z-q15A:tXynMwi6w5Q:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Y2QZ8z-q15A:tXynMwi6w5Q:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/Y2QZ8z-q15A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/6145216735261794276/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2011/05/theorycraft-witchcraft-maybe.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/6145216735261794276?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/6145216735261794276?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/Y2QZ8z-q15A/theorycraft-witchcraft-maybe.html" title="Theorycraft = Witchcraft? Maybe" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.popekim.com/2011/05/theorycraft-witchcraft-maybe.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE8BR34_eip7ImA9WhRSFkk.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-8811060834070736692</id><published>2011-05-16T10:08:00.000-07:00</published><updated>2011-11-18T11:00:56.042-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-11-18T11:00:56.042-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Shader" /><category scheme="http://www.blogger.com/atom/ns#" term="Graphics" /><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><title>Oren-Nayar Lighting in Light Prepass Renderer</title><content type="html">This is a conversation I had with another graphics programmer the other day:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;A: "Using Oren-Nayar lighting is extreme hard with our rendering engine because IT is Light Pre-Pass renderer."&lt;/li&gt;
&lt;li&gt;Me: "WTF? It's very easy."&lt;/li&gt;
&lt;li&gt;A: "No. &lt;a href="http://gamedevcoder.wordpress.com/2011/04/11/light-pre-pass-vs-deferred-renderer-part-1/"&gt;This blog&lt;/a&gt; says it's very hard."&lt;/li&gt;
&lt;li&gt;Me: "Uh... but look at this. &amp;nbsp;I've already implemented it in our engine 2 years ago, and it was very trivial."&lt;/li&gt;
&lt;li&gt;A: "OMG." -looks puzzled-&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
Okay. So I explained to him how I did it. And I'm gonna write the same thing here for the people who might be interested. &amp;nbsp;(I think the original blog post wanted to say supporting various lighting models is not easy in a deferred context, which is actually a valid point.)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
First, if you don't know what Oren-Nayar is, look at &lt;a href="http://content.gpwiki.org/index.php/D3DBook:(Lighting)_Oren-Nayar"&gt;this amazing free book&lt;/a&gt;. It even shows a way to optimize it with a texture lookup. &amp;nbsp;My own simple explanation of Oren-Nayar is a diffuse lighting model that additionally takes account of &lt;i&gt;Roughness&lt;/i&gt;. &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Second, for those people who don't know what Light Pre-Pass renderer is, &lt;a href="http://diaryofagraphicsprogrammer.blogspot.com/2008/03/light-pre-pass-renderer.html"&gt;read this&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
K, now real stuff. &amp;nbsp;To do Oren-Nayar, you only need one additional information. Yes, roughness. &amp;nbsp;Then how can we do Oren-Nayar in a Light Pre-pass renaderer? &amp;nbsp;Save roughness value on the G-Buffer, duh~. &amp;nbsp;There are multiple ways to save roughness on G-Buffer and probably this is where the confusion came from.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
It looks like most light-prepas approaches use R16G16 for G-Buffer to store XY components of normals. &amp;nbsp;So to store additional information (e.g, roughness), you will need another render target = expensive = not good.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Another approach is to use 8 bit per channel to store normal map, but you will see some bending artifacts = bad lighting = bad bad. But, thanks to Crytek guys, you can actually store normals in three 8-bit channels without quality problem. It's called &lt;a href="http://www.crytek.com/cryengine/presentations/CryENGINE3-reaching-the-speed-of-light"&gt;best-fit normal&lt;/a&gt;. So once you use this normal storage method, now you have an extra 8 bit channel that you can use for roughness. &amp;nbsp;Hooray! Problem solved.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
But my actual implementation was a bit more than this because I needed to store specular power, too. &amp;nbsp;So I thought about it. &amp;nbsp;And found out we don't really need 8 bits for specular power(do you really need any specular power value over 127? &amp;nbsp;Or do you really use any specular power value less than 11?) &amp;nbsp;So I'm using 7 bit for specular power and 1 bit for roughness on/off flag. &amp;nbsp;Then roughness is just on and off? No. It shouldn't. &amp;nbsp;If you think a bit more, you will realize that roughness is just an inverse function of specular power &amp;nbsp;Think this way. Rougher surface will scatter lights more evenly, so specular power should be less for those surfaces and vice versa.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
With all these observations, and some hackery hack functions,&amp;nbsp;this is what I really did at the end.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;G-Buffer Storage&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;RGB: Normal&lt;/li&gt;
&lt;li&gt;A: Roughness/Specular Power fusion&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;b&gt;Super Simplified Lighting Pre-pass Shader Code&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;float4 gval = tex2D(Gbuffer, uv);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;// decode normal using crytek's method texture&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;float3 normal = decodeNormal(gval.xyz); &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;float specpower = gval.a * 255.0f;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;float roughness = 0;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;if (specpower &amp;gt; 127.0f)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; specpower -= 128.0f;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; roughness = someHackeryCurveFunction(127.0f - specpower);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;// Now use this parameters to calculate correct lighting for the pixel.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Ta da.. not that hard, eh? &amp;nbsp;This approach was faster enough to ship a game on Xbox 360 and PS3 with &lt;a href="http://www.popekim.com/2011/11/optimized-oren-nayar-approximation.html"&gt;some Oren-Nayar optimization through an approximation&lt;/a&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-8811060834070736692?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/A83rSBKpgBSVLY8bqBEYDbhtkxI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/A83rSBKpgBSVLY8bqBEYDbhtkxI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/A83rSBKpgBSVLY8bqBEYDbhtkxI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/A83rSBKpgBSVLY8bqBEYDbhtkxI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TnQzz29AiH8:XJ4pJMTKMPc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TnQzz29AiH8:XJ4pJMTKMPc:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TnQzz29AiH8:XJ4pJMTKMPc:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=TnQzz29AiH8:XJ4pJMTKMPc:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TnQzz29AiH8:XJ4pJMTKMPc:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=TnQzz29AiH8:XJ4pJMTKMPc:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TnQzz29AiH8:XJ4pJMTKMPc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=TnQzz29AiH8:XJ4pJMTKMPc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TnQzz29AiH8:XJ4pJMTKMPc:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TnQzz29AiH8:XJ4pJMTKMPc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=TnQzz29AiH8:XJ4pJMTKMPc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TnQzz29AiH8:XJ4pJMTKMPc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TnQzz29AiH8:XJ4pJMTKMPc:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TnQzz29AiH8:XJ4pJMTKMPc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=TnQzz29AiH8:XJ4pJMTKMPc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=TnQzz29AiH8:XJ4pJMTKMPc:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/TnQzz29AiH8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/8811060834070736692/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2011/05/oren-nayar-lighting-in-light-prepass.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/8811060834070736692?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/8811060834070736692?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/TnQzz29AiH8/oren-nayar-lighting-in-light-prepass.html" title="Oren-Nayar Lighting in Light Prepass Renderer" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.popekim.com/2011/05/oren-nayar-lighting-in-light-prepass.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C04CRn0_eCp7ImA9WhZWEE0.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-300294081049594462</id><published>2011-05-09T10:27:00.000-07:00</published><updated>2011-05-09T21:32:47.340-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-09T21:32:47.340-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Music" /><title>On a Windy Day</title><content type="html">Finally decided to post my music on YouTube.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;object height="349" width="560"&gt;&lt;param name="movie" value="http://www.youtube-nocookie.com/v/2oJVhqPXJyo?fs=1&amp;amp;hl=en_US&amp;amp;rel=0"&gt;

&lt;/param&gt;
&lt;param name="allowFullScreen" value="true"&gt;

&lt;/param&gt;
&lt;param name="allowscriptaccess" value="always"&gt;

&lt;/param&gt;
&lt;embed src="http://www.youtube-nocookie.com/v/2oJVhqPXJyo?fs=1&amp;amp;hl=en_US&amp;amp;rel=0" type="application/x-shockwave-flash" width="560" height="349" allowscriptaccess="always" allowfullscreen="true"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-300294081049594462?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QT6chLNFKrWirNWstAEwzxUcwq8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QT6chLNFKrWirNWstAEwzxUcwq8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QT6chLNFKrWirNWstAEwzxUcwq8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QT6chLNFKrWirNWstAEwzxUcwq8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=nNzMASLU4Cg:ojDXnZl04HM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=nNzMASLU4Cg:ojDXnZl04HM:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=nNzMASLU4Cg:ojDXnZl04HM:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=nNzMASLU4Cg:ojDXnZl04HM:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=nNzMASLU4Cg:ojDXnZl04HM:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=nNzMASLU4Cg:ojDXnZl04HM:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=nNzMASLU4Cg:ojDXnZl04HM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=nNzMASLU4Cg:ojDXnZl04HM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=nNzMASLU4Cg:ojDXnZl04HM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=nNzMASLU4Cg:ojDXnZl04HM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=nNzMASLU4Cg:ojDXnZl04HM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=nNzMASLU4Cg:ojDXnZl04HM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=nNzMASLU4Cg:ojDXnZl04HM:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=nNzMASLU4Cg:ojDXnZl04HM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=nNzMASLU4Cg:ojDXnZl04HM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=nNzMASLU4Cg:ojDXnZl04HM:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/nNzMASLU4Cg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/300294081049594462/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2011/05/on-windy-day.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/300294081049594462?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/300294081049594462?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/nNzMASLU4Cg/on-windy-day.html" title="On a Windy Day" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><thr:total>0</thr:total><feedburner:origLink>http://www.popekim.com/2011/05/on-windy-day.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08GQXs8fSp7ImA9WhZXFEk.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-7499088142558871589</id><published>2011-05-03T09:57:00.000-07:00</published><updated>2011-05-03T09:57:00.575-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-03T09:57:00.575-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Shader" /><category scheme="http://www.blogger.com/atom/ns#" term="Graphics" /><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><title>Tales of Multiply Map and Gamma Correction</title><content type="html">&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;Using a detail map, or multiply map, on top of diffuse map is a somewhat popular way to eliminate the repeating pattern on tiled textures.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span"&gt;I've once implemented this upon an artist's request. The actual blend(?) math I used was&lt;/span&gt;:&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;DiffuseMap * MultiplyMap * 2&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;a href="http://2.bp.blogspot.com/-pHs58rZwTOs/TbxcDfLCgcI/AAAAAAAAAgw/tRQRqvR8B3g/s1600/Gamma.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"&gt;&lt;img border="0" height="200" src="http://2.bp.blogspot.com/-pHs58rZwTOs/TbxcDfLCgcI/AAAAAAAAAgw/tRQRqvR8B3g/s200/Gamma.png" width="200" /&gt;&lt;/a&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;The reason I added * 2 at the end was to also give a detail map the ability to brighten the diffuse map. &amp;nbsp;(without this, it can only darken the base map.) &amp;nbsp;So the idea was if an artist paint a detail map with half grey, or 0.5, it wouldn't change the base diffuse map at all.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;It had worked fine until we decided to change our rendering engine to "g&lt;a href="http://legalizeadulthood.wordpress.com/2007/08/28/gamefest-2007-picture-perfect-gamma-through-the-rendering-pipeline/"&gt;amma-aware&lt;/a&gt;". While we were enabling sRGB texture read on certain textures, we&amp;nbsp;&lt;/span&gt;accidentally&amp;nbsp;did it on detail maps, too.&amp;nbsp;Then, a month or two passed by, and a few assets were made with this new "gamma-powered" shaders.&lt;br /&gt;
&lt;br /&gt;
Then a "tech-driven" artist found out painting a detail map with the value of 0.5 darkens the texture instead of keeping the base colour. OMG. This was because our new blending formula looked like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;{ (DiffuseMap ^ 2.2) * (MultiplyMap ^ 2.2) * 2 } ^ (1/2.2)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
Because of power of 2.2, it makes 0.5 smaller than 0.25 and multiplying this by 2 gives you a value less than half intensity, 0.5. So I had to fix it by disabling&amp;nbsp;sRGB read on multiply maps. And this is how the blending looks like now:&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;{ (DiffuseMap ^ 2.2) * MultiplyMap * 2 } ^ (1/2.2)&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
Better, eh?&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;/span&gt;Then, I asked artists to change detail maps authored with previous&amp;nbsp;shaders&amp;nbsp;to comply with our new way. To me, converting them was very straightforward.&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Open a detail map in PhotoShop.&lt;/li&gt;
&lt;li&gt;From main menu, select Image &amp;gt; Adjustment &amp;gt; Exposure.&lt;/li&gt;
&lt;li&gt;Set gamma to 0.454545(same as 1 / 2.2).&lt;/li&gt;
&lt;li&gt;Press OK&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
But this time a "visually-driven" artist wanted to change base diffuse maps instead of detail maps because gamma-ing details maps makes them too dark, so it's hard to work with. He asked me what's the easiest way to do this. Unfortunately, I couldn't find a mathematically correct way that always produces the correct conversion, so he had to manually change them while visually verifying the result.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This was probably one of the few cases where mathematical correctness can make things easier than harder, but unfortunately I was not able to find the magic formula. &amp;nbsp;I just don't think it's possible here.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Or am I just stupid? Does anyone know the correct math here?&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-7499088142558871589?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wSmGG-saj47-3vyVVe83LMYmPGY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wSmGG-saj47-3vyVVe83LMYmPGY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wSmGG-saj47-3vyVVe83LMYmPGY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wSmGG-saj47-3vyVVe83LMYmPGY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=fnmwtAVPWP0:P9RuZzRXBHw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=fnmwtAVPWP0:P9RuZzRXBHw:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=fnmwtAVPWP0:P9RuZzRXBHw:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=fnmwtAVPWP0:P9RuZzRXBHw:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=fnmwtAVPWP0:P9RuZzRXBHw:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=fnmwtAVPWP0:P9RuZzRXBHw:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=fnmwtAVPWP0:P9RuZzRXBHw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=fnmwtAVPWP0:P9RuZzRXBHw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=fnmwtAVPWP0:P9RuZzRXBHw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=fnmwtAVPWP0:P9RuZzRXBHw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=fnmwtAVPWP0:P9RuZzRXBHw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=fnmwtAVPWP0:P9RuZzRXBHw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=fnmwtAVPWP0:P9RuZzRXBHw:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=fnmwtAVPWP0:P9RuZzRXBHw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=fnmwtAVPWP0:P9RuZzRXBHw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=fnmwtAVPWP0:P9RuZzRXBHw:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/fnmwtAVPWP0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/7499088142558871589/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2011/05/tales-of-multiply-map-and-gamma.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/7499088142558871589?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/7499088142558871589?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/fnmwtAVPWP0/tales-of-multiply-map-and-gamma.html" title="Tales of Multiply Map and Gamma Correction" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-pHs58rZwTOs/TbxcDfLCgcI/AAAAAAAAAgw/tRQRqvR8B3g/s72-c/Gamma.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.popekim.com/2011/05/tales-of-multiply-map-and-gamma.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUAEQXw-cCp7ImA9WhZQFE0.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-8380803501024349700</id><published>2011-04-21T09:35:00.000-07:00</published><updated>2011-04-21T09:35:00.258-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-21T09:35:00.258-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Git" /><category scheme="http://www.blogger.com/atom/ns#" term="Tools" /><category scheme="http://www.blogger.com/atom/ns#" term="P4" /><category scheme="http://www.blogger.com/atom/ns#" term="VCS" /><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><category scheme="http://www.blogger.com/atom/ns#" term="Svn" /><title>Personal Choice of Version Control System</title><content type="html">&lt;div&gt;Being in the gaming industry about 10 years and playing with some open-source projects means I have dealt with different &lt;a href="http://en.wikipedia.org/wiki/Revision_control"&gt;version control systems, or VCSs&lt;/a&gt;, from complete free, brute-force manual file copy method to very expensive commercial-grade &lt;a href="http://www.perforce.com/"&gt;Perforce&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
So which program am I using at home? &lt;a href="http://subversion.tigris.org/"&gt;Subversion&lt;/a&gt;.... I know! A lot of people will argue that other programs are better, and I am not gonna say they are wrong. The reason why I'm using Subversion is because it does what I want with the least amount of annoyance. &amp;nbsp;Below is the list of what I need/want from my personal VCS and how the most popular VCSs do the job:&lt;br /&gt;
&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;Windows Support&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Yes, I'm a MS whore. &amp;nbsp;I use Windows all the time, and I, as a game programmer, personally don't see huge need for Linux for myself. &amp;nbsp;Also if I can maintain only one OS at home, that's less drama for me. (Yay?).&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;Git(-2):&lt;/b&gt; I like &lt;a href="http://git-scm.com/"&gt;Git&lt;/a&gt; a lot, especially how it handles branches, so I really wanted to use it on Windows. &amp;nbsp;But, as far as I know, the only way to use Git server on Windows is through &lt;a href="http://www.cygwin.com/"&gt;Cygwin&lt;/a&gt; or&amp;nbsp;&lt;a href="http://code.google.com/p/msysgit/"&gt;msysgit&lt;/a&gt;. &amp;nbsp;Cygwin is basically doing Linux emulation in a sense, and I personally don't enjoy installing Cygwin. msysgit is a bit easier to install on Windows, but still I had to set up SSH or what not, so there's no one-button solution for Git on Windows. &amp;nbsp;So big no-no to a MS whore like me.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Perforce(+1):&lt;/b&gt; Perforce supports Windows pretty well. &amp;nbsp;It comes with easy-to-install server program/service for windows.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Subversion(+2):&lt;/b&gt; This was actually a big surprise to me. &amp;nbsp;There is a program called &lt;a href="http://www.visualsvn.com/server/"&gt;VisualSVN Server&lt;/a&gt;, which is one-click solution for Subversion server on Windows. &amp;nbsp;It just works and comes with https access and access control all in one nice and simple GUI. &amp;nbsp;This was even easier than installing Perforce.&lt;/li&gt;
&lt;/ul&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;Occasional Multi-User Support&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Although my VCS is mostly there to keep a history and backups of my own codes, sometimes I open it up to my friends so that I can get useful feedback from them. &amp;nbsp;So having multi-user support is very useful for me.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;Git(+1):&lt;/b&gt; Git can easily support multiple users. &amp;nbsp;But setting access control for each users can be a bit of &lt;a href="http://www.urbandictionary.com/define.php?term=PITA"&gt;PITA&lt;/a&gt; on Windows. &amp;nbsp;When I tried it last time, I had to make fake Windows user accounts and hook'em up with SSH.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Perforce(-1):&lt;/b&gt; Perforce is free for either i)&amp;nbsp;2 users and 5 client workspaces, or ii)&amp;nbsp;unlimited users and up to 1000 files. &amp;nbsp;I have more than 1 friend (at least I wanna believe that :P ) so first option doesn't seem to work that great. &amp;nbsp;What about 1000 files and unlimited users? &amp;nbsp;Well, I've already passed 1,000 files: Playing with 3rd party open-source project breaks this boundary very easily. &amp;nbsp;Furthermore, I don't want to pay a few hundred dollars for the simple need of VCS.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Subversion(+2):&lt;/b&gt; As I said earlier in Windows Support section, VisualSVN Server comes with a nice GUI where you can simply setup users and access control. &amp;nbsp;So another big thumbs up from me.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;Cost&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
I'm cheap. I love free stuff.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;Git(+1)&lt;/b&gt;: free&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Perforce(-1)&lt;/b&gt;: free for limited use. And apparently I'm not limited?&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Subversion(+1)&lt;/b&gt;: free&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;GUI Client&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
I'm in love with Perforce's nice GUI clients. Not so much with &lt;a href="http://www.perforce.com/perforce/products/p4v.html"&gt;P4V&lt;/a&gt;; more with &lt;a href="http://www.perforce.com/perforce/products/p4win.html"&gt;P4Win&lt;/a&gt;. But P4Win is discontinued.... Oh well, P4V is still good enough. &amp;nbsp;Sure, I still use command-line a lot for certain things GUI clients don't support, but I found 90% of time, using GUI clients are much faster and easier.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;Git(-1):&lt;/b&gt; it doesn't have any nice free GUI client as far as I know. &amp;nbsp;There are some being developed at this moment, but they don't seem to be mature or free enough to use them. &amp;nbsp;&lt;a href="http://code.google.com/p/tortoisegit/"&gt;TortoiseGit&lt;/a&gt; is good enough most of the time. &amp;nbsp;But I still prefer P4Win style, real GUI clients.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Perforce(+2):&lt;/b&gt; P4Win is awesome. P4V is great, too.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Subversion(+1):&lt;/b&gt; I found a program called &lt;a href="http://www.syntevo.com/smartsvn/index.html"&gt;SmartSVN&lt;/a&gt;. &amp;nbsp;It has limited functionalities unless you buy the pro version, but I found the basic free version is good enough for day-to-day operations. &amp;nbsp;Anything that cannot be done through the free SmartSVN version, I use &lt;a href="http://tortoisesvn.tigris.org/"&gt;TortoiseSVN&lt;/a&gt;. &amp;nbsp;Then anything that cannot be done by TortoiseSVN, I use command-line. &amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;Branching&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Who doesn't love branching? &amp;nbsp;It's such a neat tool to fuck around(read it as experiment) your code without ruining your projects.&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Git(+2)&lt;/b&gt;: I love &lt;a href="http://book.git-scm.com/3_basic_branching_and_merging.html"&gt;the powerful branching feature of Git&lt;/a&gt;. You don't need to make a copy in different directories, so it helps a lot with path referencing in the code. &amp;nbsp;Say you have a program that links with library Awesome, and now you wanna branch library Awesome. &amp;nbsp;With Git, you simply need to switch to different branch and build. &amp;nbsp;But with other source control systems like Perforce, you will have to branch the library into a different directory and change the library path in your program code.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Perforce(-2):&lt;/b&gt;&amp;nbsp;As I just explained in Git section above, branching into different folder sucks. &amp;nbsp;Also the speed of branching a large number of files is slow because Perforce server controls everything. &amp;nbsp;Network speed is slower than your HDD's spin rate.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Subversion(-1):&lt;/b&gt; The speed is fast enough. &amp;nbsp;But still you have to branch into different directory.. uggh.. that bothers me.&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;Final Score&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;So final score for me is like this.&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Git:&lt;/b&gt; +1&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Perforce:&lt;/b&gt; -1&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Subversion:&lt;/b&gt; +5. &lt;a href="http://www.youtube.com/watch?v=y0PuqYB0_UI"&gt;Oh there it is. Winner, winner, chicken dinner&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;Don't forget. &amp;nbsp;This is the score for my personal need. Not for the big giant game studios. &amp;nbsp;So if you ever comeback and say "but Perforce is better because it can supports 200 users easily", I'm gonna make you watch &lt;a href="http://www.youtube.com/watch?v=t6FUR_nhGX8"&gt;this video&lt;/a&gt; for 2 hours before you go to bed.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-8380803501024349700?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VsstKUyX8hk62hry-noHF7Ev0pY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VsstKUyX8hk62hry-noHF7Ev0pY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VsstKUyX8hk62hry-noHF7Ev0pY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VsstKUyX8hk62hry-noHF7Ev0pY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=-KnzJROqJO4:Ql1pKWnVXB4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=-KnzJROqJO4:Ql1pKWnVXB4:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=-KnzJROqJO4:Ql1pKWnVXB4:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=-KnzJROqJO4:Ql1pKWnVXB4:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=-KnzJROqJO4:Ql1pKWnVXB4:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=-KnzJROqJO4:Ql1pKWnVXB4:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=-KnzJROqJO4:Ql1pKWnVXB4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=-KnzJROqJO4:Ql1pKWnVXB4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=-KnzJROqJO4:Ql1pKWnVXB4:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=-KnzJROqJO4:Ql1pKWnVXB4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=-KnzJROqJO4:Ql1pKWnVXB4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=-KnzJROqJO4:Ql1pKWnVXB4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=-KnzJROqJO4:Ql1pKWnVXB4:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=-KnzJROqJO4:Ql1pKWnVXB4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=-KnzJROqJO4:Ql1pKWnVXB4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=-KnzJROqJO4:Ql1pKWnVXB4:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/-KnzJROqJO4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/8380803501024349700/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2011/04/personal-choice-of-version-control.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/8380803501024349700?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/8380803501024349700?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/-KnzJROqJO4/personal-choice-of-version-control.html" title="Personal Choice of Version Control System" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><thr:total>1</thr:total><feedburner:origLink>http://www.popekim.com/2011/04/personal-choice-of-version-control.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEIERH89fSp7ImA9WhZQEk4.&quot;"><id>tag:blogger.com,1999:blog-7711027831820077522.post-1080299830824260187</id><published>2011-04-19T10:00:00.000-07:00</published><updated>2011-04-19T10:01:45.165-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-04-19T10:01:45.165-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Coding" /><category scheme="http://www.blogger.com/atom/ns#" term="Selfhelp Guide" /><category scheme="http://www.blogger.com/atom/ns#" term="Rants" /><category scheme="http://www.blogger.com/atom/ns#" term="Career Advice" /><title>Shipping Mindset</title><content type="html">As some of you already know, I'm currently finalling a game called &lt;a href="http://www.gametrailers.com/game/warhammer-40-000-space-marine/11436"&gt;Space Marine&lt;/a&gt;. &amp;nbsp;So it's obvious that everyone needs to shift to the Shipping Mindset.&lt;br /&gt;
&lt;br /&gt;
The Shipping Mindset is basically about being extra careful on changes you make since everytime you touch something, there is chance that you break something else. Sure, normally it's not that bad. &amp;nbsp;You can fix it sooner or later, but at this time, you wouldn't have enough time to test everything that used to work again. &amp;nbsp;So what happens if a crucial bug doesn't get caught by the time the game is submitted to the first-party publishers, such as MS and Sony? &amp;nbsp;You will fail at certification, and you will re-submit with the fixes. &amp;nbsp;Not bad. eh? Oh, did I tell you that each submission easily cost the half of your yearly salary? Now you think it's bad? Hope so.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-aX0el0OJ8Q0/Ta0UCW0ji6I/AAAAAAAAAgs/O6vxJyGVxN8/s1600/cowboy_on_computer.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-aX0el0OJ8Q0/Ta0UCW0ji6I/AAAAAAAAAgs/O6vxJyGVxN8/s1600/cowboy_on_computer.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
So, with the Shipping Mindset, this is what you MUST and MUST NOT do.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;fix broken things only&lt;/b&gt;: As said earlier, any code you change might break other things. &amp;nbsp;Please, don't risk your whole project for whatever excuses you come up with to fix things that are working fine.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;do NOT beautify existing code to your taste&lt;/b&gt;: you introduce more bugs while you are moving around codes, changing 4 spaces to 1 tab, breaking a line into multiple lines and so on. &amp;nbsp;Just make a note and fix it for your next game. &amp;nbsp;Also I should say that if there's some coding style you don't like, but it's everywhere in the codebase, the chance is that most people in your company agree with that coding style. Maybe you are from the Wild West, but 21st century is not the time for a &lt;a href="http://en.wikipedia.org/wiki/Cowboy_coding"&gt;cowboy programmer&lt;/a&gt; to shine.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;fix things that are not right to gamers(or testers), not to you&lt;/b&gt;: You found something that's mathematically wrong? Don't fix unless the end-users care about it. &amp;nbsp;Did you know even Photoshop is mathematically wrong? &amp;nbsp;Photoshop users don't care, and for the same reason gamers don't care about mathematical correctness. &amp;nbsp;Instead, this math change could impact your fellow contents producers. &amp;nbsp;"Hey, some math changed, so contents need to be changed too. &amp;nbsp;Do you have enough time to fix all the arts you've been producing for the last 2 years? What? No? But it's mathematically correct." &amp;nbsp;If you ever make this type of argument, you are being inconsiderate. &amp;nbsp;Noone cares about your own satisfaction for being a math-wiz.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;if you find something you think it must be fixed, talk to everyone who could be even remotely affected by this change&lt;/b&gt;: other people might have something more important things to fix. &amp;nbsp;If that's the case and your fix adds too much burden onto other co-workers, it's better not to fix your bug.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
I always thought whatever I wrote above is a common sense for any developer who shipped at least one game, especially on console. However, my belief has been proven wrong recently; for the last month, I was hit by numerous bugs produced by a self-claimed seasoned console game programmer and I had such privilege to investigate those bug to simply find out they had been caused by the missing shipping mindset of that programmer.&lt;br /&gt;
&lt;br /&gt;
Programmers, please be considerate and be responsible for your code at least once when you are finalling. &amp;nbsp;I seriously beg you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7711027831820077522-1080299830824260187?l=www.popekim.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/LaTBAg7WR5qTO_AzLjDcB4fyUao/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LaTBAg7WR5qTO_AzLjDcB4fyUao/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/LaTBAg7WR5qTO_AzLjDcB4fyUao/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LaTBAg7WR5qTO_AzLjDcB4fyUao/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Beo2Y0d6kp0:eAkB7AoQsyM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Beo2Y0d6kp0:eAkB7AoQsyM:63t7Ie-LG7Y"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=63t7Ie-LG7Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Beo2Y0d6kp0:eAkB7AoQsyM:4cEx4HpKnUU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=Beo2Y0d6kp0:eAkB7AoQsyM:4cEx4HpKnUU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Beo2Y0d6kp0:eAkB7AoQsyM:-BTjWOF_DHI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=Beo2Y0d6kp0:eAkB7AoQsyM:-BTjWOF_DHI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Beo2Y0d6kp0:eAkB7AoQsyM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=Beo2Y0d6kp0:eAkB7AoQsyM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Beo2Y0d6kp0:eAkB7AoQsyM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Beo2Y0d6kp0:eAkB7AoQsyM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=Beo2Y0d6kp0:eAkB7AoQsyM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Beo2Y0d6kp0:eAkB7AoQsyM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Beo2Y0d6kp0:eAkB7AoQsyM:l6gmwiTKsz0"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=l6gmwiTKsz0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Beo2Y0d6kp0:eAkB7AoQsyM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?i=Beo2Y0d6kp0:eAkB7AoQsyM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/BlindRenderer?a=Beo2Y0d6kp0:eAkB7AoQsyM:TzevzKxY174"&gt;&lt;img src="http://feeds.feedburner.com/~ff/BlindRenderer?d=TzevzKxY174" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/BlindRenderer/~4/Beo2Y0d6kp0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://www.popekim.com/feeds/1080299830824260187/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.popekim.com/2011/04/shipping-mindset_19.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/1080299830824260187?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/7711027831820077522/posts/default/1080299830824260187?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/BlindRenderer/~3/Beo2Y0d6kp0/shipping-mindset_19.html" title="Shipping Mindset" /><author><name>Pope</name><uri>http://www.blogger.com/profile/03943401839650233842</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="33" height="30" src="http://2.bp.blogspot.com/_BBDmHdyx8wo/SfTUvbwSs-I/AAAAAAAAAYk/P1yurbiaKZM/S220/650px-Triskele-hollow-triangle.svg.png" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-aX0el0OJ8Q0/Ta0UCW0ji6I/AAAAAAAAAgs/O6vxJyGVxN8/s72-c/cowboy_on_computer.gif" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://www.popekim.com/2011/04/shipping-mindset_19.html</feedburner:origLink></entry></feed>

