Sunday 31 October 2010

Loot


I've got plenty of loot queued up to review, just had a bit of a hiatus for a while. The SSD has had time to become part of the collective, but was a definite 'aha moment' for the technologist in me.

...And it went something like this. The shift between spending time and spending money - A Good HDD enclosure costs about two-thirds the price of an SSD drive, and then you have to buy the HDD too. The end result is that the SSD is cheaper, fast, quieter, lighter, and physically smaller than its magnetic uncle at the cost of lower storage capacity.

So on the subject of terrabytes, What needeth thou? You want some local storage, which is now a cache/buffer between me and the internet - the advantage of a cache being its close by and fast but capacity has increased faster than data rate such that a modern drive is 'slower' than ever. After my Level1, I've RAM, virtual RAM, local storage, NAS and then then internets with each layer getting more bloated, harder to search, slower and further away.

Anyway I'm here to talk about loot. The Latest loot being the SSD drive with nowhere to mount inside my case - which obviously means the next loot added to the basket will be a new case. Or two new cases, as the aha moment of storage was a mirror of my build philosophy which - of late - has been to put everything in a box and hope it boots. So I've found the excuse to talk about build strategy which only adds to the list of unblogged topics I want to pen and havn't gotten around to reviewinf the 64GB Crucial SSD that is lying forlornly on the bottom of my case suspended at one end by a power cable that has to navigate the passive cooler of an oversized video.

More about loot after I have sobered up. I really want some of those socks though. You know the ones? Yeah. Those Ones.






Monday 4 October 2010

Minecraft Rendering


So, Minecraft is getting great press. Whether it a flash-in-the-pan boom and bust economy or a slow builder is irrelevant at this time. The Minecraft Guy had a pretty good idea, implemented it and is getting the recognition he deserves.

Pulling apart the game, landscapes seem pretty important. Without being able to render a vast landscape the game wouldn’t be worth a fraction of what it is. So I’ve been pondering on what it takes to pull off such a techincal feat.

The world is made of blocks. About 1m each is a fair estimation for a sense of scale, and the visible world extends to about 192 units until you reach the far clip plane. The far clip plane can be reduced to about 128 units by adding fog which provide us the ‘Far’ and ‘Normal’ draw distances and it can be reduced further yet with Short and Tiny draw distances.

192 blocks radius is a 384x384 area containing a theoretical 384x384x384 blocks in the observable world reaching a staggering 56Million blocks to cull and render.

A broadphase pass that doesn’t even attempt to render air and creates a render list based on the occlusion of block using its six neighbours drops these unimaginable millions to a contemplatable two dimensional 384x384 ‘surface’ approaching 150,000 cubes at six quads each, still getting on for a million quads.

150,000 is a lot of cubes, and view frustrum culling with a <= 90’ field of view will reduce this to a ball-park of (192*192) 36864 Cubes and CPU side backface culling gives you a three quad per cube total of 110,000 Quads. Its a lot, to be sure, but its a managable amount compared to the 300Million+ Quads of the unculled estimate.

110,000 Quads feels like a lot, but might just be enough to brute force. At this point I’d probably still assume we are Render Bound so a sensible step would be to divide the task separate threads for Render, Occlusion, Game and Network and rely on the Host OS to manage four threads well enough.

A closer far clip plane and a 128 unit draw distance does reduce this to around 50,000 Quads and a 64 Unit draw distance reduces it further to a mere 12,000 Quads to render. The draw distance can probably be increased above 192 quite cheaply with a combination of untextured blocks, chunk sub-sampling and render proxies.