<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8237926955425869206</id><updated>2012-02-03T12:50:12.903-08:00</updated><category term='C++'/><category term='Qt'/><category term='DirectX 10'/><category term='Reflection'/><category term='Windows Live Writer'/><category term='game industry'/><category term='Android'/><category term='Windows 7 Mobile'/><category term='Shadow Maps'/><category term='Deferred'/><category term='RTW'/><title type='text'>Procedurally Challenged: Downie's Blog</title><subtitle type='html'>Day to day ramblings of a frustrated programmer</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>53</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-554051029593857960</id><published>2011-06-22T12:42:00.000-07:00</published><updated>2011-06-22T12:42:32.133-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reflection'/><category scheme='http://www.blogger.com/atom/ns#' term='Qt'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Qt: Nokia's Best Since Snake</title><content type='html'>I took my first tentative steps into Qt this week at work. We are using it to (ironically) create a UI interface for our GUI designer. I have to say it has some really nice features and the IDE is pretty good to. The reflective stuff is really powerful (although it does make using it in anything except QtCreator a bit of a pain); and it is something I would really like to incorporate into our own engine. It adds features to C++ that you normally only get with C#, ObjC etc; such as linking functions to actions in the UI designer. The loose model of connecting slots (i.e. methods) with signals (i.e events) really helps to create modular code.&lt;br /&gt;&lt;br /&gt;Currently our engine uses run time hashing to generate RTTI information for objects (i.e. in a IsA fashion); however it would definetely benifit from doing that offline and would allow for more in depth RTTI (including accessing GUI objects from the tool as if they were objects in code). Also ourGUI designer tool generates an XML output that can be loaded at run-time, I might at some point use the Qt method of generating side by side code straight into C++.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-554051029593857960?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/554051029593857960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=554051029593857960' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/554051029593857960'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/554051029593857960'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2011/06/qt-nokias-best-since-snake.html' title='Qt: Nokia&apos;s Best Since Snake'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-7313453147461907739</id><published>2011-03-24T14:57:00.000-07:00</published><updated>2011-03-24T14:57:41.805-07:00</updated><title type='text'>Android - Setting the industry back 10 years</title><content type='html'>Has anyone else noticed that Android is actually J2ME in disguise? People keep saying that Android is the next big thing but actually it just the thing that everyone has. Everyone has a washing machine but I don't make games for that!&lt;br /&gt;&lt;br /&gt;You can't say the guys at Google haven't given us a sporting chance though. Either do the game in Java with (ironically as it's Java) a porting nightmare, not to mention performance that would make East Fife FC ashamed...or strap on your wellies and enter the dragon infested world of the NDK. We wanted to create a pipeline for rapid porting of iOS games to Android so we thought (somewhat naively) "hey the NDK is C++, that means it will just work! Won't it?". The short answer is no...no it won't. There is no native STL support and of the two main STL ports one supports wstring and one supports exceptions and apparently the two are mutually exclusive. Who would have thought it.&lt;br /&gt;&lt;br /&gt;Actually I exageratte, it is possible but I thought we had moved beyond the need for custom makefiles and hokey compilers that don't support full C++ and code that has to be compiled to a library to run...but I suppose anything is better than java. So once your cross-platform code compiles your good to go surely? All you need to do is swap out the iOS/PSP/DS backend and pop the Android one in. I mean the latest NDK supports native GL, audio, file management, activities, input; you don't actually need to interface with Java for anything! Except in true J2ME, sorry Android style only 2% of people have the latest firmware and the older NDK supports bugger all! Ahh Java you wiley fox I knew you would eat my lovely C++Chickens the moment my back was turned! Seriously though, how can an update thats been out for months not be on more devices. iOS 4.0 is now on 90% of devices so why not Android? Apparently there are more Android devices in the world than there are atoms in the sun. So why do so few have the latest release. I would have got away with it if it weren't for those meddlesome phone manufacturers...and those pesky network carriers too!&lt;br /&gt;&lt;br /&gt;So it's all gravy. We have our back end. The games ported and running. We have reduced the poly count on all our models so that everything looks like mashed potato. Just a quick compatability test then we are ready to launch! This is where Android really delivers. You see they have a very, very strict policy on hardware, particularly screen size. So you test on a G1 (and cry), and on a nexus and a droid and on an HTC. All good..."what's that Sony Ericsson? You want to make what? It's not really allowed but seeing as it's you...".&lt;br /&gt;&lt;br /&gt;Yep thats right a 240x320 device. Are you sure you aren't J2ME? Because by the time the games gone onto the Xperia mini it might aswell have been ported to the your wristwatch. Don't worry though...no-one will notice the lag or the bad graphics unless they are the hollow man! The only way to see the screen and actually play the game simultaneously is to rig an elaborate pully system to your 2 year old childs hands.&lt;br /&gt;&lt;br /&gt;Ahh the final stage - submission. No pesky TRC's here to trip you up. No dodgy provisioning files etc. Just pick a handful of stores or alternatively just post a helpful link on facebook and everyone will be able to steal (sorry buy) your game. But wait... "Oooh Amazon have a store. Amazon are nice...what's that? The version on amazon must be of the same quality as the highest end version of the app!" "Oh well that PS3 port is going to look interesting"&lt;br /&gt;&lt;br /&gt;To sum up, Android makes me cry. Unfortunately I seem to be in the minority. Ahh well... Google don't worry I still love your search engine and your mail.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-7313453147461907739?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/7313453147461907739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=7313453147461907739' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7313453147461907739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7313453147461907739'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2011/03/android-setting-industry-back-10-years.html' title='Android - Setting the industry back 10 years'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-6766708129533665010</id><published>2010-11-28T02:23:00.001-08:00</published><updated>2010-11-28T02:23:58.998-08:00</updated><title type='text'>OpenGL ES 2.0 - I can't quite put my finger on it</title><content type='html'>Finally got my first taste of OpenGL ES 2.0 and GLSL this week. I have to say it was bittersweet. I think mostly because it wasn't DirectX. I understand that splitting and compiling the shader program as multiple files means that vertex shaders can be re-used. I understand that having the shader files as text allows you to create shaders in code. I understand that enabling alpha, depth, etc outside the shader allows for hardware acceleration. However, it all just feels a bit meh. That's GL in a nutshell...meh. What with it's C API, stupid extensions and state system it just never felt as polished as say DX 10. &lt;br /&gt;&lt;br /&gt;That being said ES is a cute koala compared with the diseased rhino that is GL. &lt;br /&gt;&lt;br /&gt;This week I was converting my material system from 1.1 to 2.0. My material files allow for the render states to be set, lighting values, textures and the shader program. Another benefit of using separate VS and PS is that I can cache the two compiled files individually and also cache the combined shader program. Caching can be critical as Apple don't allow you to compile shaders offline.&lt;br /&gt;&lt;br /&gt;I didn't really know the best way to handle shader parameters. For instance a user applies a toon shader to one object and a water effect to another; how do you determine what values to pass to the shader? I could use the shader variable query on a host of pre-determined values but this seems a bit naive and the chances of it working for a developers custom shaders are 0.23%.&lt;br /&gt;&lt;br /&gt;I have decided this calls for more research...Ogre my old friend how do you do it?&lt;br /&gt;&lt;p class='blogpress_location'&gt;Location:&lt;a href='http://maps.google.com/maps?q=Bed&amp;z=10'&gt;Bed&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-6766708129533665010?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/6766708129533665010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=6766708129533665010' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/6766708129533665010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/6766708129533665010'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2010/11/opengl-es-20-i-can-quite-put-my-finger.html' title='OpenGL ES 2.0 - I can&amp;#39;t quite put my finger on it'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-6247164840658440266</id><published>2010-09-13T10:29:00.001-07:00</published><updated>2010-09-13T10:29:44.509-07:00</updated><title type='text'>U-turn if you want to…This lady’s not for turning</title><content type='html'>&lt;p&gt;In the biggest u-turn since Paul O’Grady re-joined ITV; Apple have decided to embrace 3rd party developer tools for their iDevices. This is good news for developers (not because of Flash) but as they will now be able to use engines without fear of rejection. I hope that Apple keep their word with regard to quality control; because as much as I disagree with Mr Jobs about Flash being crap it has pretty much blown the barrier to entry away. However, I hope they don’t reject Flash games out of hand. There are many good Flash games far superior to some of the fart apps currently on the AppStore.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;I wonder what has prompted this change of heart? Is it pressure from developers? Or is it the Android elephant in the room? One can only speculate…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-6247164840658440266?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/6247164840658440266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=6247164840658440266' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/6247164840658440266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/6247164840658440266'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2010/09/u-turn-if-you-want-tothis-ladys-not-for.html' title='U-turn if you want to…This lady’s not for turning'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-7838013860411631475</id><published>2010-09-05T12:21:00.000-07:00</published><updated>2010-09-05T12:21:24.352-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='game industry'/><category scheme='http://www.blogger.com/atom/ns#' term='RTW'/><title type='text'>Realtime Worlds - On the slab</title><content type='html'>What we do at Tag is a million miles from what happens at Realtime Worlds (even if our studio is only 5 mins away), but when it was announced that RTW was going into administration, most of us felt it was a huge blow. The Dundee games industry suffered a massive hit and it may well have changed the shape of the games industry in Scotland forever. Reading through a lot of the 'post-mortems' from ex RTW employees it seems most of them agree that RTW was a dinosaur. I don't believe we will ever see another company in Dundee that limits itself to AAA titles. Most of us have accepted that this is no longer the domain of indie companies and trying to play with the big boys in that market is almost impossible. Evolve or die. Gaming is no longer the domain of bedroom-bound, teenage boys. Why limit yourself when you have a direct route to a mass-market of social, hand-held and mobile gamers?&lt;br /&gt;&lt;br /&gt;For many the demise of RTW was inevitable but I for one am gutted that Scotland has lost one of it's few AAA studios. Really though it's the dinosaur I am lamenting. When I was at uni everyone wanted to work for RTW etc and make huge budget titles. Now many of us are never going to get the chance. Although mobile/social/DL has been the saviour of the industry in many respects; it saddens me that I won't be able to walk into Game, point at the #1 slot in the shelf and say "I made that".&lt;br /&gt;&lt;br /&gt;If you get a chance you should Google for some of the post-mortems. Scathing I think the term is...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-7838013860411631475?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/7838013860411631475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=7838013860411631475' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7838013860411631475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7838013860411631475'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2010/09/realtime-worlds-on-slab.html' title='Realtime Worlds - On the slab'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-7769973291612161886</id><published>2010-09-03T01:52:00.000-07:00</published><updated>2010-09-03T01:57:20.140-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Android'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7 Mobile'/><title type='text'>Guess It's been a while</title><content type='html'>It's been ages since my last post, due to work commitments and my lack of internet. However I thought I'd mark my return by saying how awesome the Epic Citadel tech demo is on iDevices. It makes me yearn for some shader action!&lt;br /&gt;&lt;br /&gt;I've been spending a great deal of time trying to get a usuable GL framework up and running on Android. Android is really beginning to piss me off. I appreciate that Java is portable Google, but can we at least have a decent JIT compiler! My motto has always been "real men manage their own memory".&lt;br /&gt;&lt;br /&gt;Lots of developers seem to be disgruntled at the lack return for investment with Android apps. It's hardly worth the time. But that's what you get when you make an open source platform: 70% of apps of the Android Market are free! No wonder it's impossible to make any money. Unless you have tech that allows you to easily port from iDevices to Android, it is going to be difficult to make any money.&lt;br /&gt;&lt;br /&gt;Shame though cos Google have managed to cut out alot of the hassle associated with developing for iDevices.&lt;br /&gt;&lt;br /&gt;Did manage to have a wee shot of Windows 7 Mobile development this week. It is not much different than XNA; and I have to say I'm impressed by my initial experience. Everything came in the one package, no need to find an IDE, get the SDK and drivers etc. Fingers crossed that Windows 7 Mobile takes off.&lt;br /&gt;&lt;br /&gt;Oh I'm also on Twitter you can follow me as Rev_Downie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-7769973291612161886?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/7769973291612161886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=7769973291612161886' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7769973291612161886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7769973291612161886'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2010/09/guess-its-been-while.html' title='Guess It&apos;s been a while'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-9198518813623462860</id><published>2010-02-16T15:26:00.001-08:00</published><updated>2010-02-22T12:33:08.698-08:00</updated><title type='text'>Astro Ranch – A Long Time Coming…</title><content type='html'>&lt;p&gt;The culmination of a lot of hard work and even more takeaways! Anyone who has an iPhone or iTouch get it! It’s addictive! &lt;/p&gt;  &lt;p&gt;More than a farming game; it has fishing an gold panning mini games, plus quests and social features!&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:2a82b957-e40b-4047-8f6b-af0d21ae2bb3" class="wlWriterEditableSmartContent"&gt;&lt;div id="06543d79-1700-4c99-8514-33b5ed111460" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=n3zaAyvXcYQ&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;" target="_new"&gt;&lt;img src="http://lh5.ggpht.com/__KyV2yFdVEk/S4Lp_Hj216I/AAAAAAAAAKA/Z8IVmr5zghM/video5e3bcfd73016%5B2%5D.jpg?imgmax=800" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('06543d79-1700-4c99-8514-33b5ed111460'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/n3zaAyvXcYQ&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/n3zaAyvXcYQ&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;Plus the into movie!&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:9f7b79e3-b127-4061-815b-a9a54e472b90" class="wlWriterEditableSmartContent"&gt;&lt;div id="0e731525-a6e6-4ee3-a4b9-88d0b210082c" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=Fy-xmkragYE&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;" target="_new"&gt;&lt;img src="http://lh6.ggpht.com/__KyV2yFdVEk/S3splC7Ci4I/AAAAAAAAAKE/NQKVzWKVKxk/video4eb53ad07acb%5B2%5D.jpg?imgmax=800" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('0e731525-a6e6-4ee3-a4b9-88d0b210082c'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/Fy-xmkragYE&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/Fy-xmkragYE&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;Not the most exciting trailer lol…&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:9d5120b4-e5f7-4e5b-9316-7293da1e4d94" class="wlWriterEditableSmartContent"&gt;&lt;div id="fdaf61ec-ba87-49ce-826e-c34b1b394a6f" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=DGFINCqSVi0&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;hd=1" target="_new"&gt;&lt;img src="http://lh6.ggpht.com/__KyV2yFdVEk/S4LqAv919WI/AAAAAAAAAKM/vD3hsrDJuCU/video0aa4459fb38b%5B3%5D.jpg?imgmax=800" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('fdaf61ec-ba87-49ce-826e-c34b1b394a6f'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/DGFINCqSVi0&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;hd=1&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/DGFINCqSVi0&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;hd=1&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt=""&gt;&lt;/a&gt;&lt;/div&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/8237926955425869206-9198518813623462860?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/9198518813623462860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=9198518813623462860' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/9198518813623462860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/9198518813623462860'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2010/02/astro-ranch-long-time-coming.html' title='Astro Ranch – A Long Time Coming…'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/__KyV2yFdVEk/S4Lp_Hj216I/AAAAAAAAAKA/Z8IVmr5zghM/s72-c/video5e3bcfd73016%5B2%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-4060810035947326118</id><published>2009-11-15T14:25:00.001-08:00</published><updated>2009-11-15T14:25:29.917-08:00</updated><title type='text'>Unity…It’s Unreal</title><content type='html'>&lt;p&gt;Like buses, two great game development engines have come along at once. So this week I’ve been playing around with both of them to see which is better and, to be honest; I’m unsure. &lt;/p&gt;  &lt;p&gt;I find that Unity is much simpler to use with a better interface. It is easier to attach scripts to objects and to create terrain. It’s a bonus that the scripting languages are Javascript and C# compared to Unreal script. However UDK has more features and a lot more built-in assets; which is great for coders like me : ), yet means that everythiing looks like an Unreal tournament rip-off.&lt;/p&gt;  &lt;p&gt;I can’t get over the sense of cheating though. With both engines I created a terrain, clicked play and before I knew it I had a physics controller running around screen, interacting with the environment. With Unreal you even get a frontend menu and a FPS character with a gun! Makes my terrain generator seem sadly pointless…&lt;/p&gt;  &lt;p&gt;Anywhere here’s a clip of a destructible wall I made in UDK. Make up your own mind.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:7f594a56-4e43-4c63-ae0d-05163c2400ec" class="wlWriterEditableSmartContent"&gt;&lt;div id="2d8d9ffe-4291-4493-84ce-7cd4b83f021b" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=OIi6_kqKWPQ&amp;amp;feature=youtube_gdata" target="_new"&gt;&lt;img src="http://lh4.ggpht.com/__KyV2yFdVEk/SwB_2Rk-YBI/AAAAAAAAAJ0/g8oRiuyosbI/video1372a481c886%5B2%5D.jpg?imgmax=800" style="border-style: none" galleryimg="no" onload="var downlevelDiv = document.getElementById('2d8d9ffe-4291-4493-84ce-7cd4b83f021b'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/OIi6_kqKWPQ&amp;amp;hl=en\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/OIi6_kqKWPQ&amp;amp;hl=en\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt=""&gt;&lt;/a&gt;&lt;/div&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/8237926955425869206-4060810035947326118?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/4060810035947326118/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=4060810035947326118' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/4060810035947326118'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/4060810035947326118'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/11/unityits-unreal.html' title='Unity…It’s Unreal'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/__KyV2yFdVEk/SwB_2Rk-YBI/AAAAAAAAAJ0/g8oRiuyosbI/s72-c/video1372a481c886%5B2%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-7357209606019071342</id><published>2009-10-25T15:12:00.001-07:00</published><updated>2009-10-25T15:12:18.397-07:00</updated><title type='text'>Delegates Hurt My Face</title><content type='html'>&lt;p&gt;Now that I’m a fully fledged iPhone developer I finally decided to get my head round delegates as they seem to be the cock and balls of iPhone programming. Coming from a largely C++ background I wrongly assumed that delegates were just callbacks in a silly mac outfit. Apparently I was wrong. So I thought I’d post a an article about delegates (as much for me as) for anyone else struggling to come to terms with them.&lt;/p&gt;  &lt;p&gt;As the name suggests, delegates are a way of offloading work to another object. The best way to demonstrate this is with an example. Say an application for the iPhone has a class/library that handles user events; such as button presses. These events will register for any application but will mean different things to different objects. The user class will register the button event and delegate the functionality to a different class. Think of them like helper functions to the main interface. This class will interpret the button press and perform some action (perhaps playing a song etc).&lt;/p&gt;  &lt;p&gt;Here’s some ObjC code that sets up a simple delegate (Not on a mac at the moment so have to use GNUStep and ObjC 1.0 therefore not tested:&lt;/p&gt;  &lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 408px; padding-right: 5px; height: 385px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;//======================================&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;// Delegate Test&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;//&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;// Understanding the functionality and &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;// use of Objective C delegates.&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;//======================================&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;#&lt;span style="color: #0000ff"&gt;import&lt;/span&gt; &amp;lt;stdio.h&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;#&lt;span style="color: #0000ff"&gt;import&lt;/span&gt; &amp;lt;Foundation/NSObject.h&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;//--------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;// Test Class - Main Delegate&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;//&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;// Implements based on events received&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;// from main controller.&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;//--------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;@&lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; MainDelegate : NSObject&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;blockquote style="margin-right: 0px" dir="ltr"&gt;&lt;p&gt;//No Members&lt;/p&gt;&lt;/blockquote&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;-(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;) onButtonPress;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;-(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;) onAddToList;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;@end&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;@implementation MainDelegate&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;-(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;) onButtonPress&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	printf(&amp;quot;&lt;span style="color: #8b0000"&gt;Do Button Stuff\n&lt;/span&gt;&amp;quot;);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;-(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;) onAddToList&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	printf(&amp;quot;&lt;span style="color: #8b0000"&gt;Do Stuff With New List Object\n&lt;/span&gt;&amp;quot;);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;@end&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;//--------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;// Test Class - Main Controller&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;//&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;// This class will act as the main&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;// controller which will invoke the&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;// delegate class.&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;//--------------------------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;@&lt;span style="color: #0000ff"&gt;class&lt;/span&gt; AppController;  &lt;span style="color: #008000"&gt;//Forward Declaration&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #008000"&gt;//Register the delegate methods with this class&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;@protocol OurDelegate&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;@required	&lt;span style="color: #008000"&gt;//These delegate method must exist (if you use opitonal then we must check they exist first)&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;-(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;) onButtonPress;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;-(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;) onAddToList;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;@end&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;@&lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; AppController : NSObject&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	id &amp;lt;OurDelegate&amp;gt; mpDelegate;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;-(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;) ButtonPress;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;-(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;) AddToList;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;@property (nonatomic, assign) id &amp;lt;OurDelegate&amp;gt; mpDelegate; &lt;span style="color: #008000"&gt;//Don't Retain the delegate it doesn't belong to us&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;@end&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;@implementation AppController&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;@synthesize mpDelegate;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;-(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;) ButtonPress&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	printf(&amp;quot;&lt;span style="color: #8b0000"&gt;EVENT - Button Pressed\n&lt;/span&gt;&amp;quot;);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	[[&lt;span style="color: #0000ff"&gt;self&lt;/span&gt; mpDelegate] onButtonPress];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;-(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;) AddToList&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	printf(&amp;quot;&lt;span style="color: #8b0000"&gt;EVENT - Add To List\n&lt;/span&gt;&amp;quot;);&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	[[&lt;span style="color: #0000ff"&gt;self&lt;/span&gt; mpDelegate] onAddToList];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;@end&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; main()&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;{&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	&lt;span style="color: #008000"&gt;//Create an instance of our delagatee that (skeleton) handles events&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	AppController* pMainCtrl = [AppController alloc];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	&lt;span style="color: #008000"&gt;//Now create our delegate that actually interprets events and fires some code&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	MainDelegate* pDelegate = [MainDelegate alloc];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	&lt;span style="color: #008000"&gt;//Set the delegate&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	pMainCtrl.mpDelegate = pDelegate;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	&lt;span style="color: #008000"&gt;//Fake a button press&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	[pMainCtrl ButtonPress];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	&lt;span style="color: #008000"&gt;//Fake another function call&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	[pMainCtrl AddToList];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	&lt;span style="color: #008000"&gt;//Free up memory&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	[pMainCtrl release];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	pMainCtrl = nil;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;	&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; 0;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px"&gt;&lt;/pre&gt;&lt;/pre&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-7357209606019071342?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/7357209606019071342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=7357209606019071342' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7357209606019071342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7357209606019071342'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/10/delegates-hurt-my-face.html' title='Delegates Hurt My Face'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-6445060362575863322</id><published>2009-10-08T15:01:00.001-07:00</published><updated>2009-10-08T15:02:06.330-07:00</updated><title type='text'>Enter Tag</title><content type='html'>&lt;p&gt;Started at tag-games this morning for my first day in the games industry! Went pretty well I now have a company e-mail address which is awesome. Now its about coming to terms with the iPhone and Macs. Lovely…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/__KyV2yFdVEk/Ss5hH78-eTI/AAAAAAAAAJk/nd4joKzIE9M/s1600-h/TagGames_logo_160x160%5B2%5D.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="TagGames_logo_160x160" border="0" alt="TagGames_logo_160x160" src="http://lh3.ggpht.com/__KyV2yFdVEk/Ss5hIwO9G3I/AAAAAAAAAJo/hrjSUkxqw68/TagGames_logo_160x160_thumb.jpg?imgmax=800" width="164" height="164" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/__KyV2yFdVEk/Ss5hJsLU0xI/AAAAAAAAAJs/Fg6eWWc5aIY/s1600-h/carjackstreets.jpg"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="carjackstreets" border="0" alt="carjackstreets" src="http://lh5.ggpht.com/__KyV2yFdVEk/Ss5hJ6yrZmI/AAAAAAAAAJw/Jg5l0bfrH2A/carjackstreets_thumb.jpg?imgmax=800" width="244" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I guess the demo work will be on hold for a while but I’ll get back to it soon.&amp;#160; &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-6445060362575863322?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/6445060362575863322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=6445060362575863322' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/6445060362575863322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/6445060362575863322'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/10/enter-tag.html' title='Enter Tag'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/__KyV2yFdVEk/Ss5hIwO9G3I/AAAAAAAAAJo/hrjSUkxqw68/s72-c/TagGames_logo_160x160_thumb.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-2283747580595975159</id><published>2009-09-27T16:08:00.001-07:00</published><updated>2009-09-27T16:08:47.123-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Deferred'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Live Writer'/><category scheme='http://www.blogger.com/atom/ns#' term='DirectX 10'/><category scheme='http://www.blogger.com/atom/ns#' term='Shadow Maps'/><title type='text'>Deferred Shadow Maps</title><content type='html'>&lt;p&gt;Now that I have my deferred renderer up and running I thought I would add shadow mapping to the framework as they seem to go hand in hand. However when I got down to implementing them I didn’t really know where to start. Obviously with standard shadow mapping techniques you do one pass to obtain the scene depth from the light source and then the second pass calculates the occlusion factor. &lt;/p&gt;  &lt;p&gt;However I had some weird notion that with deferred shading I wouldn’t need&amp;#160; to render the geometry twice (or it seems to me&amp;#160; that should be the case). Yet I saw a couple of articles that are titled &lt;em&gt;deferred shadow maps &lt;/em&gt;that actually perform the depth calculation in a separate shader and render to a separate depth buffer. What’s different about that?&amp;#160; Surely both depths could be obtained at the same time at very least and save two geometry passes? However this would mean calculating and storing the light depth in the G-Buffer along with the Z-depth. The problem is that the render target for the Z-depth is a 128-bit single; this means that the light depth would also require a 128-bit buffer. I wonder if both depth buffers need to be so precise and that way the two depth maps could be stored in a single buffer. I’ll try a bit more research failing that I’ll give it a bash and see what happens. After this I think I might leave this lighting side of graphics for a while and think about doing some volumetric data stuff…or I might finally get round to doing light scattering rendering my last null and void.&lt;/p&gt;  &lt;p&gt;On the plus side I discovered the beauty of &lt;em&gt;Windows Live Writer&lt;/em&gt;! It’s pretty ace and the plug-ins are the cats pyjamas; hence the new found source tags. I shall no longer need to arse around with &lt;em&gt;google docs&lt;/em&gt; to get source code up as I can link straight to &lt;em&gt;Skydrive&lt;/em&gt; or automatically add solutions or binaries as downloads. Why has nobody told me!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-2283747580595975159?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/2283747580595975159/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=2283747580595975159' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/2283747580595975159'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/2283747580595975159'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/09/deferred-shadow-maps.html' title='Deferred Shadow Maps'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-6959873356729494242</id><published>2009-09-25T08:27:00.000-07:00</published><updated>2009-09-27T16:09:46.767-07:00</updated><title type='text'>Deferred Shading</title><content type='html'>I've got the bare bones of my deferred shading framework up and running. At the moment the world-space normals, linear depth, diffuse colour and specular value are output to the G-Buffer in 128-bit targets (maybe a bit much but I'm only testing). Using this data the directional lighting, point lighting and SSAO can be calculated in screen space as a post process then combined to create the final scene. It was actually really easy to set-up and I love the way that SSAO&amp;nbsp; integrates. Obviously one of the advantages of deferred lighting is that it is easier to manage multiple lights and this is independent of scene complexity. However I can't get my multiple lights to work yet. In a similar way to the SSAO and Shadow Maps; the lighting shaders render a light map to a separate render target (i.e. a render target for point and one for directional (stupid set-up at the moment ideally these will become one light map)). However the way I am trying to accomplish multiple light sources is by rendering to a target then performing multiple passes of the light shader additively blending the fullscreen quads; before I reset rendering to the frame-buffer.   &lt;br /&gt;&lt;br /&gt;&lt;pre style="background-color: #fbfbfb; border: 1px solid rgb(206, 206, 206); height: 211px; min-height: 40px; overflow: auto; padding: 5px; width: 410px;"&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;1:     &lt;span style="color: green;"&gt;//Create the point light map&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;2:     mPointLightFX.BeginRenderToLightMap();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;3: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;4:     &lt;span style="color: green;"&gt;//Initialise Light 1 - Blue&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;5:     mPointLightFX.SetLightCol(D3DXVECTOR3(0.0f, 0.0f, 1.0f));&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;6:     mPointLightFX.SetLightPos(D3DXVECTOR3(0.0f, 100.0f, 20.0f));&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;7:     mPointLightFX.RenderFullscreenQuad();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;8: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;9:     &lt;span style="color: green;"&gt;//Initialise Light 2 - Red&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;10:     mPointLightFX.SetLightCol(D3DXVECTOR3(1.0f, 0.0f, 0.0f));&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;11:     mPointLightFX.SetLightPos(D3DXVECTOR3(20.0f, 100.0f, 0.0f));&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;12:     mPointLightFX.RenderFullscreenQuad();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;13: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;14:     mPointLightFX.EndRenderToLightMap();&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;15: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;16:     &lt;span style="color: green;"&gt;//Reset Rendering Back to the Frame-Buffer&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; font-family: consolas,'Courier New',courier,monospace; font-size: 10px; margin: 0em; width: 100%;"&gt;17:     ResetRenderTargets(); &lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This results in only the final light being rendered but I'll keep plugging away. &lt;br /&gt;&lt;br /&gt;EDIT –Solved &lt;br /&gt;&lt;br /&gt;Stupid, stupid b*&amp;amp;@£rd. Forgot to update the shader variables after I reset the light colour. So the blending works fine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-6959873356729494242?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/6959873356729494242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=6959873356729494242' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/6959873356729494242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/6959873356729494242'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/09/deferred-shading.html' title='Deferred Shading'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-5017095506025398296</id><published>2009-09-14T16:57:00.000-07:00</published><updated>2009-09-14T17:06:54.723-07:00</updated><title type='text'>Screen-Space Ambient Cel Shading</title><content type='html'>Well I finally got round to doing my SSAO shader. Had a bit of trouble initially with some of the documentation as it wasn't always clear what space things should be done in. For instance the normals should be in view space but I had them in world space. Unfortunately this resulted in my SSAO looking like the toon shader it set out not to be...&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/__KyV2yFdVEk/Sq7ZKU7eDsI/AAAAAAAAAIQ/2HK1vOJqiDA/s1600-h/ScreenShot005.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 164px;" src="http://4.bp.blogspot.com/__KyV2yFdVEk/Sq7ZKU7eDsI/AAAAAAAAAIQ/2HK1vOJqiDA/s320/ScreenShot005.jpg" alt="" id="BLOGGER_PHOTO_ID_5381477376194383554" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/__KyV2yFdVEk/Sq7ZUHRYvXI/AAAAAAAAAIg/YnRQlvVwVqc/s1600-h/ScreenShot022.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://1.bp.blogspot.com/__KyV2yFdVEk/Sq7ZUHRYvXI/AAAAAAAAAIg/YnRQlvVwVqc/s320/ScreenShot022.jpg" alt="" id="BLOGGER_PHOTO_ID_5381477544326905202" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/__KyV2yFdVEk/Sq7ZOcVHr7I/AAAAAAAAAIY/y3Z8B5aal9I/s1600-h/ScreenShot011.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 200px;" src="http://1.bp.blogspot.com/__KyV2yFdVEk/Sq7ZOcVHr7I/AAAAAAAAAIY/y3Z8B5aal9I/s320/ScreenShot011.jpg" alt="" id="BLOGGER_PHOTO_ID_5381477446900494258" border="0" /&gt;&lt;/a&gt;The effects were pretty cool and really simple to add as it is just  matter of finding the dot product between the sampled normal and the world space normal of the pixel; and multiplying this difference into the final occlusion. Once I realised my space mistake, it was just a matter of tweaking the radius of the hemisphere and the contrast etc in order to get the desired result. The final shader is still not quite there yet (I have a post of it on my codefolio); but I'll keep adjusting it till I'm happy....then deferred shading!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-5017095506025398296?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/5017095506025398296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=5017095506025398296' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/5017095506025398296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/5017095506025398296'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/09/screen-space-ambient-cel-shading.html' title='Screen-Space Ambient Cel Shading'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/__KyV2yFdVEk/Sq7ZKU7eDsI/AAAAAAAAAIQ/2HK1vOJqiDA/s72-c/ScreenShot005.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-3993998928177674584</id><published>2009-09-10T08:31:00.000-07:00</published><updated>2009-09-12T06:17:30.184-07:00</updated><title type='text'>Oh Pretty</title><content type='html'>Decided to add another couple of pieces to my portfolio this week, so I thought I would look at a couple of graphics techniques I never got round to using at uni. Firstly I implemented &lt;span style="font-style: italic;"&gt;Parallax Occlusion Mapping&lt;/span&gt;. It actually wasn't to bad to code, the fact that it only requires one pass made it alot easier. I did only use the linear interpolated technique but I'll probably get round to adding the Nvidia cone stepping method. The results are pretty nice so I am more than happy with that.&lt;br /&gt;&lt;br /&gt;The other technique I am in the process of implementing is &lt;span style="font-style: italic;"&gt;Screen-Space Ambient Occlusion.&lt;/span&gt; I already know a fair whack about AO, enough to know that the Nvida SSAO method is comparitively slow; but there is alot of documentation about it etc. Normal map, depth map...blah...blah. Looking through GameDev etc it seems alot of people use AO algorithms that act more like edge detection, almost like a cel shader, so I hope to avoid doing that. Anyhow I'll cut to the chase I wanted to load a high poly model in (stanford dragon cliche) but until now I have only been working with my own DX10 model loader not .x. I love DX10 but the lack of model loader is balls! So I thought I would just use DXUT but the bloody thing needs to be compiled in unicode. This means I have to go through my framework changing all the bloody strings! Plus the documentation on the MSDN website is wrong! There is no CDXUTMesh10 but there is a CDXUTSDKMesh that only loads .sdkmesh files.&lt;br /&gt;&lt;br /&gt;Seriously I wish Microsoft would provide a .x mesh loader. I know a lot of studios use their own formats but for us without the benefit of a dev team and in-house libraries .x meshes are staple DirectX. All my DX9 projects use .x meshes and now I have to use DXUT! It feels almost dirty; like using GLUT instead of plain OpenGL...&lt;br /&gt;&lt;br /&gt;EDIT:&lt;br /&gt;DXUT for the win. (I'll post the HLSL code on my portfolio when finished)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-3993998928177674584?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/3993998928177674584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=3993998928177674584' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/3993998928177674584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/3993998928177674584'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/09/oh-pretty.html' title='Oh Pretty'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-1590235710424206558</id><published>2009-09-07T03:51:00.000-07:00</published><updated>2009-09-27T15:25:18.528-07:00</updated><title type='text'>A New Objective</title><content type='html'>The interview at Rockstar was pretty awful; I panicked and absolutely bombed the programming test. Anyhow...I had another interview at Tag Games last week that I am more hopeful about. Therefore in anticipation that I might be offered the job I am looking at Objective C. Unfortunately (wait) fortunately I don't own a Mac, so I had to download GNUstep so I could use the gcc compiler for Windows. Compiling is no bother once you create a makefile that links the global libraries.  &lt;br /&gt;  &lt;br /&gt;&lt;span style="font-weight: bold"&gt;File: GNUmakefile&lt;/span&gt;  &lt;br /&gt;  &lt;br /&gt;&lt;span style="font-style: italic"&gt;include $(GNUSTEP_MAKEFILES)/common.make&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-style: italic"&gt;TOOL_NAME = &lt;span style="font-weight: bold"&gt;ToolName&lt;/span&gt;&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-style: italic"&gt;&lt;span style="font-weight: bold"&gt;ToolName&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic"&gt;_OBJC_FILES = &lt;span style="font-weight: bold"&gt;Source&lt;/span&gt;.m&lt;/span&gt;  &lt;br /&gt;&lt;span style="font-style: italic"&gt;include $(GNUSTEP_MAKEFILES)/tool.make&lt;/span&gt;  &lt;br /&gt;  &lt;br /&gt;I know a few people who use Objective C and I don't know anyone who likes it. Its kind of a bastardized version of C and SmallTalk. Personally if I was developing for the iPhone I would have a Objective C wrapper and do all the coding in C++.  &lt;br /&gt;  &lt;br /&gt;&lt;span style="font-weight: bold"&gt;Classes:&lt;/span&gt;  &lt;br /&gt;  &lt;br /&gt;Class definitions are slightly different that C++ but are ok. However the way methods are declared is erm not for me. Multiple parameters, for instance, is really unintuitive if your used to C or Java. Default access is protected instead of private. Oh and you use #import instead of #include. This has the benefit of only compiling the file once (like #pragma once or #ifndef etc). Some other quirks before we move on, &lt;span style="font-weight: bold"&gt;bool &lt;/span&gt;is yes or no, &lt;span style="font-weight: bold"&gt;self &lt;/span&gt;is like this, &lt;span style="font-weight: bold"&gt;nil&lt;/span&gt; is null, everything is a pointer, files are declared &lt;span style="font-weight: bold"&gt;.m&lt;/span&gt; and '&lt;span style="font-weight: bold"&gt;+&lt;/span&gt;' indicates a class method like +alloc, wheras a &lt;span style="font-weight: bold"&gt;'-&lt;/span&gt;' indicates an instance method like -(void) print.  &lt;br /&gt;  &lt;pre style="border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 414px; padding-right: 5px; height: 201px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px"&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  1: &lt;span style="color: #008000"&gt;//----------------------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  2: &lt;span style="color: #008000"&gt;// Definition&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  3: &lt;span style="color: #008000"&gt;//----------------------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  4: #import&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  5: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  6: @interface CMyClass : CBase &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  7: {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  8: @&lt;span style="color: #0000ff"&gt;private&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt;  9: &lt;span style="color: #0000ff"&gt;float&lt;/span&gt; mfFloat1;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 10: &lt;span style="color: #0000ff"&gt;float&lt;/span&gt; mfFloat2;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 11: &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; mInt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 12: }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 13: &lt;span style="color: #008000"&gt;//Constructor&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 14: -(CMyClass *) InitWithInt : (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;) dInt; &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 15: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 16: &lt;span style="color: #008000"&gt;//Declare methods outside the braces&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 17: -(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;) SetInt : (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;) fInt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 18: -(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;) SetFloat1 : (&lt;span style="color: #0000ff"&gt;float&lt;/span&gt;) fFloat1 SetFloat2 : (&lt;span style="color: #0000ff"&gt;float&lt;/span&gt;) fFloat2;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 19: -(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;) GetInt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 20: -(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;) Print;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 21: @end&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 22: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 23: &lt;span style="color: #008000"&gt;//----------------------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 24: &lt;span style="color: #008000"&gt;// Declaration&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 25: &lt;span style="color: #008000"&gt;//----------------------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 26: @implementation CMyClass&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 27: &lt;span style="color: #008000"&gt;//---------------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 28: &lt;span style="color: #008000"&gt;// Constructor&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 29: &lt;span style="color: #008000"&gt;//---------------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 30: -(CMyClass*) InitWithInt : (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;) dInt&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 31: {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 32: &lt;span style="color: #008000"&gt;//Self is a bit like this&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 33: &lt;span style="color: #008000"&gt;//init is like a default constructor&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 34: &lt;span style="color: #008000"&gt;//super accesses the base constructor for inheritance.&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 35: self = [super init];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 36: &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(self)&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 37: {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 38: [self SetInt : dInt];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 39: }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 40: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 41: &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; self; &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 42: }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 43: &lt;span style="color: #008000"&gt;//----------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 44: &lt;span style="color: #008000"&gt;// Set Int&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 45: &lt;span style="color: #008000"&gt;//----------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 46: -(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;) SetInt : (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;) dInt&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 47: {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 48: mInt = dInt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 49: }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 50: &lt;span style="color: #008000"&gt;//-----------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 51: &lt;span style="color: #008000"&gt;// Set Float1 and Float2&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 52: &lt;span style="color: #008000"&gt;//-----------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 53: -(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;) SetFloat1 : (&lt;span style="color: #0000ff"&gt;float&lt;/span&gt;) fFloat1 SetFloat2 : (&lt;span style="color: #0000ff"&gt;float&lt;/span&gt;) fFloat2&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 54: {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 55: mfFloat1 = fFloat1;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 56: mfFloat2 = fFloat2;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 57: }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 58: &lt;span style="color: #008000"&gt;//-----------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 59: &lt;span style="color: #008000"&gt;// Get Int&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 60: &lt;span style="color: #008000"&gt;//-----------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 61: -(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;) GetInt&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 62: {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 63: &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; mInt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 64: }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 65: &lt;span style="color: #008000"&gt;//-----------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 66: &lt;span style="color: #008000"&gt;// Print&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 67: &lt;span style="color: #008000"&gt;//-----------------------&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 68: -(&lt;span style="color: #0000ff"&gt;void&lt;/span&gt;) Print&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 69: {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 70: printf(%d, %f, %f \n&amp;quot;&lt;span style="color: #8b0000"&gt;, mInt, mfFloat1, mffloat2);&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 71: }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 72: @end&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 73: &lt;span style="color: #008000"&gt;//=============================================&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 74: &lt;span style="color: #008000"&gt;// Main&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 75: &lt;span style="color: #008000"&gt;//=============================================&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 76: &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; main() &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 77: {&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 78: &lt;span style="color: #008000"&gt;//Allocate memory for class then construct it using init &lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 79: CMyClass* pInst1 = [[CMyClass alloc]init];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 80: &lt;span style="color: #008000"&gt;//Allocate memory but construct with our new constructor&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 81: CMyClass* pInst2 = [[CMyClassalloc] InitWithInt : 1];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 82: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 83: &lt;span style="color: #008000"&gt;//Call methods&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 84: [pInst1 SetInt : 5];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 85: [pInst1 SetFloat1 : 1.0f SetFloat2 : 2.0f];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 86: [pInst1 Print];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 87: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 88: [pInst2 SetFloat1 : 1.0f SetFloat2 : 2.0f];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 89: [pInst2 Print];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 90: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 91: &lt;span style="color: #008000"&gt;//Free class memory&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 92: [pInst1 release];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 93: [pInst2 release];&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 94: &lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 95: &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; 0;&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 96: }&lt;br /&gt;&lt;/pre&gt;&lt;pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 10px"&gt; 97: &lt;/pre&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This simple class has some accessors and a print method. The SetFloat method takes two arguments; fFloat1 and fFloat2; it just looks weird. Objective C works as everything is a message. In order for classes to handle each others messages most of them inherit from NSObject class. The benefits of objective C are that it is dynamically typed using the id keyword (almost like a void*). Also classes can be loaded only at runtime when required which lowers memory costs; more suited to the iPhone etc.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The language has other strangeness like categories and posing, yet as it is a subset of C it does not allow multiple inheritance but ultimately who cares. Really if it wasn't for the bloody iPhone and Apple's insistence on bringing back a language used in their OS that everyone thought had died a horrible death then no-one would need to look at it's ridiculous syntax ever again.&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/8237926955425869206-1590235710424206558?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/1590235710424206558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=1590235710424206558' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/1590235710424206558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/1590235710424206558'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/09/new-objective.html' title='A New Objective'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-8771220816830400438</id><published>2009-08-28T06:34:00.000-07:00</published><updated>2009-08-28T06:44:18.658-07:00</updated><title type='text'>Hey Hey I Wanna Be A Rockstar</title><content type='html'>Just as depression was about to kick in about my lack of job; I have an interview for a graphics programming position at Rockstar North. It couldn't come a minute too soon; with any luck they will snap me up and use all my free time so I don't have to bother working on my engine for the foreseeable future!&lt;br /&gt;&lt;br /&gt;The engine seemed like a good idea and to be honest it isn't going too badly but incorporating the WinSock wrapper this early was a mistake. Mainly because the physics isn't finished and testing it is causing my bowels to cry. What really kick started it though was when I was asked if the maths libraries incorporated SIMD. So guess what...now the maths libraries have to be updated.&lt;br /&gt;&lt;br /&gt;I also have to rework the collision reaction for the physics engine; as objects that hit surfaces at an angle will continue to increase in velocity until they have left the screen, shot through the frame buffer and out the wall.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-8771220816830400438?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/8771220816830400438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=8771220816830400438' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/8771220816830400438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/8771220816830400438'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/08/hey-hey-i-wanna-be-rockstar.html' title='Hey Hey I Wanna Be A Rockstar'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-3109542519148421400</id><published>2009-05-13T12:12:00.000-07:00</published><updated>2009-05-13T12:27:30.270-07:00</updated><title type='text'>Summing Up and Future Posts</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/__KyV2yFdVEk/SgserD21xJI/AAAAAAAAAFQ/GHyqJu9Sy3E/s1600-h/blended+ground2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 278px;" src="http://3.bp.blogspot.com/__KyV2yFdVEk/SgserD21xJI/AAAAAAAAAFQ/GHyqJu9Sy3E/s400/blended+ground2.jpg" alt="" id="BLOGGER_PHOTO_ID_5335391908669015186" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I am almost finished the dissertation, I am at the stage of analyzing my results and drawing conclusions. However I feel it is important to include them here aswell.&lt;br /&gt;&lt;br /&gt;Graphics programming is heading in the direction of do everything on the GPU. This is highlighted by the removal of the fixed functionality from DirectX 10; this is what prompted me to do this project. Procedural terrain is something that I enjoy and I feel can be incorporated into games. I wanted to know if a procedural planet could be created entirely on the GPU and if it was of the same quality as modern CPU generated planets. The project has been a success and has shown me that it is possible, however the bigger conclusion is that the project sits at a crossroads. DirectX 10 has no fixed functionality therefore the CPU planet tessellation is non existant due to the lack of immediate rendering, however the GPU can tessellate the planet but decreasing LOD is inefficient, it cna only be achieved in the GS by replacing the mesh with the base mesh and subdividing to get the required detail. This does reduce poly count but I am not sure the performance hit is worthwhile. Therefore the CPU is best for tessellation but rendering can only be done on the GPU, passing all the vertices to the shader is slow. Unfortunately for this project but lucky for future work, DirectX 11 allows, not only a primitve to be passed to the shader, but entire meshes, using the Hull shader. This would allow for an LOD that could combine triangles.&lt;br /&gt;&lt;br /&gt;To sum up I feel that the GPU approach is the way forward, however perhaps the structure is not there at the moment to allow for incorporation of procedural planets in game, solely using the GPU.&lt;br /&gt;&lt;br /&gt;The posts have been erratic. Therefore I am going to post a step by step tutorial of how I the implementation.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/__KyV2yFdVEk/Sgsevh9Ft-I/AAAAAAAAAFY/9f9kKYaH5r4/s1600-h/blended+ground3.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 398px;" src="http://1.bp.blogspot.com/__KyV2yFdVEk/Sgsevh9Ft-I/AAAAAAAAAFY/9f9kKYaH5r4/s400/blended+ground3.jpg" alt="" id="BLOGGER_PHOTO_ID_5335391985467766754" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-3109542519148421400?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/3109542519148421400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=3109542519148421400' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/3109542519148421400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/3109542519148421400'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/05/summing-up-and-future-posts.html' title='Summing Up and Future Posts'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/__KyV2yFdVEk/SgserD21xJI/AAAAAAAAAFQ/GHyqJu9Sy3E/s72-c/blended+ground2.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-5546608969082219927</id><published>2009-05-01T10:24:00.000-07:00</published><updated>2009-05-01T11:20:21.904-07:00</updated><title type='text'>Final GPU Planet</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-11a87e6d64269947" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v21.nonxt5.googlevideo.com/videoplayback?id%3D11a87e6d64269947%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331550884%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D7B9656FB7C3A063FD4310263E95BE4CA96E27429.18CB5FF3C329EF5954A933B0D4C802B09E78E571%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D11a87e6d64269947%26offsetms%3D5000%26itag%3Dw160%26sigh%3D75LTK9IEmfrdcRsAAZeu2Cgh0Us&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v21.nonxt5.googlevideo.com/videoplayback?id%3D11a87e6d64269947%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331550884%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D7B9656FB7C3A063FD4310263E95BE4CA96E27429.18CB5FF3C329EF5954A933B0D4C802B09E78E571%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D11a87e6d64269947%26offsetms%3D5000%26itag%3Dw160%26sigh%3D75LTK9IEmfrdcRsAAZeu2Cgh0Us&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-5546608969082219927?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=11a87e6d64269947&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/5546608969082219927/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=5546608969082219927' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/5546608969082219927'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/5546608969082219927'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/05/final-gpu-planet.html' title='Final GPU Planet'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-7295054626284558567</id><published>2009-04-26T14:02:00.000-07:00</published><updated>2009-04-26T14:08:16.235-07:00</updated><title type='text'>The GPU...Not All It's Cracked Up To Be</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-9645a134a95414c8" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;&lt;param name="bgcolor" value="#FFFFFF"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="flashvars" value="flvurl=http://v13.nonxt5.googlevideo.com/videoplayback?id%3D9645a134a95414c8%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331550884%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D2927E51442E9D09393AE651AB6813F3FBF2AF19.48CC54232B5F48D7ED434BC7ED6D901958D65099%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D9645a134a95414c8%26offsetms%3D5000%26itag%3Dw160%26sigh%3D9Z1k-35C2OCMaI2MxPZfIw6rSPI&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"width="320" height="266" bgcolor="#FFFFFF"flashvars="flvurl=http://v13.nonxt5.googlevideo.com/videoplayback?id%3D9645a134a95414c8%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331550884%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D2927E51442E9D09393AE651AB6813F3FBF2AF19.48CC54232B5F48D7ED434BC7ED6D901958D65099%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D9645a134a95414c8%26offsetms%3D5000%26itag%3Dw160%26sigh%3D9Z1k-35C2OCMaI2MxPZfIw6rSPI&amp;autoplay=0&amp;ps=blogger"allowFullScreen="true" /&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;I am so close to finishing but as alway a few problems are persisting. Most notably the cracks that appear in the GPU LOD, as demonstrated by the video above. I am not sure why, but I am not above handing it like that as deadline is looming! The writing is going well, the dissertation is starting to take shape.  The faceted lighting isn't great but unfortunately its too late in the day to start using adjacency buffers.&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/8237926955425869206-7295054626284558567?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='enclosure' type='video/mp4' href='http://www.blogger.com/video-play.mp4?contentId=9645a134a95414c8&amp;type=video%2Fmp4' length='0'/><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/7295054626284558567/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=7295054626284558567' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7295054626284558567'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7295054626284558567'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/04/gpunot-all-its-cracked-up-to-be.html' title='The GPU...Not All It&apos;s Cracked Up To Be'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-7924025397441475221</id><published>2009-04-20T08:55:00.000-07:00</published><updated>2009-04-24T10:01:48.569-07:00</updated><title type='text'>Optimisation</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/__KyV2yFdVEk/SfHwcHbqyMI/AAAAAAAAAFI/EGBRpiYQ2n8/s1600-h/Planet.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 294px;" src="http://2.bp.blogspot.com/__KyV2yFdVEk/SfHwcHbqyMI/AAAAAAAAAFI/EGBRpiYQ2n8/s400/Planet.jpg" alt="" id="BLOGGER_PHOTO_ID_5328304199978109122" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I have been working on optimising my program this week, using the VS 2005 profiler and Nvidia PerfHUD. This is mainly because there is a fair bit of load time involved in the project that I am trying to reduce. I have also been tweaking textures and terrain features. The one thing I really need to put in place is VSync. The camera can become jerky once triangles start to split but this is because the framerate falls from 2000+ to 500+. If I can cap it at 60fps then everything should be smooth.&lt;br /&gt;&lt;br /&gt;EDIT: It turns out it was incredibly easy to VSync the application It was simply a case of setting a flag at the call to swapchain::present(SyncInterval, Param2), changing sync interval from zero to 1 to VSync to 60 fps.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/__KyV2yFdVEk/SezCs7khklI/AAAAAAAAAFA/dwlf9d8HkVc/s1600-h/ScreenShot045+copy.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 309px;" src="http://3.bp.blogspot.com/__KyV2yFdVEk/SezCs7khklI/AAAAAAAAAFA/dwlf9d8HkVc/s400/ScreenShot045+copy.jpg" alt="" id="BLOGGER_PHOTO_ID_5326846536433373778" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-7924025397441475221?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/7924025397441475221/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=7924025397441475221' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7924025397441475221'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7924025397441475221'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/04/optimisation.html' title='Optimisation'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/__KyV2yFdVEk/SfHwcHbqyMI/AAAAAAAAAFI/EGBRpiYQ2n8/s72-c/Planet.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-5670471774212614342</id><published>2009-04-14T02:57:00.000-07:00</published><updated>2009-04-14T03:05:43.008-07:00</updated><title type='text'>The Home Straight</title><content type='html'>I have been busy the last few weeks tidying up and fixing my project. I only have a few things left to do on the programming side. The most important (and annoying) of which are fixing the normals on the CPU planet. I rendered it without lighting and it looks fine, however the problem is that the normals seem to alternate. I still have to tweak the texturing and vertex displacement to get the best look, then I am done.&lt;br /&gt;&lt;br /&gt;This week I have implemented an algorithm on the CPU and GPU that tests whether a vertex is within the FOV, this allows for culling of rendering and calculations.I never managed to find out a way to scale the planet down and manipulate the projection matrix, so I will just have to stick with the large numbers. I manged to get the texture splatting in, using fractals as a rgb blendmap.&lt;br /&gt;&lt;br /&gt;I have mostly been working on my literature review, by far and away the hardest part of the dissertation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-5670471774212614342?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/5670471774212614342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=5670471774212614342' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/5670471774212614342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/5670471774212614342'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/04/home-straight.html' title='The Home Straight'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-997483659261813983</id><published>2009-03-29T08:04:00.000-07:00</published><updated>2009-03-29T08:12:51.996-07:00</updated><title type='text'>Looking At Things From A Different Perspective</title><content type='html'>I have literally stopped mid-programming because I am fed up with the huge numbers and z-buffer issues that happen when I scaled my planet up. The radius of the Earth is over 6000 km, and Earth is only a small to medium sized planet. At the moment I have the planet radius set to 10,000 but this is metres in order to scale the planet up by ten times the far clipping plane will need to be set at 300,000 to 500,000. This throws the z-buffer out aswell and causes weird clipping issues.&lt;br /&gt;&lt;br /&gt;So I am going to try something different. Really its a matter of scale. If i can alter the viewing perspective so that everything seems larger than it is then I can use smaller numbers which will be more efficient and won't break depth sorting. The problem is I am not sure how to do this.&lt;br /&gt;&lt;br /&gt;More research required :(&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-997483659261813983?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/997483659261813983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=997483659261813983' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/997483659261813983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/997483659261813983'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/03/looking-at-things-from-different.html' title='Looking At Things From A Different Perspective'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-51029121484219626</id><published>2009-03-28T08:40:00.000-07:00</published><updated>2009-03-28T12:13:07.490-07:00</updated><title type='text'>Split Decisions</title><content type='html'>Making good progress this week and I am not so worried about getting it finished. Have just been working on the methodology section of my dissertation and added some base knowledge to my introduction section i.e. some background on the techniques I have used. Anyway back onto coding...&lt;br /&gt;&lt;br /&gt;I have switched back to the CPU implementation today and I have two task before I can but this bet to bed. Firstly I really want to fix my normal problem. It seems that as soon as I create new faces for the mesh the normals are wrong. It's not even random its a pattern of wrong normals. I don't understand why as I generate the normal for a triangle after I split it but before I push it onto the list. Its just as simple cross product of two vertex positions and it seems to work for some and not others. The second task is to re-write the LOD driving algorithm i.e. deciding when to split and combine. The method I am using is awful and slow. So I am reading about another method that uses an error metric on top of the distance based calculation I am using. Bare with me as I am just going to do a brain dump here based on what I am reading at the moment...&lt;br /&gt;&lt;br /&gt;The new method uses distance, scale and the error limit.&lt;br /&gt;Distance - The length of the vector between the point in question (in my case the midpoint of the  base side of a triangle) and the camera position.&lt;br /&gt;Error Metric - This seems to be some arbitrary error value determined by trial and error (no pun intended).&lt;br /&gt;&lt;br /&gt;A ratio is then determined of error over distance. If this ratio is greater than the limit value provided the split. So whats this limit value...apparently its also a arbitrary number.&lt;br /&gt;&lt;br /&gt;Areas with low poly counts will have a low error metric and not be split, however areas close to the camera or that have high poly count will be split. A scale value can be introduced to scale the error. A large scale value will favour splitting rough terrain a small scale value will be weight toward distance.&lt;br /&gt;&lt;br /&gt;Right I'll implement this and post the results.&lt;br /&gt;&lt;br /&gt;EDIT:&lt;br /&gt;&lt;br /&gt;This method seemed to work a lot better. I had to add an error metric to my LOD triangle struct. The original metric was 100 and each child had half the error metric. Although I may tweak this. The lower the error metric the less likely it is to be split. I could alter the error metric of each trinagle based on its displacement factor so that flat land is not split but mountains are.&lt;br /&gt;&lt;br /&gt;Also I have fixed my vertex displacement in the GPU it was my noise function. I wasnt clamping the values properly. So now I have to implement per pixel lighting in the GS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-51029121484219626?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/51029121484219626/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=51029121484219626' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/51029121484219626'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/51029121484219626'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/03/split-decisions.html' title='Split Decisions'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-8404027542737852317</id><published>2009-03-27T08:59:00.000-07:00</published><updated>2009-03-27T09:12:48.557-07:00</updated><title type='text'>Trying to make your planet not look like a dead puffer fish</title><content type='html'>Now that I have got a suitably detailed sphere; I am working on creating the landscape features. In theory this should have been quite easy; but as usual...&lt;br /&gt;&lt;br /&gt;I have already implemented several noise beased fractal functions in HLSL. The base noise function is 3D Simplex noise (a shader style noise function by the master of noisiness himself Mr Perlin). With this in place I needed to pass in a base noise texture, simply a 256x256 texture filled with random noise for the SImplex noise to sample. I have come up with some really interesting looks and have been tewaking values most of the day; however there has been some problems.&lt;br /&gt;&lt;br /&gt;The first problem is really what shader to do the vertex displacement in? Well I thought that it would be easier to sample the displacement map in the render vertex shader (i.e after the GS has tessellated the mesh) but the problem here is calculating the normals! Scrap that idea, I thought that I would the perform the displacement in the GS but this produced huge gaps and holes in the geometry....back to the VS. I then discovered a paper thet Ken Perlin did for Nvidia about calculating normals from noise functions. Basically he suggests approximating the derivative of the function by adding a fractional amount to each component of the position vector, in turn (i.e x + 0.0001, y, z). Then subtracting these new noise values from original noise to give a vector which is then subtracted from the original normal and normalized to give the new normal. I ralise that made little sense...&lt;br /&gt;&lt;br /&gt;float e = 0.000001;&lt;br /&gt;float ScaleFactor = 8;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; float Noise = RidgedMultiFractal(vIn.PosL, vIn.Norm, NoiseTex, 0.1, 4.5) * ScaleFactor;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; float Noisex = RidgedMultiFractal(float3(vIn.PosL.x + e, vIn.PosL.y, vIn.PosL.z), vIn.Norm, NoiseTex, 0.1, 4.5) * ScaleFactor;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;float Noisey = RidgedMultiFractal(float3(vIn.PosL.x, vIn.PosL.y + e, vIn.PosL.z), vIn.Norm, NoiseTex, 0.1, 4.5) * ScaleFactor;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt; float Noisez = RidgedMultiFractal(float3(vIn.PosL.x, vIn.PosL.y, vIn.PosL.z + e), vIn.Norm, NoiseTex, 0.1, 4.5) * ScaleFactor;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;float3 dF = float3((Noisex - Noise), (Noisey - Noise), (Noisez - Noise))/e;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;vIn.Norm = normalize(vIn.Norm - dF);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Anyway it still doesn't look quite right so this is my focus for next week!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-8404027542737852317?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/8404027542737852317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=8404027542737852317' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/8404027542737852317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/8404027542737852317'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/03/trying-to-make-your-planet-not-look.html' title='Trying to make your planet not look like a dead puffer fish'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-7073773775377389137</id><published>2009-03-25T09:24:00.000-07:00</published><updated>2009-03-26T11:15:06.251-07:00</updated><title type='text'>Me 1 - GS  0</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/__KyV2yFdVEk/ScvGJKtZqlI/AAAAAAAAAEw/ydjvPWzk3vI/s1600-h/moon2.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 362px;" src="http://3.bp.blogspot.com/__KyV2yFdVEk/ScvGJKtZqlI/AAAAAAAAAEw/ydjvPWzk3vI/s400/moon2.bmp" alt="" id="BLOGGER_PHOTO_ID_5317561645836905042" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/__KyV2yFdVEk/ScvGBewVPHI/AAAAAAAAAEo/quK9oY0W8mQ/s1600-h/Moon.bmp"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 318px;" src="http://4.bp.blogspot.com/__KyV2yFdVEk/ScvGBewVPHI/AAAAAAAAAEo/quK9oY0W8mQ/s400/Moon.bmp" alt="" id="BLOGGER_PHOTO_ID_5317561513778953330" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Just this very minute I have conquered the GS tessellation issue. In all honestly I am still not sure why it works now when the implementation I had originally was better. Theoretically I should simply Draw using the split shader and the initial VB and from that pass on use the stream out buffer as my input as opposed to the initial VB. I have been doing this with no success but now it seems by drawing with the initial VB then with stream out produces results.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;switch(RenderType)&lt;br /&gt;{&lt;br /&gt;case 0: //Render with the Draw Shader using Pre-built &lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;VB data&lt;br /&gt;&lt;br /&gt;   //Draw with pre-built vertices&lt;br /&gt;  mDevice-&gt;IASetVertexBuffers(0, 1, &amp;amp;mVB, &lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&amp;amp;Stride, &amp;amp;Offset);&lt;br /&gt;  mDevice-&gt;SOSetTargets(1, &amp;amp;mStreamBuff, &amp;amp;Offset);&lt;br /&gt;  mDevice-&gt;Draw(miNumVerts, 0);&lt;br /&gt;  //Unbind the buffer from stream out so we can draw&lt;br /&gt;  mDevice-&gt;SOSetTargets(1, BlankBuff, &amp;amp;Offset)&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;; &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;       mDevice-&gt;IASetVertexBuffers(0, 1, &amp;amp;mDrawBuff, &amp;amp;Stride, &amp;amp;Offset);&lt;br /&gt;  //Swap the buffers&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;       std::swap(mDrawBuff, mStreamBuff);&lt;br /&gt; break;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;  case 1: &lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;//Use the LOD shader t&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;o tessellate the mesh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;      for(int i =0; i&lt;4;&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;  &lt;br /&gt;      mDevice-&gt;IASetVertexBuffers(0, 1,    &amp;amp;mDrawBuff, &amp;amp;Stride, &amp;amp;Offset);&lt;br /&gt;         //Updated vertices are streamed to here&lt;br /&gt;         mDevice-&gt;SOSetTargets(1, &amp;amp;mStreamBuff, &amp;amp;O&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;ffset);&lt;br /&gt;        //From now on use the verts created by the G&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;S, pass these back in for recursion&lt;br /&gt;        mDevice-&gt;DrawAuto();&lt;br /&gt;       //Unbind the buffer from stream out so we can draw&lt;br /&gt;       mDevice-&gt;SOSetTargets(1, BlankBuff, &amp;amp;Offset);&lt;br /&gt;      //Swap the buffers&lt;br /&gt;       std::swap(mDrawBuff, mStreamBuff);&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;      }&lt;br /&gt;break;&lt;br /&gt;&lt;br /&gt;case 2:&lt;br /&gt;  //Use the LOD shader to tessellate the mesh&lt;br /&gt;  mDevice-&gt;IASetVertexBuffers(0, 1, &amp;amp;mDraw&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;Buff, &amp;amp;Stride, &amp;amp;Offset);&lt;br /&gt;  //From now on use the verts created by the GS, pass these back in for recursion&lt;br /&gt;  mDevice-&gt;DrawAuto();&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;  break;&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Ideally I was doing case 1 once, thencase 2 for the desired number of splits then case 3. However now I have to do case 1 for the number of splits too.&lt;br /&gt;&lt;br /&gt;So here are a few screenshots:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/__KyV2yFdVEk/ScpdhZiZS9I/AAAAAAAAAEQ/HhPidlLTFx0/s1600-h/MoonLike+GS.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 254px;" src="http://3.bp.blogspot.com/__KyV2yFdVEk/ScpdhZiZS9I/AAAAAAAAAEQ/HhPidlLTFx0/s320/MoonLike+GS.jpg" alt="" id="BLOGGER_PHOTO_ID_5317165138436508626" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/__KyV2yFdVEk/ScpdugvAisI/AAAAAAAAAEY/F_EjVFfXJGg/s1600-h/WireframeGS.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 254px;" src="http://3.bp.blogspot.com/__KyV2yFdVEk/ScpdugvAisI/AAAAAAAAAEY/F_EjVFfXJGg/s320/WireframeGS.jpg" alt="" id="BLOGGER_PHOTO_ID_5317165363706759874" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-7073773775377389137?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/7073773775377389137/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=7073773775377389137' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7073773775377389137'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7073773775377389137'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/03/me-1-gs-0.html' title='Me 1 - GS  0'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/__KyV2yFdVEk/ScvGJKtZqlI/AAAAAAAAAEw/ydjvPWzk3vI/s72-c/moon2.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-6926339575206107862</id><published>2009-03-22T16:37:00.000-07:00</published><updated>2009-03-22T16:45:51.942-07:00</updated><title type='text'>Texture Blending - Behold the glory</title><content type='html'>Everything seems to be heading along nicely this week with the exception of the stream out! I have debugged the shader using PIX and queried the pipeline during runtime. The result is that the GS is functioning properly and is streaming to the correct buffer. The problem is that the PS is not being 'invoked' still I will persist. In the meantime I have been tweaking the blend factors for my textures; here's some snippets:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/__KyV2yFdVEk/ScbNU8iX0EI/AAAAAAAAAEI/jc9sZSKiwBg/s1600-h/Blend3.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 226px;" src="http://3.bp.blogspot.com/__KyV2yFdVEk/ScbNU8iX0EI/AAAAAAAAAEI/jc9sZSKiwBg/s320/Blend3.jpg" alt="" id="BLOGGER_PHOTO_ID_5316162169888821314" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/__KyV2yFdVEk/ScbNJ2TDhMI/AAAAAAAAAD4/_Chy9yw8xy4/s1600-h/Blend1.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: center; cursor: pointer; width: 320px; height: 248px;" src="http://3.bp.blogspot.com/__KyV2yFdVEk/ScbNJ2TDhMI/AAAAAAAAAD4/_Chy9yw8xy4/s320/Blend1.jpg" alt="" id="BLOGGER_PHOTO_ID_5316161979235402946" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/__KyV2yFdVEk/ScbNP1PEtKI/AAAAAAAAAEA/6W6jHULczSM/s1600-h/Blend2.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: center; cursor: pointer; width: 320px; height: 265px;" src="http://4.bp.blogspot.com/__KyV2yFdVEk/ScbNP1PEtKI/AAAAAAAAAEA/6W6jHULczSM/s320/Blend2.jpg" alt="" id="BLOGGER_PHOTO_ID_5316162082029483170" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-6926339575206107862?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/6926339575206107862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=6926339575206107862' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/6926339575206107862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/6926339575206107862'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/03/texture-blending-behold-glory.html' title='Texture Blending - Behold the glory'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/__KyV2yFdVEk/ScbNU8iX0EI/AAAAAAAAAEI/jc9sZSKiwBg/s72-c/Blend3.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-4625522182452728609</id><published>2009-03-20T05:43:00.000-07:00</published><updated>2009-03-20T07:52:59.809-07:00</updated><title type='text'>Sometimes things just work</title><content type='html'>I really don't know what happened yesterday; after I posted that blog I managed to fix my CPU LOD tessellation algorithm. I have been staring at the code for weeks but I finally realised that I had transposed the vertices of the new child nodes (i.e. child 1 had positions 0, 1, 2 instead of 2, 0,1 etc...). Then I implemented bump mapping and it looks awesome.  So today I am determined to fix that stream out problem!&lt;br /&gt;&lt;br /&gt;Here is a screenshot of the CPU mesh tessellation. I have inverted some of the normals to make it easier to see.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/__KyV2yFdVEk/ScORIPmgKAI/AAAAAAAAADo/YS7pM_yEjGo/s1600-h/CPUtess.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 261px;" src="http://2.bp.blogspot.com/__KyV2yFdVEk/ScORIPmgKAI/AAAAAAAAADo/YS7pM_yEjGo/s320/CPUtess.jpg" alt="" id="BLOGGER_PHOTO_ID_5315251556040321026" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/__KyV2yFdVEk/ScOtn2OdB5I/AAAAAAAAADw/keo5S7OU-nA/s1600-h/Bumped.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 280px;" src="http://2.bp.blogspot.com/__KyV2yFdVEk/ScOtn2OdB5I/AAAAAAAAADw/keo5S7OU-nA/s320/Bumped.jpg" alt="" id="BLOGGER_PHOTO_ID_5315282885309958034" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-4625522182452728609?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/4625522182452728609/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=4625522182452728609' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/4625522182452728609'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/4625522182452728609'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/03/sometimes-things-just-work.html' title='Sometimes things just work'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/__KyV2yFdVEk/ScORIPmgKAI/AAAAAAAAADo/YS7pM_yEjGo/s72-c/CPUtess.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-643813256832914050</id><published>2009-03-19T08:30:00.001-07:00</published><updated>2009-03-19T08:30:55.254-07:00</updated><title type='text'>Life is but a stream…</title><content type='html'>&lt;p&gt;I feel that my posts have become a bit erratic so I am taking the time to sum up what I have done so far and what I have left to do; to focus myself as much as anything. Here goes…&lt;/p&gt;  &lt;p&gt;I have been working simultaneously on GPU and CPU implementation the Split/Combine algorithm has been implemented on the CPU using midpoint subdivision. However there are a few problems to be solved as we get a bit of Z-fighting. The split algorithm on the GPU has been coded, which uses a similar algorithm to the CPU one; however this technique makes use of the GeoShader. The one aspect of this that is causing problems is the stream-out stage, this is what I am currently working on. &lt;/p&gt;  &lt;p&gt;In order to recursively tessellate the mesh the output mesh must then become the input for the nest pass. This is achieved by using stream out to output vertex data to stream VB. This VB is then copied into a Draw VB which is the input for the next pass. The initial platonic shape is held in a separate Init VB, this is only passed to the shader pipeline once. The&amp;#160; problem arises when trying to cap the number of recursions; once the mesh has been split sufficiently it must then be rendered without the GS stage. At the moment I have a counter that performs the above tessellation; once the counter reaches zero the final mesh data taken from Draw VB is used in a different shader pass which has no GS. The final stage is creating a blank screen but I think I know what the problem is. Once this is fixed I will have a scaling planet based on the camera distance from a polygon.&lt;/p&gt;  &lt;p&gt;Moving on from LOD; I have also had a lot of success in recent weeks with procedural texturing. It has been difficult identifying the best methods; but this is what I am doing…&lt;/p&gt;  &lt;p&gt;Creating noise on the shader can take up a huge amount of the instruction set, so I create noise textures on the CPU at load time, using fBm and pass them and the landscape textures in as texture arrays. I then choose the landscape texture to use based on altitude and angle of incline (angle between face normal and up vector). I sample this texture by summing the various noise textures, halving the texture coords each time, and using the components of noise as blend weights. I also multiply in the noise value to dissipate texture repetition. There is huge scope for playing around with all these values, it will be hard to select the best method until the planet is fully scaled. The LOD of the texture is adjusted by doubling and splitting the tex coords based on distance from the world.&lt;/p&gt;  &lt;p&gt;The final stage is displacing the mesh. This will be achieved on the CPU by altering the vertex pos using a mixture of fBm and multi-fractals and on the GPU by sampling the noise as a height map.&lt;/p&gt;  &lt;p&gt;If I have time (fingers crossed), I will implement bump mapping to improve realism, create an atmosphere/sky and add a water sphere (maybe just a simple planet within the planet acting as a water table.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-643813256832914050?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/643813256832914050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=643813256832914050' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/643813256832914050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/643813256832914050'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/03/life-is-but-stream.html' title='Life is but a stream…'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-2192085473465011193</id><published>2009-03-17T02:12:00.001-07:00</published><updated>2009-03-17T02:12:32.790-07:00</updated><title type='text'>Life’s Better When It’s Noisy</title><content type='html'>&lt;p&gt;This week I have focused on two goals. Firstly I adapted my GeoShader to stream out to a vertex buffer; in order to perform recursive subdivision. This involves creating an additional two vertex buffers and reading into them alternately by swapping them every frame. I seem to be getting a blank screen at the moment so I will need to double check that. The second aspect I am working on is the procedural texturing. I am so close to completing this step, but at the moment the textures are not right. I have researched the best way to implement noise in the shader and it seems that creating a base noise texture and passing that in is the most efficient way. Luckily this is easy to do in directx, as I simply fill an array with perlin noise samples and then create a texture using the D3D device. So I am almost back up to date with my Gantt chart.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-2192085473465011193?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/2192085473465011193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=2192085473465011193' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/2192085473465011193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/2192085473465011193'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/03/lifes-better-when-its-noisy.html' title='Life’s Better When It’s Noisy'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-6335070307045317926</id><published>2009-03-10T13:13:00.001-07:00</published><updated>2009-03-10T13:13:14.170-07:00</updated><title type='text'>Progress Report</title><content type='html'>&lt;p&gt;&lt;a href="http://lh6.ggpht.com/__KyV2yFdVEk/SbbJ1rwtKuI/AAAAAAAAADg/23bwXJnQL_Q/s1600-h/Gantt%20Chart%5B4%5D.jpg"&gt;&lt;img title="Gantt Chart" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="275" alt="Gantt Chart" src="http://lh6.ggpht.com/__KyV2yFdVEk/SbbJ2K63RFI/AAAAAAAAADk/veVftVEZ4z8/Gantt%20Chart_thumb%5B2%5D.jpg?imgmax=800" width="412" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Just a quick update on my progress. Although the Gantt chart suggests otherwise I feel that I am maybe a week behind. I think the original chart was ambitious and I left myself overlap time at the end. The few problems that I have left to solve are the CPU splitting function which causes distortion, porting perlin noise into the shader and performing multiple passes of the GS. The GS tessellation works well for one pass but I now need to stream it out to a new buffer. I have finally made a breakthrough with the procedural texturing and once the noise function has been implemented in the effect file, the texturing will be complete.&lt;/p&gt;  &lt;p&gt;In relation to the actual dissertation; I have finished the introduction and abstract (with the exception of the results) and have began both methodology sections. I intend to format the document correctly this week and finish the literature review.&lt;/p&gt;  &lt;p&gt;Still confident that I can do it!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-6335070307045317926?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/6335070307045317926/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=6335070307045317926' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/6335070307045317926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/6335070307045317926'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/03/progress-report.html' title='Progress Report'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/__KyV2yFdVEk/SbbJ2K63RFI/AAAAAAAAADk/veVftVEZ4z8/s72-c/Gantt%20Chart_thumb%5B2%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-5574569562791288095</id><published>2009-03-03T09:10:00.001-08:00</published><updated>2009-03-03T09:10:47.518-08:00</updated><title type='text'>Saved by a Black Knight!</title><content type='html'>&lt;p&gt;I would like to thank Black Knight and Evil Steve on the Gamedev.net forums, who have finally helped me identify my memory problem! 2 weeks of creating copy constructors and copy assignments and the problem was simply that I was pointing to a local variable, which would only be stored on the stack and become invalid once the function returned. On the plus side my program has no memory leaks as I went through it with a fine tooth comb…or a memory manager as it is also known and made sure everything was allocated and released properly. My LOD algorithm is tessellating my planet properly, however there are a few cracks in the mesh, which I will attempt to solve next.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-5574569562791288095?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/5574569562791288095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=5574569562791288095' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/5574569562791288095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/5574569562791288095'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/03/saved-by-black-knight.html' title='Saved by a Black Knight!'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-5359938882656913481</id><published>2009-02-27T04:08:00.001-08:00</published><updated>2009-02-27T04:08:35.658-08:00</updated><title type='text'>Memory Hates Me. Part II</title><content type='html'>&lt;p&gt;The problem from last post is still there. I have tried several solutions to solve it, but like Edison I have found lots of ways not to solve my problem. Firstly I tried reserving a memory size for my stl vector. This would prevent it jumping around in memory. Secondly I tried using a copy constructor for my triangle struct which would enable me to make a deep copy of the struct data, but once again this failed. Then I discovered that allocating any memory, either using new or push_back would cause the list pointers to become bad. It seems to me that I may have a memory leak so I will use Visual Studio to track all my new and delete calls.&lt;/p&gt;  &lt;p&gt;On a better note I finished my Fractals class and ported a version of it into an effects file to be used as a shader by the GPU. So progress this week has not been too bad.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-5359938882656913481?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/5359938882656913481/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=5359938882656913481' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/5359938882656913481'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/5359938882656913481'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/02/memory-hates-me-part-ii.html' title='Memory Hates Me. Part II'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-3330528691195355716</id><published>2009-02-23T09:25:00.001-08:00</published><updated>2009-02-23T09:25:15.461-08:00</updated><title type='text'>Memory Hates Me</title><content type='html'>&lt;p&gt;I am having a really big problem this week that is drastically slowing down progress. The problem is a result of memory bashing; but not in a way I have experienced before. Whenever triangle data needs to be obtained from the list a pointer is returned to that triangle. However as mentioned before the vertex buffer only handles arrays, so the vertex data must be taken from each triangle and added to a dynamic vector array. Vectors allocate contiguous blocks of memory and as a result will jump about in memory. Therefore a vector will always take data by value and not reference. I am copying the triangle data into a temporary struct and then push that onto the back of the vector. &lt;/p&gt;  &lt;blockquote&gt;   &lt;p align="center"&gt;pTri = List(i);&lt;/p&gt;    &lt;p align="center"&gt;VertexStruct.Pos = pTri-&amp;gt;Pos[j]&lt;/p&gt;    &lt;p align="center"&gt;vector.push_back(VertexStruct);&lt;/p&gt; &lt;/blockquote&gt;  &lt;p align="left"&gt;The above code copies the data into the struct correctly and pushes it onto the vector correctly. However the push_back call corrupts the triangle list. It seems that the vector is expanding in memory and overwriting the list. Or that the data is not being copied and therefore when the vector moves the data in memory the pointer is no longer valid. I am going to try and memcpy the data and see if that solves the problem&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-3330528691195355716?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/3330528691195355716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=3330528691195355716' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/3330528691195355716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/3330528691195355716'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/02/memory-hates-me.html' title='Memory Hates Me'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-9053211499826777625</id><published>2009-02-17T03:25:00.000-08:00</published><updated>2009-02-17T03:32:52.857-08:00</updated><title type='text'>Put One In and Get Four Out. You Do The Hokey Cokey...</title><content type='html'>This week I have been learning about Geometry shaders and they seem to be a lot easier to use than I anticipated. I have not measured the difference between LOD on the CPU and GPU yet but for effeciency of coding the GS wins, hands down. Splitting a triangle on the CPU involves setting up pointers to edges, maintaining a list of diamonds etc; it is much easier on the GPU.&lt;br /&gt;&lt;br /&gt;To setup the GS you must first decide what primitive will be passed in, i.e a line, quad etc; in this case three vertices are input for a triangle. A max vertex count is set to limit the number of vertices that can be output. The midpoint of each line is calculated and these are appended to an output stream. This stream is then passed into the pixel shader. Job done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-9053211499826777625?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/9053211499826777625/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=9053211499826777625' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/9053211499826777625'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/9053211499826777625'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/02/put-one-in-and-get-four-out-yo-do-hokey.html' title='Put One In and Get Four Out. You Do The Hokey Cokey...'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-4472431766861037218</id><published>2009-02-12T04:10:00.001-08:00</published><updated>2009-02-12T04:10:15.720-08:00</updated><title type='text'>Slight Adjustment…</title><content type='html'>&lt;p&gt;Following the last post, where I was struggling to identify a way to find a relationship between neighbour triangles and array positions, I have had to perform a slight overhaul. Previously the triangles were stored in a vector array, as vertex buffers only handle arrays; however in order to insert new triangles into the mesh I have had to write my own linked list class and I am in the process of converting from vector array to linked list. This allows me to insert and delete arbitrary nodes. The downside is that now I must copy the vertex data from the list into a vector array before rendering.&lt;/p&gt;  &lt;p&gt;Luckily I can simultaneously begin work on texturing. I think this is the most complex part of the project. I have created a perlin noise class and from this I will be able to implement fBm. I am not sure of the best way to texture the mesh. One way would be to have grass, snow and earth textures and use the noise to sample them differently. However there are some articles which create colour tables in the pixel shaders and sample them across the polygon. I have found that none of the articles are particularly clear on how to begin. Even the book “Texturing and Modelling: A Procedural Approach” does not give&amp;#160; a good indication of how to begin, of course it doesn’t help that all the code is written for RenderMan!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-4472431766861037218?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/4472431766861037218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=4472431766861037218' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/4472431766861037218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/4472431766861037218'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/02/slight-adjustment.html' title='Slight Adjustment…'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-4106916056449999811</id><published>2009-02-09T12:01:00.000-08:00</published><updated>2009-02-09T12:13:53.094-08:00</updated><title type='text'>Relationship Breakdown</title><content type='html'>This week I have pretty much finished the split and merge aspect of the LOD algorithm. The methods work in debugging but the problem is that I need to come up with a method to insert the triangles into the vertex array. The main principle behind splitting is that a triangle is passed in and from this we can get the opposite triangle from its edge 2 pointer. The original triangle and opposite triangle are used to create the new children. These children are then inserted into the array in the cell after their parents. The problem is how do I get the array position of the opposite triangle? One option is to store the element number in each triangle struct, however whenever a new triangle is created I would have to update all the triangles following this in the array. That could be a lot of triangles if the new polygon has to be inserted at element 2. I will investigate other solutions and hopefully have one in place in the next few days then the LOD will be complete. I am hoping there will be asimple relationship between the triangle and it's opposite in terms of array position.&lt;br /&gt;&lt;br /&gt;The next implementation stage will be to determine which triangles need to be split and merged based on the cameras field of view.&lt;br /&gt;&lt;br /&gt;In terms of dissertation writing I am starting the introduction tonight, and following last weeks lecture; beginning the literature review. I have a good idea of what I intend to write so it should be straightforward. It's a small step to getting this project bound!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-4106916056449999811?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/4106916056449999811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=4106916056449999811' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/4106916056449999811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/4106916056449999811'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/02/relationship-breakdown.html' title='Relationship Breakdown'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-9210066501514249724</id><published>2009-02-05T11:53:00.000-08:00</published><updated>2009-02-05T11:58:12.508-08:00</updated><title type='text'>Ladies &amp; Gentlemen; Behold...In Glorius Technicolour!</title><content type='html'>Just thought I would post a picture of my progress. I was having a few matrix problems but now the rendering aspect is fixed and behold:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/__KyV2yFdVEk/SYtEHHKci6I/AAAAAAAAACk/Ha3CNk6BCYA/s1600-h/ScreenShot1-Basic+Mesh.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 262px;" src="http://2.bp.blogspot.com/__KyV2yFdVEk/SYtEHHKci6I/AAAAAAAAACk/Ha3CNk6BCYA/s320/ScreenShot1-Basic+Mesh.jpg" alt="" id="BLOGGER_PHOTO_ID_5299404275504155554" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Each vertex has been given a colour to highlight the structure of the mesh. The mesh is an icosahedron made up of 20 polygons.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Most of the LOD algorithm is in but this minor success has boosted my motivation, so progress will hopefully be thick and fast now!&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/8237926955425869206-9210066501514249724?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/9210066501514249724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=9210066501514249724' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/9210066501514249724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/9210066501514249724'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/02/ladies-gentlemen-beholdin-glorius.html' title='Ladies &amp; Gentlemen; Behold...In Glorius Technicolour!'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/__KyV2yFdVEk/SYtEHHKci6I/AAAAAAAAACk/Ha3CNk6BCYA/s72-c/ScreenShot1-Basic+Mesh.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-1800172039988846722</id><published>2009-02-03T16:27:00.000-08:00</published><updated>2009-02-03T16:41:33.570-08:00</updated><title type='text'>God created the Earth in 7 days....He never used LOD!</title><content type='html'>(Or does the Earth only appear when you are looking at it?)&lt;br /&gt;&lt;br /&gt;I am just posting a quick update about my work this week. Finally solved that problem relating to drawing the primitives, the solution was basically that instead of pointing the VBO to the memory address of the vertex list, instead I had to point it to the address of the first element. Took me ages to work that one out and the internet was little use as everyone else seems to use a vertex array. However I think a list allows the mesh to be more dynamic.&lt;br /&gt;&lt;br /&gt;I am still implementing the altered &lt;span style="font-style: italic;"&gt;ROAM &lt;/span&gt;algorithm, however I am debating whether to split the LOD class into multiple classes as a 'diamond' often points to itself and there are several functions involved in determining whether or not a polygon is in a diamond and in creating the 'diamond' itself.&lt;br /&gt;&lt;br /&gt;At the same time I am also working on the basic shell of the other procedural classes in the framework. I have created a wrapper to handle the displacement techniques which only allow the user to access the perlin noise and fractal class through that.&lt;br /&gt;&lt;br /&gt;Finally I have been reading ways to prioritise the triangles in the mesh to identify which ones to split or merge. This will be the next stage of implementation, which will hopefully only take a few days now that I can actually see something on screen!&lt;br /&gt;&lt;br /&gt;This may mean I can actually post pictures again!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-1800172039988846722?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/1800172039988846722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=1800172039988846722' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/1800172039988846722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/1800172039988846722'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/02/god-created-earth-in-7-dayshe-never.html' title='God created the Earth in 7 days....He never used LOD!'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-3263216889514281726</id><published>2009-01-27T05:50:00.000-08:00</published><updated>2009-01-27T06:13:26.198-08:00</updated><title type='text'>ROAM? I'd Rather Take a Hike!</title><content type='html'>This week work has begun on my LOD algorithm. I am using Andrew True's optimized &lt;span style="font-style: italic;"&gt;ROAM &lt;/span&gt;method as a guideline, outlined in his Gamedev article "&lt;span style="font-style: italic;"&gt;Procedural Planets Part 1"&lt;/span&gt;. One of the stipulations of the &lt;span style="font-style: italic;"&gt;ROAM &lt;/span&gt;algorithm, for use on a spherical surface, is that the base shape must be a seamless primitive constructed from triangles. The simplest shape to begin with is a cube; however a more complex geo-spherical shape will reduce the number of recursions required to create the planet, therefore the best base shape to use is an icosahedron. The Planet wrapper class constructs the geo-sphere mesh and adds the vertices to a VB to be rendered.&lt;br /&gt;&lt;br /&gt;The LOD class is responsible for splitting and combining triangles, updating the pointers to neighbours, children and parents and also maintaining the pointers to the other triangles making up the diamond shape to which a triangle belongs. The rules of &lt;span style="font-style: italic;"&gt;ROAMing&lt;/span&gt; state that a triangle can only be merged if it is in the diamond step, therefore in order to optimize performance it is beneficial to keep track of all the diamonds at the current LOD.&lt;br /&gt;&lt;br /&gt;The problem with &lt;span style="font-style: italic;"&gt;ROAM  &lt;/span&gt;and other similar methods is that there are pointers to absolutely everything! It can be hard to track exaclty how one polygon relates to its neighbours. Every time the mesh changes, the neighbours of each triangle have to be identified, its children have to be linked and their parent pointer must be set. Finally if the triangle was part of a diamond before it split, that diamond does not exist anymore so it must be deleted and a new diamond calculated!&lt;br /&gt;&lt;br /&gt;I have not quite decided the best route to take in terms of optimizing the way in which the mesh is stored. I think the next stage after creating the LOD algorithm is to split the planet using a quadtree and assign each quadrant a vertex buffer. Processing VBO's in batches allows us to change a small number of vertices without recalculating a large buffer that holds every vertex in the mesh.&lt;br /&gt;&lt;br /&gt;One thing that I have identified for all the geologists in the world...if you want to know what is at the centre of our planet there's a good chance its a linked list!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-3263216889514281726?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/3263216889514281726/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=3263216889514281726' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/3263216889514281726'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/3263216889514281726'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/01/roam-id-rather-take-hike.html' title='ROAM? I&apos;d Rather Take a Hike!'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-7147457594635526659</id><published>2009-01-21T08:07:00.000-08:00</published><updated>2009-01-21T08:19:07.239-08:00</updated><title type='text'>Buffer My Vertices</title><content type='html'>Just a quick update on the framework for my project. Finally managed to get rid of the linking errors by painstakingly going through the properties and checking all the libraries. The framework is practically finished and I have started working on the level of detail algorithm.&lt;br /&gt;&lt;br /&gt;I am just implementing the vertex buffer to hold the vertices of the world mesh. VBO's are handled differently in DirectX 10. Unlike DX 9, there is no need to declare a specific vertex buffer; instead you declare a generic buffer and set whether it is an index or vertex buffer. For this project the best route to take it to use dynamic buffers, as Nvidia say their chipset improves effeciency by 70% over static buffers. Dynamic buffers are better suited as the mesh vertices will alter frequently. DirectX 10 allows the developer to set how the buffers are accessed i.e. whether the CPU can write and read from them or just the GPU.&lt;br /&gt;&lt;br /&gt;The problem is that the vertices of each triangle are held in an struct, conatining the positon vectors of the 3 points, and pointers to the polygons neighbours, children and parent. The vertex buffer will only store coordinates in a contiguous fashion. Therefore the actual vertices need to be stored in a list and copied into the buffer.&lt;br /&gt;&lt;br /&gt;Hopefully I will have a triangle on screen by the end of the week. Then I will work out splitting the triangles along their midpoint to create a new polygon. This will allow me to test the function befre I concern myself with deciding which triangles to split.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-7147457594635526659?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/7147457594635526659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=7147457594635526659' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7147457594635526659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7147457594635526659'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/01/buffer-my-vertices.html' title='Buffer My Vertices'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-245899875048035245</id><published>2009-01-18T10:58:00.000-08:00</published><updated>2009-01-18T11:02:16.045-08:00</updated><title type='text'>Stop Press. Framework update</title><content type='html'>So far the framework is causing a few problems, I have setup my direct 3d manager and my game class. The camera class has also been created; however I am getting linking errors with regard to the D3DX10 functions. I have trawled through the forums and it seems to be a problem with respect to 64 bit libraries but I'm not much closer to fixing it.&lt;br /&gt;&lt;br /&gt;With any luck I will be hit by divine inspiration...until then CTRL + F5!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-245899875048035245?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/245899875048035245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=245899875048035245' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/245899875048035245'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/245899875048035245'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/01/stop-press-framework-update.html' title='Stop Press. Framework update'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-8564101040397913599</id><published>2009-01-08T16:57:00.000-08:00</published><updated>2009-01-08T17:06:30.549-08:00</updated><title type='text'>DirectX 10 - Framework</title><content type='html'>I have recently been working on my new framework for the project. Originally I had planned to complete the demo using OpenGL, however now that I intend to make use of geometry shaders this calls for DirectX 10.&lt;br /&gt;&lt;br /&gt;Having never used DX10 before this made my Christmas rather eventful. Even initialising a Direct3D window is quite different in DX10 than 9. In 9 you really just have to set up a window and a device manager. With 10 a swap chain has to be created to allow buffer switching. This is just one of the few differences.&lt;br /&gt;&lt;br /&gt;Currently I have a Direct3D class from which the 'game' glass is inherited. The camera class has been setup to incorporate a first person camera. The next stage is to incorporate a base shader class. Effects are handles slightly differently in DirectX 10 as they are handled by the manager. I have begun implementing this class which will allow me to include the geometry shader code.&lt;br /&gt;&lt;br /&gt;Im currently focusing on the reading about geometry shaders although there seems to be a lack of coherent material with regard to DX10. The most common publications tend to be over simplified and very messy. I hope to finish the framework wihtin the next 2-3 weeks this will allow me to start creating the planet on the CPU.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-8564101040397913599?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/8564101040397913599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=8564101040397913599' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/8564101040397913599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/8564101040397913599'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2009/01/directx-10-framework.html' title='DirectX 10 - Framework'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-2829165874978774523</id><published>2008-11-13T12:03:00.000-08:00</published><updated>2008-11-13T12:33:40.777-08:00</updated><title type='text'>Oh When the Cubes Go Marching In...</title><content type='html'>I have found another technique for rendering terrain on the geometry shader that can create dramatically more complex terrain features, such as overhangs and caves. Terrain has traditionally been computed as a heightmap, calculated on the CPU, however it is impossible to create the above effects using this method.&lt;br /&gt;&lt;br /&gt;The way to achieve a complex terrain is using the '&lt;span style="font-style: italic;"&gt;Marching Cubes Algorithm&lt;/span&gt;' and a &lt;span style="font-style: italic;"&gt;density function&lt;/span&gt;. The density function produces a float for any (x, y, z) point in our world space. If the value is positive then the coordinates are inside the terrain (i.e. underground) and if the float is negative then that describes a a point in the air or sea. If the value is zero then the point is on the surface of the terrain.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/__KyV2yFdVEk/SRyOt0SxAlI/AAAAAAAAACU/Zwqwi4M_KVk/s1600-h/nv_cascades_1280x1024.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 256px;" src="http://3.bp.blogspot.com/__KyV2yFdVEk/SRyOt0SxAlI/AAAAAAAAACU/Zwqwi4M_KVk/s320/nv_cascades_1280x1024.jpg" alt="" id="BLOGGER_PHOTO_ID_5268242581899248210" border="0" /&gt;&lt;/a&gt;We split the terrain into sections and subdivide each block into smaller voxels. Using the &lt;span style="font-style: italic;"&gt;marching cube method &lt;/span&gt;we input the density value for the eight vertices of each voxel and it will produce a number of polygons ranging from 1 to 5. If the block corners are all positive or negative the block lies completely inside or outside the terrain. The density function creates thes points based on terrain displacement techniques such as noise etc.&lt;br /&gt;&lt;br /&gt;If we store each density value for a voxel as a bit and concatenate them into a single integer between 0 and 255 this will tell us if a block is inside or outside the terrain. If the number is between 1 and 254 then we use a lookup table to determine how many polygons to create.&lt;br /&gt;&lt;br /&gt;Geiss, R. &lt;span style="font-style: italic;"&gt;GPU gems 3.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-2829165874978774523?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/2829165874978774523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=2829165874978774523' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/2829165874978774523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/2829165874978774523'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2008/11/oh-when-cubes-go-marching-in.html' title='Oh When the Cubes Go Marching In...'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/__KyV2yFdVEk/SRyOt0SxAlI/AAAAAAAAACU/Zwqwi4M_KVk/s72-c/nv_cascades_1280x1024.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-7705747330554582199</id><published>2008-11-12T05:39:00.000-08:00</published><updated>2008-11-12T05:48:49.417-08:00</updated><title type='text'>Worksheet 4- The Final Frontier</title><content type='html'>&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;Proposal Document&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Worksheet 4&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Introduction&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is the topic and aim of the project?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The aim of the project is to identify the methods used to implement a real-time, procedural planet, in a game situation; that make the best use of modern graphics cards. The methods that will be investigated are algorithms for texturing, mesh geometry and level of detail. Conclusions will be drawn on the techniques that produce the best compromise of aesthetics and performance (frame rate).&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Issues&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What issues do you want to address.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The techniques for creating large scale, procedural terrain have been around for many years. Methods such as the diamond-subdivision technique, fractal-brownian motion and procedural texturing have been around since the mid 90’s and even earlier. However the best examples of procedural worlds have always been the product of an offline process; using programs such as F. Kenton Musgrave’s ‘Mojoworld’. Very few games, with the exception of ‘SPORE’, have incorporated a vast procedurally generated terrain since it was used in ‘Frontier: First Encounter’ in 1993. This raises the question ‘why not?’ Is this technique too computationally expensive? Perhaps there is no need to include this technology, but with greater demand for ‘sandbox’ games surely a procedural planet or universe is the ultimate ‘sandbox’ experience, and is far more efficient than loading the entire world mesh in.&lt;br /&gt;&lt;br /&gt;The algorithms that have previously been used to create these planets are not designed specifically to utilize the GPU effectively. It would be interesting to discover any algorithms that exist which achieve this. Another issue that can be addressed is whether the most commonly used methods such as ROAM can be adapted to work on the graphics card. With the recent advent of the geometry shader; can this be the most effective way to tessellate the mesh?&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;I think that you’ve addressed some great issues here with procedural generation methods. I noticed last year with Matt’s lectures how old all the techniques seem to be, although there is an active community still doing some impressive things with them today. You’re also right to talk about how absent the methods are, with all their positives, in games. Spore is the only one I can think off too that uses them in major ways. I think you should focus on Spore a little, especially on its development and how much it was delayed to see if any conclusions can be drawn to how hard getting these methods to work in a major game.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;With processing going multi core and faster all the time the major con of these methods, computational work, are getting less and less significant. Indeed this increase in processing applies to GPU’s too. With modern graphics cards becoming extremely fast also they could and should be able to handle procedural rendering and it would be interesting to see how they fair leaving the CPU to get on with other things. This will require some low level coding though getting the method’s to work on the GPU and if you’re confident enough then this is fine.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Research question&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What is your current research question?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"In the development of a real-time, procedural, planet for a game situation, what are the techniques for geo-morphing, mesh geometry and texturing that best utilize modern GPU's?"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Addressing the Question&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How do you envisage yourself carrying out the project - a short exposition of the project&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;In order to answer the question and draw reasonable conclusions, I will need to create a procedural planet in a graphics API in this case OpenGL. In order to effectively simulate a games situation the application will include aspects such as collision detection. I will identify the most common techniques used to create a planet (at this stage it appears to be ROAM 2.0) and will then identify the elements of this algorithm that can be implemented on the graphics card and alter the technique to work accordingly. I will then create a planet using this technique. As I am using OpenGL, I will need to discover the element for storing vertex data that works best with shader technology; I think that a Vertex Buffer object is the technique I will use. I will then implement one of the more current algorithms (the one used in the game Frontier: First Encounter) that does not have its roots based in the ‘diamond sub-division’ technique. Finally I will use the Geometry shader to implement the sub-division of the mesh. From this I will be able to conclude the methods that give the best compromise of frame-rate, aesthetics, least mesh construction issues (i.e. cracks and popping) and ease of implementation and decide whether it is worthwhile, in terms of performance; including the planet in a gaming situation.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;This all makes sense. It’s clear you have a good game plan in mind. Using the current techniques and improving on them is smart, such as ROAM, and will lighten your loadto get on with implementing them on the GPU.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Progress&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;What have you managed to do so far and how has this influenced your vision?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Having completed the procedurally generated terrain module last year, I already had a knowledge of some of the basic techniques used in the creation of a small scale terrain, including, faulting, particle deposition and midpoint displacement. However I did not really understand the techniques used to create a planet. I broke the project down into various components; level of detail, texturing and terrain displacement. I identified the most commonly used techniques for each section, such as ROAM, geo-mipmapping, detail mapping, procedural texturing, fractals etc and researched their benefits and drawbacks. It was at this stage that I realized how old many of these algorithms/techniques were. However I began to worry when I could not find any more modern techniques, instead what I discovered was that people kept tweaking the basic algorithms to optimize them. It was at this stage that I wondered why this technology was being overlooked in game development. I felt that this technology had a place in modern gaming and the release of SPORE boosted my confidence. It was fortunate that I decided to research the use of geometry shaders, I did not really understand what they were used for and had no idea they could be employed in my project. Originally I envisioned a hybrid program that tessellated the mesh on the CPU and ported it across to the graphics card. Geometry shaders would allow me to do this on the GPU itself.&lt;br /&gt;&lt;br /&gt;I have begun work on my terrain framework by setting up OpenGL, incorporating CG shader code and creating VBO’s and vertex structs. It was in doing this that the thought occurred to me that the way in which I used the API would have an effect on the performance of my planet. I realized I had to carefully select the methods used to store the vertex data etc.&lt;br /&gt;&lt;br /&gt;Speaking to my technical supervisor has helped shape the vision of the outcome of the project. I was losing focus and was imagining a planet covered in foliage with clouds etc. However Matt Bett reminded me to focus on the relevant tasks, so the perception of my final planet has altered slightly.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;It seems you’re on your way with coding already underway. Your progress so far seems yp to scratch, especially with meeting with Matt. Using the traditional techniques on the GPU will be interesting and if all goes as planned could change the ways game are implemented in the future. Procedural generation but at no or little cost of the CPU could lead to interesting design choices with things such as improved, more resource hungry, AI jumping into the fold for example. I look forward to seeing the results.&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-7705747330554582199?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/7705747330554582199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=7705747330554582199' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7705747330554582199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7705747330554582199'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2008/11/worksheet-4-final-frontier.html' title='Worksheet 4- The Final Frontier'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-6485399326227690146</id><published>2008-11-06T11:43:00.000-08:00</published><updated>2008-11-06T12:11:47.682-08:00</updated><title type='text'>Geometry Shaders: Triangles for everyone!</title><content type='html'>I had read the word 'geometry shader' a fair deal during my research; but wrongly assumed that it was merely a vertex shader designed to handle primitive shapes. However this week I discovered that the two are very different. The geometry shader is executed prior to the pixel shader (PS) but after the vertex shader. Unlike the vertex shader (VS), the geometry shader (GS), takes in a primitive shape, for instance the three vertices of a triangle, and emits more primitives. This is an entirely new concept from the 'one in one out' implementation of the VS and PS.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/__KyV2yFdVEk/SRNPAcNoegI/AAAAAAAAACE/DXYguzptKYE/s1600-h/wgf2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 217px;" src="http://3.bp.blogspot.com/__KyV2yFdVEk/SRNPAcNoegI/AAAAAAAAACE/DXYguzptKYE/s320/wgf2.png" alt="" id="BLOGGER_PHOTO_ID_5265639258318207490" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The benefits of this shader for my proposed application are that the triangles can be tessellated directly on the GPU rather than on the CPU and buffered across; also face normals can be calculated on the GS by passing in the three vertices of each polygon. Obviously the crux of my program is based around the optimum implementation on the GPU; so on first reading this seems to a great deal more effecient than &lt;span style="font-style: italic;"&gt;ROAM &lt;/span&gt;etc&lt;br /&gt;&lt;br /&gt;However I discovered a post of caution on a GameDev forum, posted 2007, stating that the user had problems with performance when implementing a GS. The post said that due to the fact that it was an extremly new technology it was unusably slow. Lets hope performance has improved since then; although I have not seen any similar complaints before or since.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-6485399326227690146?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/6485399326227690146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=6485399326227690146' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/6485399326227690146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/6485399326227690146'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2008/11/geometry-shaders-triangles-for-everyone.html' title='Geometry Shaders: Triangles for everyone!'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/__KyV2yFdVEk/SRNPAcNoegI/AAAAAAAAACE/DXYguzptKYE/s72-c/wgf2.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-5713985859515939906</id><published>2008-11-06T03:07:00.000-08:00</published><updated>2008-11-06T03:36:12.786-08:00</updated><title type='text'>Your once, twice, three times a worksheet....</title><content type='html'>&lt;span style=";font-family:arial;font-size:100%;"  &gt;I had previously forgotten to include the module worksheets on my blog, so here are the three worksheets completed up till now. Basically they track my progress from initial concept until my draft proposal and have been annotated and criticised by other students. Back to normal posts as of next week. I will be researching detail maps and geometry shaders.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:100%;"  &gt;Preliminary Concept&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p style="font-family: arial;"&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:100%;"  &gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:100%;"  &gt;Worksheet 1&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;o:p style="font-family: arial;"&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;b style=""&gt;&lt;i style=""&gt;&lt;span style=""&gt;&lt;br /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;b  style="font-family:arial;"&gt;&lt;span style="" lang="EN-US"&gt;&lt;br /&gt;1.State the topic of      interest that you may wish to take forward into a project.&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;span style="" lang="EN-US"&gt;&lt;br /&gt;Real time generation of planetary bodies; with increasing level of detail.&lt;br /&gt;&lt;/span&gt;&lt;b style=""&gt;&lt;span style="" lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;b style=""&gt;&lt;span style="" lang="EN-US"&gt;&lt;br /&gt;Indicate the issues      surrounding this topic that you may wish investigate.&lt;o:p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="" lang="EN-US"&gt;Most procedurally generated terrains map only onto a flat grid; as there are few times when a game requires an entire planet to be created. One of the main issues is finding a technique which can map to a sphere with little distortion.&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;span style="" lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;A vast number of procedurally generated landscapes use static algorithms such as faulting. These are used to populate a height array which in turn is used to alter the height values of each cell of the mesh. This is fine when creating a terrain on a small scale but with a planet the size of the height array and mesh would need to be huge. I would be investigating more dynamic means of creating the mesh such as ROAMing or other adapting mesh algorithms.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;span style="" lang="EN-US"&gt;&lt;o:p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/o:p&gt;There are many of these algorithms that vary in speed and most of them produce patterns on the terrain that are noticeable from distance.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:Arial;font-size:100%;"  lang="EN-US" &gt;&lt;o:p&gt;&lt;br /&gt;&lt;/o:p&gt;When zooming in and out on the planet it is important to alter the level of detail. It is important to                make the transitions as seamless as possible.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;b style=""&gt;&lt;span style="" lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;b  style="font-family:arial;"&gt;&lt;span style="" lang="EN-US"&gt;3.Outline your initial      ideas about how you would carry out the practical aspects of the project.      i.e. what do you envisage yourself actually doing for the project.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;b style=""&gt;&lt;span style="" lang="EN-US"&gt;&lt;o:p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style="" lang="EN-US"&gt;I will create either a single planet or more likely a selection of planets with varied geological features. I will experiment with different ways to create the planet mesh using various static and dynamic algorithms; and highlight the performance differences. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;span style="" lang="EN-US"&gt;&lt;o:p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/o:p&gt;I will use various combinations of terrain distorting algorithms such as faulting, perlin noise etc to eliminate the repetitive patterns and discuss which have been most successful and whether there is a performance trade off. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;span style="" lang="EN-US"&gt;&lt;o:p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/o:p&gt;I will alter the level of detail as the user zooms in adding basic procedural plants etc the closer the camera gets to a planet, once again I will use a combination of methods to identify the best result.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;span style="" lang="EN-US"&gt;&lt;o:p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Seems well thought out, and that you have considered your topic. I cannot think of anything that could be changed to make any improvement as you seem to have considered everything of major importance.&lt;/span&gt;&lt;/span&gt;&lt;div  dir="ltr" style="font-family:arial;"&gt;&lt;span style="font-size:100%;"&gt; &lt;p style="font-weight: bold;"&gt;Worksheet 2&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Defining a Research Question &lt;/span&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p style="font-weight: bold;"&gt;1. Formulate a research question for your project.&lt;/p&gt;&lt;p&gt; The ROAM(Real-time Optimally adapting mesh) algorithm and other CLOD  (continuous level   of detail) algorithms are based on the diamond sub-division  technique and have been used in       to create large scale procedural terrains since  the mid 90’s. They were not designed to work   on  graphics cards. In developing a  procedural planet what are the alternative CLOD algorithms that best utilize  modern GPU’s?&lt;/p&gt; &lt;p style="font-weight: bold;"&gt;2. When developing a research question you must produce a question that can  be answered by performing literature research, practical experimentation and  critical analysis. question should also focus the activities of your  project.&lt;/p&gt;  &lt;p style="font-weight: bold;"&gt;a)What is the focus of your project?&lt;/p&gt; &lt;p&gt;To identify possible alternative algorithms to the most commonly used  technique, diamond subdivision style, that work to utilize modern GPU’s. In  order to use ROAM on the graphics card the algorithm must be tweaked to send the  vertex array data every frame to the gpu. This can create bottlenecks on the  graphics pipeline. &lt;/p&gt; &lt;p&gt;Are the alternative modern algorithms better than the current ROAM method and  if so which one is the best?&lt;/p&gt;  &lt;p style="font-weight: bold;"&gt;b)    What information do you need to find out about?&lt;/p&gt;  &lt;p&gt;I need to find out about the nested quad tree algorithm and the tessalation  algorithm (non-RTIN equilateral spiral wound view dependant mesh). I need to  find out exactly why roam is still used so often despite it not being optimized  to work on GPU’s.&lt;/p&gt; &lt;p&gt;I also must identify which terrain techniques (i.e. fractals, midpoint  displacement, faulting) work best with each algorithm.&lt;/p&gt;  &lt;p style="font-weight: bold;"&gt;c)     What Experimental work do you need to perform?&lt;/p&gt;  &lt;p&gt;I need to create a procedural planet algorithm using the tweaked ROAM method  of CLOD and the same planet using the other CLOD methods. I must incorporate  into this a variety of procedural techniques to alter the terrain such as  faulting and fractals. Each planet will be rendered using the graphics card.&lt;/p&gt;  &lt;p style="font-weight: bold;"&gt;3. How will the information that you obtain in 2 allow you to answer the  research question?&lt;/p&gt; &lt;p&gt;I need to compare the frame rate, the aesthetic value, how smoothly each  planet morphs between detail levels and which algorithm produces the fewest  ‘cracks’ in the terrain and come to a conclusion on which one is best. I must  also take into consideration how simple each algorithm is to implement. By  studying how each algorithm works I will be able to suggest a hypothesis about  which algorithm will be best.&lt;/p&gt; &lt;p style="color: rgb(51, 204, 255);"&gt;Well overall you seem to have a good  idea on what you are wanting to do for your honours project. SO therefore the  only thing i'm going to do istTo give you a head start and that would be to go  and get the focus on the 3d terrain book from the library. GO NOW! The first  four chapters you don't need to read but after that its got everything you need  to know about ROAM, clod and even quadtree algorithms. Infact it even talks  about some algorithms that have been optimized and freindly for the GPU. But  remember when you take out the book please get the c.d. That has plenty of  whitepapers on other people's algorithms. But yeah i hope i was a better help  than your last guy. I would go on to speak about your ups and downs of these  algorithms but all this information is in that book, just means you have a  little bit of reading to do. I hope thats ok with  you.&lt;/p&gt;&lt;p&gt;  &lt;/p&gt;&lt;/span&gt;&lt;p class="MsoNormal" style="margin: 0in 1.1in 0.0001pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="letter-spacing: 0.4pt;" lang="EN-US"&gt;Draft Proposal&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 1.1in 0.0001pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="letter-spacing: 0.4pt;" lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 1.1in 0.0001pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="letter-spacing: 0.4pt;" lang="EN-US"&gt;2&lt;sup&gt;nd&lt;/sup&gt; November 2008&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 1.1in 0.0001pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 1.1in 0.0001pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="letter-spacing: 0.4pt;" lang="EN-US"&gt;Introduction&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 14pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="letter-spacing: 0.4pt;" lang="EN-US"&gt;What is the aim of the project (general overview)?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 14pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="letter-spacing: 0.4pt;" lang="EN-US"&gt;The aim of the project is to identify the methods used to implement a real-time procedural planet, in a game situation; that make the best use of modern graphics cards. The methods that will be investigated are algorithms for texturing, mesh geometry and level of detail.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 14pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="letter-spacing: 0.4pt;color:red;"  lang="EN-US"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Interesting topic, especially with regards to games such as Spore and Eve Online, which either do not bother with further detail on planets (you can only orbit) or stutter as the game loads up new models to display the planet.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 14pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="letter-spacing: 0.4pt;" lang="EN-US"&gt;Motivation&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="NoSpacing"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span lang="EN-US"&gt;Why do you want to do this and why would anybody be interested in what you want to do?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="NoSpacing"&gt;&lt;span style="font-size:100%;"&gt;&lt;span lang="EN-US"&gt;The concept of procedural terrain has been around for many years, however only a select few games have implemented large-scale terrains in a game. The most common implementation of procedural planets are for artistic purposes, such as F. Kenton Musgrave’s &lt;i style=""&gt;Mojoworld. &lt;/i&gt;However these are rendered as an offline process. Now that modern graphics technology has improved dramatically in the last ten years, I wondered why so few games make use of procedural planets as they allow for unique, natural looking terrain to be produced quickly and frequently; especially given the current demand for ‘sandbox’ worlds, surely an entire planet or universe is the ultimate ‘sandbox’. The most widely used techniques for procedural planet generation date from the early to mid 90’s and are not designed to effectively work on GPU’s. I thought it would be interesting to find out what algorithms there are that utilize the GPU most effectively or whether the current algorithms, such as ROAM can be modified to work on GPU’s. Ultimately this will enable me to conclude whether it is feasible to incorporate a procedural planet into a gaming environment.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="NoSpacing"&gt;&lt;span style="font-size:100%;"&gt;&lt;span  lang="EN-US" style="color:red;"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;I think you are correct in believing that this topic will generate interest as it's based around two currently popular topics- procedural content and utilising the GPU's processing power. I also agree with your statements on an infinite universe being the ultimate sandbox. The notion that you and a friend could both play the same game but have completely different experiences due to the shape of the geography is quite attractive.&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 14pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="letter-spacing: 0.4pt;" lang="EN-US"&gt;Research question&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;    &lt;p class="MsoNormal" style="margin: 14pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="line-height: 115%; color: rgb(0, 0, 0);"&gt;"In the development of a real-time, procedural, planet for a game situation, what are the techniques for geo-morphing, mesh geometry and texturing that best utilize modern GPU's?"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="letter-spacing: 0.4pt;" lang="EN-US"&gt;Addressing the Question&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 14pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="letter-spacing: 0.4pt;" lang="EN-US"&gt;What will be done to answer the question?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 14pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="letter-spacing: 0.4pt;" lang="EN-US"&gt;In order to answer the question and draw reasonable conclusions, I will need to create a procedural planet in a graphics API such as OpenGL. In order to effectively simulate a games situation the application will include aspects such as collision detection. I will identify the most common techniques used to create a planet for example, &lt;i style=""&gt;ROAM, Geomipmapping etc &lt;/i&gt;and&lt;span style=""&gt;  &lt;/span&gt;will then identify the elements of these algorithms that can be implemented on the graphics card and alter the techniques to work accordingly. I will then create a planet using this technique. As I am using OpenGL, I will need to discover the element for storing vertex data that works best with shader technology; I think that a Vertex Buffer object is the technique I will use. I will then implement one of the more current algorithms (the one used in the game &lt;i style=""&gt;Frontier: First Encounter&lt;/i&gt;) that does not have its roots based in the ‘diamond sub-division’ technique. From this I will be able to conclude the methods that give the best compromise of frame-rate, aesthetics, least mesh construction issues (i.e. cracks and popping) and ease of implementation and decide whether it is worthwhile, in terms of performance; including the planet in a game&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 14pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="letter-spacing: 0.4pt;color:red;"  lang="EN-US"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;This description gives a clear and informed explanation of the project's implementation. There does not appear to be any obvious area that you have missed out, as framework, algorithms, further research and success definition have all been listed.&lt;/span&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 14pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;u&gt;&lt;span style="letter-spacing: 0.4pt;" lang="EN-US"&gt;Resource Requirements&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 14pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;b style=""&gt;&lt;span style="letter-spacing: 0.4pt;" lang="EN-US"&gt;What equipment/resources will be needed/used?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 14pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="letter-spacing: 0.4pt;" lang="EN-US"&gt;The implementation of my project will not require much equipment. However I will need to create an OpenGL framework in &lt;i style=""&gt;Microsoft Visual Studio 2005&lt;/i&gt;. The framework will need to incorporate CG pixel and vertex shaders. I will be using a &lt;i style=""&gt;Nvidia 9600GT &lt;/i&gt;graphics card to run my application and will be testing the results on a ‘Duo Core’ and ‘Quad Core’ system. The algorithms that I will be using for the displacement of the terrain will be a mixture of &lt;i style=""&gt;faulting, fractal Brownian motion, Perlin noise &lt;/i&gt;and &lt;i style=""&gt;particle deposition.&lt;/i&gt; The level of detail techniques that I will be using are &lt;i style=""&gt;ROAM 2.0, &lt;/i&gt;and&lt;i style=""&gt; Triangle Tessellation Structured. &lt;/i&gt;Finally I will use procedural texture generation and detail maps to colour the planet dependant on height, latitude and normal angle.&lt;i style=""&gt; &lt;/i&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 14pt 0in; line-height: normal;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="letter-spacing: 0.4pt;color:red;"  lang="EN-US"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;Again, solid list of requirements detailing everything required. The only thing not mentioned is how you plan to measure your success definition. Performance would presumably be a frame rate counter and aesthetics will either be self-defined or surveying a few people's opinions. The hardest to measure will be ease of implementation- after months of working on it the code will be known inside out, but I can not think of an alternate to personal assessment.&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;&lt;p class="MsoNormal"  style="margin-left: 0.5in;font-family:arial;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-5713985859515939906?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/5713985859515939906/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=5713985859515939906' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/5713985859515939906'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/5713985859515939906'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2008/11/your-once-twice-three-times-worksheet.html' title='Your once, twice, three times a worksheet....'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-7610628534223608401</id><published>2008-10-24T06:18:00.000-07:00</published><updated>2008-10-24T08:41:48.468-07:00</updated><title type='text'>Gentlemen. Start your engines!</title><content type='html'>I mentioned last week that I was going to implement a basic subdivision algorithm; however I forgot that I really needed a framework first. I had trouble deciding whether to use one of the graphics API's or a game engine such as OGRE. I eventually decided to use OpenGL, for no other reason that it is the API I am most familiar with.  I created my OpenGL framework based on the &lt;span style="font-style: italic;"&gt;NeHe window - http://nehe.gamedev.net &lt;/span&gt;and organised it into a more class based system. Although the actual implementation will not begin until Christmas I felt it was important to create the basic framework and perform some experiments; this will let me identify any issues I could focus on during research.&lt;br /&gt;&lt;br /&gt;There was nothing left to do but start.....It was at this point I realised that no paper on spherical CLOD that I have read mentions the best way to store the vertices, so I decided to go with my own intuition and use VBO's as they make good use of the GPU. I had a few problems initialising the VBO framework but this was due to GL extension file issues and after much frustration, tantrums and linking errors they finally worked.&lt;br /&gt;&lt;br /&gt;Good. Next task was to decide on the basic shape. The obvious starting point is a geosphere but this is really quite difficult to plot and I was not in the mood by this point. I read that plotting a cube works equally as well and with enough subdivisions morphs into a sphere (although it does take more splits) and thankfully it is alot easier to plot the vertices of a cube.&lt;br /&gt;&lt;br /&gt;Now I just need to set up the member pointers of each polygon and its neighbours at a later date. This, thankfully, is much easier to initialise with a cube too.&lt;br /&gt;&lt;br /&gt;I have tweaked my research question slightly which ties it to computer games technology more.&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: center;"&gt;&lt;span style="color: rgb(102, 255, 255); font-style: italic;font-family:Arial;font-size:100%;"  &gt;&lt;strong&gt;"In the devlopment of a realtime, procedural planet for a game situation, what are the techniques for geomorphing and texturing that best utilize modern GPU's?"&lt;/strong&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&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/8237926955425869206-7610628534223608401?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/7610628534223608401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=7610628534223608401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7610628534223608401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/7610628534223608401'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2008/10/gentlemen-start-your-engines.html' title='Gentlemen. Start your engines!'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-5462610309320006647</id><published>2008-10-20T04:14:00.000-07:00</published><updated>2008-10-23T06:14:55.919-07:00</updated><title type='text'>God said "Let there be textures"</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/__KyV2yFdVEk/SPxxd5MOGTI/AAAAAAAAABI/0yMzZdO5NyA/s1600-h/gaea.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5259203223244118322" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: pointer; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/__KyV2yFdVEk/SPxxd5MOGTI/AAAAAAAAABI/0yMzZdO5NyA/s320/gaea.jpg" border="0" /&gt;&lt;/a&gt;This week I decided to investigate (briefly) how I was going to texture my planet. I must admit that, at first, texturing was something of an afterthought. I was always planning on texturing my planet, however this was not really going to be a focal point in my investigation. Fortunately my technical supervisor highlighted the fact that at a far distance texturing is all that matters; as the geometry of the planet (the terrain displacement) need not come into effect til the user is close enough to the terrain to actually view it. Texturing can also bring the planet to life and can help compensate for slightly unnatural looking terrain.&lt;br /&gt;My plan is to separate texturing into two parts. Firstly from a far view point (i.e. space). I feel that from this distance the optimal thing to do is to load in several levels of discrete textures (a bit like mipmapping). These will vary in level of detail until the camera reaches a certain altitude. This is more efficient than generating textures every frame when the camera is so far away from the planet that it can only make out the shapes of land and sea.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/__KyV2yFdVEk/SPxxHtDHpxI/AAAAAAAAABA/BlW5miEP6_0/s1600-h/planet2.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5259202842027599634" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: pointer; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/__KyV2yFdVEk/SPxxHtDHpxI/AAAAAAAAABA/BlW5miEP6_0/s200/planet2.jpg" border="0" /&gt;&lt;/a&gt;The next section will involve using the pixel shader to generate the textures. The textures will be generated based on height, angle of incline and distance from the equator (by latitude). There is a good section in the book "Texturing and Modelling: A Procedural Approach" on how to shade with a &lt;span style="FONT-STYLE: italic"&gt;matte&lt;/span&gt; effect to create nice earth textures.&lt;br /&gt;&lt;br /&gt;Im thinking about knocking up a quick planet sometime in the next few weeks to implement the diamond sub-division algorithm and no doubt that will raise a few issues!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-5462610309320006647?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/5462610309320006647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=5462610309320006647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/5462610309320006647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/5462610309320006647'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2008/10/god-said-let-there-be-textures.html' title='God said &quot;Let there be textures&quot;'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/__KyV2yFdVEk/SPxxd5MOGTI/AAAAAAAAABI/0yMzZdO5NyA/s72-c/gaea.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-8872483308335708453</id><published>2008-10-13T05:58:00.000-07:00</published><updated>2008-10-16T03:38:26.267-07:00</updated><title type='text'>Research Question &amp; Finally another CLOD algorithm!</title><content type='html'>&lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;Yesterday; I finally narrowed down this procedural topic to a specific research question. The question had to address a problem with this area of computer games. I was debating whether to go with a broad topic such as the implementation of entire procedural planets in games but Spore blew that out the water by implementing an entire procedural universe. I will research the methods that Spore used to achieve, this but from an early stage in my research I discovered that ROAM, although an older algorithm, was still the method of choice. I decided that I would like to investigate alternative algorithms (i.e. ones that were not based on the diamond sub-division technique) however this seemed to present a problem...I could not find any! Thankfully yesterday provided a bit of a breakthrough and I found a gateway to alternative level of detail algorithms. My question was decided: &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-family:Arial;"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;span style="color: rgb(0, 204, 255);font-family:Arial;" &gt;&lt;span style="font-weight: bold;"&gt;" In developing a procedural planet what are the alternative CLOD algorithms, to the diamond sub-division, for geometry and textures that best utilize modern GPU’s?&lt;/span&gt;"&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="text-align: center;" align="center"&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 204, 255);font-family:Arial;" &gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="letter-spacing: 0.2pt;font-family:Arial;"  lang="EN-US"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-bottom: 12pt;"&gt;&lt;span style="letter-spacing: 0.2pt;font-family:Arial;"  lang="EN-US"&gt;Basically I intend to identify which algorithm produces the best results, in terms of speed and aesthetics, when creating an entire procedural planet. Hopefully by comparing several algorithms I will be able to identify the pros and cons for each one, the ease of implementation and draw conclusions on which one is best or perhaps suggest a hybrid of the methods.&lt;/span&gt;&lt;b style=""&gt;&lt;span style="letter-spacing: 0.2pt;font-family:Arial;"  lang="EN-US"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 12pt;"&gt;&lt;b style=""&gt;&lt;span style="letter-spacing: 0.2pt;font-family:Arial;"  lang="EN-US"&gt;An alternative Approach&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;      &lt;p class="MsoNormal" style="margin-bottom: 12pt;"&gt;&lt;span style="letter-spacing: 0.2pt;font-family:Arial;"  lang="EN-US"&gt;One of the alternative CLOD algorithms that I found was the triangle tessellation algorithm suggested by Andrew True in his &lt;a href="http://www.gamedev.net/reference/articles/article2074.asp"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;"Procedural Planets"&lt;/span&gt;&lt;/a&gt; article. This algorithm dictated what to render based on the viewpoint of the user. One of the major differences between that and the diamond method is that the sphere mesh is created in a spiral of polygons. Apparently this is the technique used in the game Frontiers: First Encounters.&lt;o:p&gt;&lt;/o:p&gt; The structure starts with a basic triangle, each triangle can be affected by one of two procedures, it can be split to form four child triangles or, if it has a parent, can be combined. Each triangle must keep track of its three neighbours and whether that neighbour is a child, parent or an edge. A triangle cannot split so that it becomes 2 orders above that of its neighbour, for instance if I have four kids and my neighbour has none, he must split before I can. A split is achieved by finding the midpoint of each edge and creating four new children. Effectively to see more of the planet the triangles are combined by deleting the child nodes. A triangle cannot be combined if it has 'grandchildren'.&lt;br /&gt;&lt;br /&gt;Two of the biggest advantages of this algorithm over ROAM is that it uses less recursions to split and combine and the philosophy of the algorithm is don't have cracks in the first place! ROAM creates cracks in the mesh when a large triangle is neighboured by smaller triangles which try to distort. ROAM distorts triangles as it splits or combines them and this often results in children being displaced before there parents have been split. ROAM then tries to connect the now larger triangle with the other triangles by dividing the large triangle in as few loops as possible; the new algorithm just avoids cracks from the outset. It achieves this by only distorting a triangle if the neighbour of that triangle has children; the grandchildren are then also given permission to distort. If we are not split then our children have not been displaced and as a result our children cannot be displaced until we have been split.&lt;br /&gt;&lt;br /&gt;Hopefully this algorithm will prove quicker than ROAM and more efficient as recursions are not wasted trying to fill gaps in the geometry.&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal" style="margin-bottom: 12pt;"&gt;Next Post: I have been pointed in the direction of an optimized version of &lt;span style="font-style: italic;"&gt;ROAM  &lt;/span&gt;called &lt;span style="font-style: italic;"&gt;SOAR&lt;/span&gt;, so I am going to read up on that. I should probably now begin to focus on the texturing aspect of the planet, as the geometric LOD only comes into play when the camera comes close enough to view the terrain, at all other times the textures will convey the detail level.&lt;br /&gt;&lt;span style="letter-spacing: 0.2pt;font-family:Arial;"  lang="EN-US"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;u1:p&gt;&lt;/u1:p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-8872483308335708453?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/8872483308335708453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=8872483308335708453' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/8872483308335708453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/8872483308335708453'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2008/10/research-question-finally-another-clod.html' title='Research Question &amp; Finally another CLOD algorithm!'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-8299982635682214972</id><published>2008-10-12T07:13:00.000-07:00</published><updated>2008-10-16T05:44:31.437-07:00</updated><title type='text'>ROAM - What is it? What are its problems?</title><content type='html'>I feel that the &lt;span style="font-style: italic;"&gt;ROAM &lt;/span&gt;algorithm will become such an integral part of my dissertation and application that it is best to identify what exactly it does, why it is used and what are its drawbacks. &lt;span style="font-style: italic;"&gt;ROAM &lt;/span&gt;(Real-time Optimally Adapting Mesh) is a continuous level of detail algorithm, used when creating vast procedural terrains. It uses quad trees to subdivide the mesh's triangles; allowing the program to concentrate a higher number of polygons at the area of the terrain that the camera is viewing. A triangle is split along its mid-point. The order is decided by assigning each triangle a 'split priority'. Effectively this means that although there are only ever a fixed number of polygons on screen and that a patch of terrain is allocated more polygons and therefore has a higher level of detail. This is done by merging triangles that aren't being viewed. A triangle can only be merged if its in a diamond step.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/__KyV2yFdVEk/SPIMHzooLdI/AAAAAAAAAAo/_vycUWd0tvg/s1600-h/equilateral_ccl_roam.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/__KyV2yFdVEk/SPIMHzooLdI/AAAAAAAAAAo/_vycUWd0tvg/s320/equilateral_ccl_roam.jpg" alt="" id="BLOGGER_PHOTO_ID_5256277043354021330" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;ROAM  &lt;/span&gt;'walks' its quad-trees every frame, checking every vertex of the mesh to identify if a new split or join is required and must also alter the positional data of any vertex that has now changed (i.e. this vertex is now used in a mountain, its y value has increased). In order to utilize the power of modern graphics cards the data must be transferred quickly and compactly. This usually means using vertex arrays or VBO's. As&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt; &lt;/span&gt;ROAM &lt;/span&gt;allows for the insertion and deletion of vertices, the algorithm is not suited to fixed array sizes and this is why it is often never used in conjunction with the GPU.&lt;br /&gt;&lt;br /&gt;However the algorithm does allow for smooth morphing of terrain and does account for cracks in the terrain created by the diamond subdivision technique that &lt;span style="font-style: italic;"&gt;ROAM &lt;/span&gt;uses and &lt;span style="font-style: italic;"&gt;ROAM &lt;/span&gt;is very good at what it does it was just never designed to work on the graphics card.&lt;br /&gt;&lt;br /&gt;Ideally an algorithm that splits the terrain in various sections would be the most efficient. By dividing the terrain into smaller sections only one array would need to be updated when the terrain altered allowing the other to 'remain' on the GPU. This means only transferring one smaller array each frame.&lt;br /&gt;&lt;br /&gt;Next Post - Research Question &amp;amp; Alternative CLOD algorithms.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-8299982635682214972?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/8299982635682214972/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=8299982635682214972' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/8299982635682214972'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/8299982635682214972'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2008/10/roam-what-is-it-what-are-its-problems.html' title='ROAM - What is it? What are its problems?'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/__KyV2yFdVEk/SPIMHzooLdI/AAAAAAAAAAo/_vycUWd0tvg/s72-c/equilateral_ccl_roam.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-5450764799948137483</id><published>2008-10-09T03:01:00.000-07:00</published><updated>2008-10-09T06:35:52.696-07:00</updated><title type='text'>Level of Detail and Terrain Algorithms</title><content type='html'>I have been assigned a technical supervisor to help me conquer procedural planets. I am going to arrange a meeting to help identify the areas I should focus on in order to formulate a research question. I was debating whether to do a 'compare and contrast' between static meshes and dynamic meshes. However it seems that nobody in the world would ever use a static mesh for this kind of application as the memory issues are to great. I am tending toward a study of the pros and cons of CLOD (continuous level of detail) algorithms Vs DLOD (discrete level of detail algorithms) or a comparison of different CLOD techniques.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/__KyV2yFdVEk/SO3er5cv6NI/AAAAAAAAAAU/4M-TFspJtSA/s1600-h/roam1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 291px; height: 291px;" src="http://2.bp.blogspot.com/__KyV2yFdVEk/SO3er5cv6NI/AAAAAAAAAAU/4M-TFspJtSA/s320/roam1.png" alt="" id="BLOGGER_PHOTO_ID_5255101185948379346" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;I have done a bit of research into various LOD algorithms and it appears that  ROAM is the technique of choice; due to it's speed and it's simpleness. DLOD requires a variety of pre-defined meshes at varying detail level. As the user zooms in and out these are loaded in order. CLOD adapts the terrain depending on the user distance from the mesh. At any level there will be the same number of polygons on screen, they will just be arranged differently. ROAM achieves this by subdividing triangles; triangles out with the viewing plane are ignored. ROAM is an older algorithm and is not designed to work on GPUS's and does not make use of systems with multiple cores. It would be interesting to see how a modern CLOD algorithm compares.&lt;br /&gt;&lt;br /&gt;I could also do study evaluating the various procedural terrain techniques. I did discover that not all the techniques are suited to CLOD. I have worked with a few algorithms previously so am familiar with them; however the techniques must be altered to work on a sphere rather that a plane. The stipulations for the algorithms are that they must work over a large scale, must be quick and require as little smoothing as possible and must be able to be altered in a 'local' space (i.e. the area on screen) without changing the whole noise mesh.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/__KyV2yFdVEk/SO3e2Xb6WqI/AAAAAAAAAAc/VIzX7xH7mb8/s1600-h/lod.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 283px; height: 286px;" src="http://3.bp.blogspot.com/__KyV2yFdVEk/SO3e2Xb6WqI/AAAAAAAAAAc/VIzX7xH7mb8/s320/lod.JPG" alt="" id="BLOGGER_PHOTO_ID_5255101365796625058" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;Various sources say that the &lt;span style="font-style: italic;"&gt;Midpoint Displacement &lt;/span&gt;algorithm is usually used with ROAM and &lt;span style="font-style: italic;"&gt;Perlin Noise &lt;/span&gt;is ideal for the various detail levels.  &lt;span style="font-style: italic;"&gt;Midpoint Displacement &lt;/span&gt;can lead to a large number of 'cracks' or ridges in the terrain. &lt;span style="font-style: italic;"&gt;Faulting &lt;/span&gt;is useful when used sparingly as it makes the terrain appear more natural, however it can require a lot of smoothing to appear undulated.&lt;br /&gt;&lt;br /&gt;Tasks for next week:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Identify alternate CLOD algorithms.&lt;/li&gt;&lt;li&gt;Meet with Tutor&lt;/li&gt;&lt;li&gt;Form Research Question&lt;/li&gt;&lt;/ul&gt;&lt;div style="text-align: center;"&gt;&lt;span style="color: rgb(102, 255, 255); font-weight: bold;"&gt;With any luck we will make a planet yet....I'm feeling a bit God-like only without the beard.&lt;/span&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/8237926955425869206-5450764799948137483?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/5450764799948137483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=5450764799948137483' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/5450764799948137483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/5450764799948137483'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2008/10/level-of-detail-and-terrain-algorithmsa.html' title='Level of Detail and Terrain Algorithms'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/__KyV2yFdVEk/SO3er5cv6NI/AAAAAAAAAAU/4M-TFspJtSA/s72-c/roam1.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-8681169555652491324</id><published>2008-09-28T08:20:00.000-07:00</published><updated>2008-09-30T06:43:42.859-07:00</updated><title type='text'>Topic Has Been Chosen People....</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/__KyV2yFdVEk/SN-mL2mP5RI/AAAAAAAAAAM/2mjRihDoGTc/s1600-h/spore_planet.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5251098413101999378" style="margin: 0px auto 10px; display: block; text-align: center;" alt="" src="http://4.bp.blogspot.com/__KyV2yFdVEk/SN-mL2mP5RI/AAAAAAAAAAM/2mjRihDoGTc/s320/spore_planet.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;Its as much as surprise to me as to anyone, that after a bit of light research, I have decided to stick with the topic I had originally planned to do; and not switch to modelling porcupine behaviour.&lt;br /&gt;&lt;br /&gt;I have decided to investigate and hopefully do some writing about..."&lt;em&gt;Real time generation of planetary bodies; with increasing level of detail".&lt;/em&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;div style="text-align: left;"&gt;This will ultimately involve creating a number of planets, each with varied geological features, in real time (i.e not loading in a pre-built mesh). The program will enable the user to zoom in and out and the level of detail will adjust accordingly (and with any luck smoothly) to show plants, grass beaches or just mountains and oceans. The main aim of the investigation will be identify the best methods of achieving this and comparing and contrasting existing static and dynamic algorithms. I will then discuss the performance and aesthetic issues of each combination of techniques. I envisage some &lt;em&gt;spore &lt;/em&gt;style mini planets rather than full blown gas giants, but the principle is the same.&lt;br /&gt;&lt;br /&gt;Having only done brief research over tea and biscuits I should probably do some heavy reading on &lt;em&gt;distorting a spherical mesh, ROAMing (Realtime adapting mesh algorithms), dynamic LOD algorithms &lt;/em&gt;and &lt;em&gt;procedural texturing and plant life &lt;/em&gt;(luckily I know of a book "Modelling hairy plants"!). Basically this is what I will be doing over the next week. Oh and I'll hopefully have an actual question to research within the next couple of weeks.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;"In the event that my idea and beautifully written concept document get torpedoed at the first hurdle then....forget everything I just said!"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style="color: rgb(51, 204, 255);"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-8681169555652491324?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/8681169555652491324/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=8681169555652491324' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/8681169555652491324'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/8681169555652491324'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2008/09/topic-has-been-chosen-people.html' title='Topic Has Been Chosen People....'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/__KyV2yFdVEk/SN-mL2mP5RI/AAAAAAAAAAM/2mjRihDoGTc/s72-c/spore_planet.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8237926955425869206.post-4162048005645976319</id><published>2008-09-28T06:44:00.000-07:00</published><updated>2008-09-28T06:47:56.075-07:00</updated><title type='text'>Why Blog?</title><content type='html'>The purpose of this blog is to act as a log of the events and progress of my 4th year honours project. The first task will be to decide on a topic to study....I'm thinking some kind of procedural world generation but let's be honest who knows! &lt;em&gt;Bring on the realistic plants!&lt;/em&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8237926955425869206-4162048005645976319?l=downies1stclassblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://downies1stclassblog.blogspot.com/feeds/4162048005645976319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8237926955425869206&amp;postID=4162048005645976319' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/4162048005645976319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8237926955425869206/posts/default/4162048005645976319'/><link rel='alternate' type='text/html' href='http://downies1stclassblog.blogspot.com/2008/09/why-blog.html' title='Why Blog?'/><author><name>Scott Downie</name><uri>http://www.blogger.com/profile/01625620288950720926</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/__KyV2yFdVEk/SP0mc9IAx9I/AAAAAAAAABU/Wh9wK7vH4Kg/S220/DSC00041.JPG'/></author><thr:total>0</thr:total></entry></feed>
