<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Max&#039;s Programming Blog</title>
	<atom:link href="http://www.m4x0r.com/blog/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.m4x0r.com/blog</link>
	<description></description>
	<lastBuildDate>Tue, 01 May 2012 10:46:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>Comment on Loose Grids by Basit @ PHP Tutorials</title>
		<link>http://www.m4x0r.com/blog/2012/03/loose-grids/comment-page-1/#comment-246</link>
		<dc:creator>Basit @ PHP Tutorials</dc:creator>
		<pubDate>Tue, 01 May 2012 10:46:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.m4x0r.com/blog/?p=574#comment-246</guid>
		<description>Very nice tutorial, It helps me alot. Thanks for writing for us :)</description>
		<content:encoded><![CDATA[<p>Very nice tutorial, It helps me alot. Thanks for writing for us <img src='http://www.m4x0r.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Loose Grids by Manuel Kugelmann</title>
		<link>http://www.m4x0r.com/blog/2012/03/loose-grids/comment-page-1/#comment-195</link>
		<dc:creator>Manuel Kugelmann</dc:creator>
		<pubDate>Wed, 07 Mar 2012 15:47:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.m4x0r.com/blog/?p=574#comment-195</guid>
		<description>Yeah, Spatial Hashing is very useful. Used this with good results for caching 3d (position) and 6d (position and direction) illumination data in a ray tracing experiment.
In fact you could see it as a variation of the row*col mapping of a regular grid to a 1d array. You are just using a different mapping function (which can have collisions in its mapping).</description>
		<content:encoded><![CDATA[<p>Yeah, Spatial Hashing is very useful. Used this with good results for caching 3d (position) and 6d (position and direction) illumination data in a ray tracing experiment.<br />
In fact you could see it as a variation of the row*col mapping of a regular grid to a 1d array. You are just using a different mapping function (which can have collisions in its mapping).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Loose Grids by Niklas Frykholm</title>
		<link>http://www.m4x0r.com/blog/2012/03/loose-grids/comment-page-1/#comment-193</link>
		<dc:creator>Niklas Frykholm</dc:creator>
		<pubDate>Wed, 07 Mar 2012 01:26:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.m4x0r.com/blog/?p=574#comment-193</guid>
		<description>A data structure I really like is a &quot;hash grid&quot;. It works as a grid or a loose grid but all the cells are stored in a flat array:

Cell cells[MAX_CELLS];

And to go from a position (x,y) to a cell index you do:

i = hash( floor(x/grid_size), floor(y/grid_size) )

I.e. you just hash the cell position to a value in the range 0..MAX_CELLS-1. Two nice things about this solution, is that it takes care of the problem with objects ending up &quot;outside&quot; the grid and that it decouples the number of cells from the grid size, so you can choose grid_size based on your object sizes, and MAX_CELLS based on the object count and the maximum objects you want to end up in the same cell.

With this solution you don&#039;t know that objects are in the same part of the grid just because they ended up in the same cell. They could be at different (x,y) coordinates that just happen to hash to the same cell index. So you must do an extra check for that. But typically you do such checks anyway (and just use the grid for &quot;broad phase&quot; culling).</description>
		<content:encoded><![CDATA[<p>A data structure I really like is a &#8220;hash grid&#8221;. It works as a grid or a loose grid but all the cells are stored in a flat array:</p>
<p>Cell cells[MAX_CELLS];</p>
<p>And to go from a position (x,y) to a cell index you do:</p>
<p>i = hash( floor(x/grid_size), floor(y/grid_size) )</p>
<p>I.e. you just hash the cell position to a value in the range 0..MAX_CELLS-1. Two nice things about this solution, is that it takes care of the problem with objects ending up &#8220;outside&#8221; the grid and that it decouples the number of cells from the grid size, so you can choose grid_size based on your object sizes, and MAX_CELLS based on the object count and the maximum objects you want to end up in the same cell.</p>
<p>With this solution you don&#8217;t know that objects are in the same part of the grid just because they ended up in the same cell. They could be at different (x,y) coordinates that just happen to hash to the same cell index. So you must do an extra check for that. But typically you do such checks anyway (and just use the grid for &#8220;broad phase&#8221; culling).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Blending Terrain Textures by 暗黑3渲染技术分析-地表 &#171; fseraph&#039;s space</title>
		<link>http://www.m4x0r.com/blog/2010/05/blending-terrain-textures/comment-page-1/#comment-170</link>
		<dc:creator>暗黑3渲染技术分析-地表 &#171; fseraph&#039;s space</dc:creator>
		<pubDate>Fri, 07 Oct 2011 01:01:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.m4x0r.com/blog/?p=24#comment-170</guid>
		<description>[...] 地表混合采用的也是比较传统的方法，这个图是从Titan的主程网站上取来用的，原文在这里：http://www.m4x0r.com/blog/2010/05/blending-terrain-textures/ [...]</description>
		<content:encoded><![CDATA[<p>[...] 地表混合采用的也是比较传统的方法，这个图是从Titan的主程网站上取来用的，原文在这里：http://www.m4x0r.com/blog/2010/05/blending-terrain-textures/ [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Specular Color in Light Pre-pass Renderer by Light Pre-Pass vs Deferred Renderer &#8211; Part 1 &#124; Gamedev Coder Diary</title>
		<link>http://www.m4x0r.com/blog/2010/05/specular-color-in-light-pre-pass-renderer/comment-page-1/#comment-159</link>
		<dc:creator>Light Pre-Pass vs Deferred Renderer &#8211; Part 1 &#124; Gamedev Coder Diary</dc:creator>
		<pubDate>Mon, 11 Apr 2011 11:04:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.m4x0r.com/blog/?p=116#comment-159</guid>
		<description>[...] only works correctly for a single light but it&#8217;s definitely better than nothing &#8211; see Max&#8217;s Programming Blog for a nice explanation of [...]</description>
		<content:encoded><![CDATA[<p>[...] only works correctly for a single light but it&#8217;s definitely better than nothing &#8211; see Max&#8217;s Programming Blog for a nice explanation of [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Error Checking with Dynamic Typing by Marek Sieradzki</title>
		<link>http://www.m4x0r.com/blog/2010/08/error-checking-with-dynamic-typing/comment-page-1/#comment-158</link>
		<dc:creator>Marek Sieradzki</dc:creator>
		<pubDate>Wed, 05 Jan 2011 21:15:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.m4x0r.com/blog/?p=291#comment-158</guid>
		<description>That&#039;s silly argument. C++ is not based on any theory and isn&#039;t the best statically-typed programming language there is. It&#039;s very easy to beat such primitive language. Try comparing it with Haskell/Agda. When writing functional code (you can write imperative one too) once code passes type check it&#039;s correct in 99% cases.

BTW allowing null by default is source of countless bugs.

Powerful type system can express what you have to do check in Lua using several unit tests. And when it comes to real unit tests I can write them where really needed. NS2 Scoreboard bug is nice example. :)

There was a vote on website/conference (I don&#039;t remember): which dynamic language do you like the most? Most people chose F# which in most cases doesn&#039;t require specifying types but is statically typed.</description>
		<content:encoded><![CDATA[<p>That&#8217;s silly argument. C++ is not based on any theory and isn&#8217;t the best statically-typed programming language there is. It&#8217;s very easy to beat such primitive language. Try comparing it with Haskell/Agda. When writing functional code (you can write imperative one too) once code passes type check it&#8217;s correct in 99% cases.</p>
<p>BTW allowing null by default is source of countless bugs.</p>
<p>Powerful type system can express what you have to do check in Lua using several unit tests. And when it comes to real unit tests I can write them where really needed. NS2 Scoreboard bug is nice example. <img src='http://www.m4x0r.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>There was a vote on website/conference (I don&#8217;t remember): which dynamic language do you like the most? Most people chose F# which in most cases doesn&#8217;t require specifying types but is statically typed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Eliminating Exporting in an Asset Pipeline by Peter Sedov</title>
		<link>http://www.m4x0r.com/blog/2010/05/eliminating-exporting-in-an-asset-pipeline/comment-page-1/#comment-156</link>
		<dc:creator>Peter Sedov</dc:creator>
		<pubDate>Thu, 30 Dec 2010 22:31:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.m4x0r.com/blog/?p=229#comment-156</guid>
		<description>&gt;during the “save” it would export the entire scene to the proprietary file format.

Did you mean &#039;intermediate format&#039;?

&gt;chance that you will be struck by lighting

You probably meant &#039;lightning&#039; (thunderbolt). Being struck by lighting (illumination) is really sad :).</description>
		<content:encoded><![CDATA[<p>&gt;during the “save” it would export the entire scene to the proprietary file format.</p>
<p>Did you mean &#8216;intermediate format&#8217;?</p>
<p>&gt;chance that you will be struck by lighting</p>
<p>You probably meant &#8216;lightning&#8217; (thunderbolt). Being struck by lighting (illumination) is really sad <img src='http://www.m4x0r.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Text pre-processing by Ari Timonen</title>
		<link>http://www.m4x0r.com/blog/2010/11/pre-processing/comment-page-1/#comment-130</link>
		<dc:creator>Ari Timonen</dc:creator>
		<pubDate>Sat, 20 Nov 2010 23:03:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.m4x0r.com/blog/?p=345#comment-130</guid>
		<description>Interesting, thanks Max.</description>
		<content:encoded><![CDATA[<p>Interesting, thanks Max.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Text pre-processing by Kevin Bjorke</title>
		<link>http://www.m4x0r.com/blog/2010/11/pre-processing/comment-page-1/#comment-126</link>
		<dc:creator>Kevin Bjorke</dc:creator>
		<pubDate>Thu, 18 Nov 2010 22:33:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.m4x0r.com/blog/?p=345#comment-126</guid>
		<description>I&#039;ve used the m4 pre-processor off and on for a long time -- it&#039;s usually part of stock linux/cygwin releases but almost no one knows it&#039;s there, much less how to use it. It has the features of a cpp-style processor but also recursion, loops, and functions.

At Square, I used it to generate lots of shader permutations so that if an artist needed varying numbers of resources like shadow maps, they could just get the right shader with a few clicks (and I only needed to write a single &quot;core&quot; file).

When I was at NVIDIA I was able to write shaders that could be re-emitted as DX9, DX10, CgFX, and bits of Cg (for translation into GLSL, which officially lacks an #include in its preprocessor). That was an extreme case, but you probably get my drift.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve used the m4 pre-processor off and on for a long time &#8212; it&#8217;s usually part of stock linux/cygwin releases but almost no one knows it&#8217;s there, much less how to use it. It has the features of a cpp-style processor but also recursion, loops, and functions.</p>
<p>At Square, I used it to generate lots of shader permutations so that if an artist needed varying numbers of resources like shadow maps, they could just get the right shader with a few clicks (and I only needed to write a single &#8220;core&#8221; file).</p>
<p>When I was at NVIDIA I was able to write shaders that could be re-emitted as DX9, DX10, CgFX, and bits of Cg (for translation into GLSL, which officially lacks an #include in its preprocessor). That was an extreme case, but you probably get my drift.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Text pre-processing by Mads</title>
		<link>http://www.m4x0r.com/blog/2010/11/pre-processing/comment-page-1/#comment-123</link>
		<dc:creator>Mads</dc:creator>
		<pubDate>Tue, 16 Nov 2010 02:30:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.m4x0r.com/blog/?p=345#comment-123</guid>
		<description>I am so stealing this ;)</description>
		<content:encoded><![CDATA[<p>I am so stealing this <img src='http://www.m4x0r.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

