<?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-6207239601092653215</id><updated>2011-07-08T05:06:56.104-07:00</updated><category term='deferred rendering'/><category term='3D engine design'/><category term='elite'/><category term='z pre-pass rendering'/><category term='pegwars'/><category term='intro'/><title type='text'>pegwars : political economic and galactic warfare</title><subtitle type='html'>pegwars : political economic and galactic warfare</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>19</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-7932367185156972732</id><published>2011-06-28T02:25:00.001-07:00</published><updated>2011-06-28T02:34:34.846-07:00</updated><title type='text'>Screen-Space Directional Occlusion</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/-nJHTPVNtOJk/TgmeunF750I/AAAAAAAAAF4/9jqLibCU93o/s1600/0070.bmp" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 320px; height: 181px;" src="http://1.bp.blogspot.com/-nJHTPVNtOJk/TgmeunF750I/AAAAAAAAAF4/9jqLibCU93o/s320/0070.bmp" border="0" alt="" id="BLOGGER_PHOTO_ID_5623200133353826114" /&gt;&lt;/a&gt;&lt;img src="http://1.bp.blogspot.com/--Nas5BvpLP4/TgmftBklCaI/AAAAAAAAAGA/1JbkZpWbVnY/s320/0069.bmp" style="cursor:pointer; cursor:hand;width: 320px; height: 181px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5623201205613562274" /&gt;&lt;br /&gt;Now I have the screen-space directional occlusion working well, here's a pic :)  The model I found in the standard Max scenes, I wanted some better geometry to test the lighting than my crappy programmer art.&lt;div&gt;The scene has just one diffuse shadow-casting spotlight, and the SSDO provides all the rest of the colour, using the environment cube.  Note the orange shining on the sides of the crazy model, with occlusion occuring in its upper fins.  And the same model, with a different environment.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is going to look great when weather changes roll in, or during sunsets around planets, or going into nebulae out in space..&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&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/6207239601092653215-7932367185156972732?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/7932367185156972732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2011/06/screen-space-directional-occlusion.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/7932367185156972732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/7932367185156972732'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2011/06/screen-space-directional-occlusion.html' title='Screen-Space Directional Occlusion'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-nJHTPVNtOJk/TgmeunF750I/AAAAAAAAAF4/9jqLibCU93o/s72-c/0070.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-2753959709598482665</id><published>2011-06-08T07:57:00.000-07:00</published><updated>2011-06-08T08:05:43.099-07:00</updated><title type='text'>Screen-Space Ambient</title><content type='html'>Currently, I'm still doing a lot of this using multiple forward-rendering geometry passes, when they could instead be using screen-space techniques.  I have done this so far as the performance for what I'm trying is fine, and it aids debugging greatly to be able to easily turn off entire passes.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However since the lighting was added in, with arbitrary numbers of lights (5 shadow-mapped lights now being used), then engine has slowed down greatly.  Time to revisit the render channels.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Ambient Lighting is an obvious task here.  Currently, I draw the depth/normals map, create the ambient cube map, calculate SSDO, and then - using forward-pass geometry - draw the ambient lighting into the scene, looking up SSDO and the ambient cube map.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However the screen-space data is all there ready to be used - screen space normals and SSDO.  Additionally, the screen-space fogging that fades the scene out to the ambient cube map is almost identical to what I want to do.  So hell, let's do it!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;Adding Screen-space Ambient&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Add a new &lt;b&gt;RenderChannel &lt;/b&gt;and &lt;b&gt;generateSSAmbient()&lt;/b&gt; to &lt;b&gt;CameraScene.py&lt;/b&gt;&lt;/div&gt;&lt;div&gt;2. Create &lt;b&gt;data/screen_space_ambient.xml &lt;/b&gt;- copied from &lt;b&gt;data/fog.xml&lt;/b&gt; as the effect is similar&lt;/div&gt;&lt;div&gt;3. Create &lt;b&gt;shaders2/post/ssambient.vs3&lt;/b&gt; and &lt;b&gt;.ps3&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;NOT SURE WHY : can't blend in the SSDO results in texture stage 3.  Just cant seem to be able to read the texture map&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;4. Remove old ambient lighting path&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Difference&lt;/div&gt;&lt;div&gt;==========&lt;/div&gt;&lt;div&gt;old way : 3098 / 34134 draw commands 99.1msec&lt;/div&gt;&lt;div&gt;new way : 2564 / 31921 draw commands 89.9msec&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Apart from the issue mentioned above, the new screen-space ambient lighting looks exactly like the old forward-render ambient lighting, except the number of draw-calls drops by about 20% and the render time drops by 10%.  And there are many more instances of this kind of rendering optimisation just waiting to be done..&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6207239601092653215-2753959709598482665?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/2753959709598482665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2011/06/screen-space-ambient.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/2753959709598482665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/2753959709598482665'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2011/06/screen-space-ambient.html' title='Screen-Space Ambient'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-1131152535041993064</id><published>2011-06-08T07:32:00.000-07:00</published><updated>2011-06-08T07:56:06.365-07:00</updated><title type='text'>Optimising the procedural scene generator</title><content type='html'>&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;First of all, its crazy doing procedural scene generation and the scene graph in Python.  When you're dealing with 1000's of tiles, c++ is a far better match.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;However, in keeping with the spirit of things, let's try and optimise the Python procedural scene first, as any high-level optimisations done are still likely to be beneficial after porting (and easier to prototype in Python!)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Step 1 in any optimisation is profiling, to see where we need to optimise.  Here's a snippet from my results&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;================================&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;BEFORE - &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;47% in RenderChannelStrip.render&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;================================&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;   ncalls  tottime  percall  cumtime  percall filename:lineno(function)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;     3731   23.980    0.006   23.980    0.006 K:\Pegwars\current\Scripts\PyStingray\RenderChannelStrip.py:47(render)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;    44150    2.884    0.000    2.884    0.000 d:\Pegwars\current\Scripts\Scene\Object.py:39(bind)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;      287    2.862    0.010    3.243    0.011 d:\Pegwars\current\Scripts\Frustum\FarPlane.py:13(cull)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;  2525213    2.594    0.000    2.594    0.000 {method 'append' of 'list' objects}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;     2009    2.514    0.001    2.542    0.001 d:\Pegwars\current\Scripts\Scene\ObjectPool.py:27(updateObjectList)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;     1724    2.240    0.001    3.550    0.002 {method 'sort' of 'list' objects}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;1723/1436    2.215    0.001   47.822    0.033 d:\Pegwars\current\Scripts\PyStingray\UpdateChannelStrip.py:24(tick)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;     1435    2.152    0.001    3.939    0.003 d:\Pegwars\current\Scripts\Frustum\Light.py:15(cull)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;   351862    1.357    0.000    1.357    0.000 d:\Pegwars\current\Scripts\Scene\Object.py:71(tick)&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;There are two obvious candidates here, UpdateChannelStrip.tick is taking up twice as much time as rendering.  And python 'append' and 'sort' of 'list' objects take a long time.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now Citypieces only need worldobject-&amp;gt;tick() called once ever, when they are created, to set up their c++ reference frame.  Try a onceOnly updateChannelStrip for these, OR try calling wo-&amp;gt;tick() directly in creation.  Anyone with logic units should keep on ticking().  Anyone without can probably do without.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And the python ObjectPool  is currently using lists for 1000s of objects, and calling del() on objects - linear search!  Change this to use set logic.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;================================&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;AFTER - 62% in RenderChannelStrip.render&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;================================&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;   ncalls  tottime  percall  cumtime  percall filename:lineno(function)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;     4433   27.502    0.006   27.502    0.006 K:\Pegwars\current\Scripts\PyStingray\RenderChannelStrip.py:47(render)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;      341    3.394    0.010    3.828    0.011 d:\Pegwars\current\Scripts\Frustum\FarPlane.py:13(cull)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;     2387    2.940    0.001    2.964    0.001 d:\Pegwars\current\Scripts\Scene\ObjectPool.py:27(updateObjectList)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;  2988137    2.930    0.000    2.930    0.000 {method 'append' of 'list' objects}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;     1705    2.558    0.002    4.595    0.003 d:\Pegwars\current\Scripts\Frustum\Light.py:15(cull)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;    43240    1.927    0.000    1.927    0.000 d:\Pegwars\current\Scripts\Scene\Object.py:42(bind)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;      341    0.511    0.001    0.922    0.003 d:\Pegwars\current\Scripts\Frustum\View.py:11(cull)&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;div&gt;1    0.240    0.240   44.535   44.535 main.py:21(runPegwars)&lt;/div&gt;&lt;div&gt;2387    0.205    0.000    2.440    0.001 d:\Pegwars\current\Scripts\Scene\ObjectPool.py:50(callVizDiffCallbacks)&lt;/div&gt;&lt;div&gt;1050    0.201    0.000    0.201    0.000 {method 'symmetric_difference' of 'set' objects}&lt;/div&gt;&lt;div&gt;2283    0.169    0.000    0.169    0.000 {method 'union' of 'set' objects}&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Fantastic, render now takes up 62% of the time, instead of only 47%.  We aren't calling tick() on 1000's of static objects, and when this is ported to C++, the wants_tick facility gets ported too.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And the need to set based ObjectPools has been noted - see the 'symettric_difference' of 'set' objects now takes a negligible amount of time - removing the need to erase from linear lists.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;  Let's go on..&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The next standout is the python FarPlane.py (cull).  This puts objects from within the farplane into a Scene's object pool.  It's currently done in python.  This is a necessary function, but for now, since we are moving tile pieces, we don't need to use this for this particular instance.  A gross hack.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;==========================================&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;AFTER - 66% in RenderChannelStrip.render&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;============================================&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;   ncalls  tottime  percall  cumtime  percall filename:lineno(function)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;     4524   30.175    0.007   30.175    0.007 K:\Pegwars\current\Scripts\PyStingray\RenderChannelStrip.py:47(render)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;     2436    3.084    0.001    3.110    0.001 d:\Pegwars\current\Scripts\Scene\ObjectPool.py:27(updateObjectList)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;    41420    2.667    0.000    2.667    0.000 d:\Pegwars\current\Scripts\Scene\Object.py:42(bind)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;  2617790    2.667    0.000    2.667    0.000 {method 'append' of 'list' objects}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;     1740    2.626    0.002    4.793    0.003 d:\Pegwars\current\Scripts\Frustum\Light.py:15(cull)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;      349    0.568    0.002   30.889    0.089 d:\Pegwars\current\Scripts\Modules\DogFight.py:240(render)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;      348    0.535    0.002    0.979    0.003 d:\Pegwars\current\Scripts\Frustum\View.py:11(cull)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;        1    0.481    0.481   45.822   45.822 main.py:21(runPegwars)&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span"  &gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So finally we've gone from the render using 47% of the time, to render using 66% of the time, all from easy optimisations.  And the python procedural scene now has no obvious glitches when moving around a 2k x 2k map, meaning I can delay porting to C++ a little while longer!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6207239601092653215-1131152535041993064?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/1131152535041993064/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2011/06/optimising-procedural-scene-generator.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/1131152535041993064'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/1131152535041993064'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2011/06/optimising-procedural-scene-generator.html' title='Optimising the procedural scene generator'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-3038728404524316345</id><published>2011-05-04T06:32:00.000-07:00</published><updated>2011-05-04T06:47:39.257-07:00</updated><title type='text'>Pegwars in Darwin..</title><content type='html'>Been a while since the last Pegwars effort, since then I've packed up shop and moved to Darwin!  Also since then I've been getting into Android programming.  One of my Android apps involves porting some of the Stingray engine to Java and OpenGL, which was FUN.  However since dry season hit, and my cool 3D rain app can no longer be worked on (no way to test it lol) I've moved back onto Pegwars programming.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;First step was reading my codebase and understanding it again.  To do this, I followed through my DogFight and SpaceFlight python modules, and drilled down into the how the Scene works, with n cameras and lights and render channels and Scene vizCallbacks etc.  Very happy once I'd figured it out, to remember that I had come a long way.  With hindsight and a fresh perspective, I jumped in and fixed a few long-standing bugs.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then to test out my knowledge of the renderer, I launched in and implemented both depth-of-field scene blurring and materials that reflect the dynamic skybox, and got these new features done in a single night.  That was an awesome feeling, I was really happy to get 2 huge features working in such a short amount of time.  It required no new architecture work, just straight implementation using existing paradigms.  I'm so happy right now that the rendering engine I made last year is so flexible and that I had come so far already.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I wrote up a how-to on how to add new Post-Processing stages.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;/span&gt;&lt;/div&gt;&lt;blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;How to add a Post-Processing stage&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;==================================&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Each CameraScene owns a "post" render channel strip.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Currently each Camera Scene has the same python code and same post setup.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;1. Add a Render Channel to CameraScene.post render channel strip.  e.g. rcs.add( Stingray.RenderChannel(), "DepthOfField", 9.5 )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;2. Need a list of Draw Commands to render your effect.   Do this via XML, and load in python - see Scripts/Post&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;self.dofCommands = []&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;path = "data/depthOfField.xml"&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;d = Stingray.root().open( path )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;for name in d.children().keys():&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;dc = Stingray.DrawCommandClassFactory( path + "/" + name, None )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;self.dofCommands.append(dc)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;   &lt;/span&gt;self.postChannelStrip.strip.addDrawCommand( "DepthOfField", dc )&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;3. The SinglePassFilter DrawCommand takes 4 source textures and a destination texture in XML, e.g.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;&lt;dof&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;SinglePassFilter&lt;/dof&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;shader&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;[DrawCommand]&lt;/shader&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="white-space: pre; "&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;filter&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;TransferFilter&lt;/filter&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;4. Create custom shaders for the steps.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;Pixel Shader Post Processing Constants&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;//from ShaderConstants::setStandardPostProcessConstants()&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;float4x4 view : register(c0);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;float4x4 proj : register(c4);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;float4x4 viewProj : register(c8);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;float4x4 invViewProj : register(c12);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;float4x4 invView : register(c16);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;float4 user1 : register(c20);&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;//user constant 1&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;float4 user2 : register(c21);&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;//user constant 2&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;float4 user3 : register(c22);&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;//user constant 3&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;float4 user4 : register(c23);&lt;span class="Apple-tab-span" style="white-space:pre"&gt;    &lt;/span&gt;//user constant 4&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;float4 lut[64] : register(c24);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;5.  Assign python control over shader constants&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt; &lt;/span&gt;In PyStingray/ShaderConstants.py&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-tab-span" style="white-space: pre; "&gt; &lt;/span&gt;register( "dof", "nearZ", "shaders2/post/dof_lens.pso", 20, "near Z for depth of field camera lens" )&lt;/span&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then based on the scene knowledge, I added something I always wanted to, image-based procedural world maps.  This is really cool, I now have a 2Kx2K image, where each pixel creates a 250m. x 250m. tile of world, such as city pieces, water pieces, suburbs, forest, etc.  This image is procedural, using the &lt;b&gt;Python Imaging Library&lt;/b&gt;, I have a layer-based procedural image compositing system.  In the end, I'm going to use this to generate planets, and allow players to build hand-made cities and do terraforming.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Got to go now, will post screenshots up later but I need to finish optimising the world tile streaming, currently it's pretty jerky when moving around.&lt;/div&gt;&lt;div&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/6207239601092653215-3038728404524316345?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/3038728404524316345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2011/05/pegwars-in-darwin.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/3038728404524316345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/3038728404524316345'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2011/05/pegwars-in-darwin.html' title='Pegwars in Darwin..'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-3697467518773766644</id><published>2011-04-17T10:32:00.000-07:00</published><updated>2011-04-17T10:39:46.812-07:00</updated><title type='text'>One year on..</title><content type='html'>Wooahh, one year on, and to think I was just really gaining momentum.. Guess moving to a different city and the upswell of the Android app store and promise of $$$ is a fair enough distraction.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So today marks the occasion where I've taken up Pegwars again, and with the awesome benefit of a huge pause and the hindsight that affords, I fixed 3 long-standing bugs that were sucking the gumption out of me&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. The python console that every so often went haywire is fixed.  Solid.&lt;/div&gt;&lt;div&gt;2. The blooming that flickered in and out annoying, fixed.  Solid.&lt;/div&gt;&lt;div&gt;3. Can now fly between solar systems without the weird rendering issue; Spaceflight App module now cleans its solar system up properly.  This unlocks the door to the entire Pegwars game&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I've come to this fresh now and am really happy with the progress I made.  There were some gumption traps present in some bugs, but the design is solid and I feel on the cusp of some pretty fast progress now.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6207239601092653215-3697467518773766644?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/3697467518773766644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2011/04/one-year-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/3697467518773766644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/3697467518773766644'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2011/04/one-year-on.html' title='One year on..'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-4610939552653643250</id><published>2010-03-31T15:45:00.000-07:00</published><updated>2010-03-31T17:05:32.497-07:00</updated><title type='text'>Lighting the cockpit, pt. 2</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_XGycRLjx-NY/S7PSC1wtTDI/AAAAAAAAAE0/v2m1pahTIjQ/s1600/0063.bmp"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 320px;" src="http://2.bp.blogspot.com/_XGycRLjx-NY/S7PSC1wtTDI/AAAAAAAAAE0/v2m1pahTIjQ/s400/0063.bmp" alt="" id="BLOGGER_PHOTO_ID_5454934519908748338" border="0" /&gt;&lt;/a&gt;Changed exporters to read object name, and initialise the file/save dialog with the correct name.  This should make it much quicker to export objects and also makesexplicit and easy the rule that you must save the mesh file to the same name as the object. i.e. As long as you name your object, export is as quick as pressing run exporter and OK.&lt;br /&gt;&lt;br /&gt;Added 4 lights into the cockpit.  This runs slow!  It's now doing 5 passes over the entire scene with shadow-mapped lights.&lt;br /&gt;&lt;br /&gt;Optimise the lighting - get lights to cull their drawCommands against both the camera and the light.  Skipping doing any culling at the Python Scene level, done immediately in c++&lt;br /&gt;&lt;br /&gt;Solution - LightingRenderChannel has lightCuller_ and cameraCuller_ these run lightculler then cameraculler&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_XGycRLjx-NY/S7PRN3Q8WRI/AAAAAAAAAEs/NdTzfRKUCwc/s1600/0058.bmp"&gt;&lt;img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 400px; height: 320px;" src="http://1.bp.blogspot.com/_XGycRLjx-NY/S7PRN3Q8WRI/AAAAAAAAAEs/NdTzfRKUCwc/s400/0058.bmp" alt="" id="BLOGGER_PHOTO_ID_5454933609779321106" border="0" /&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Bug - You can see black squares around the light frustum.  Fix by turning off the AmbientLightingChannel.&lt;br /&gt;Looking into why meshes bound to AmbientLightingChannel are causing the lighting anomaly&lt;br /&gt;&lt;br /&gt;ambient_cube_map.vsh : Outputs the projected position and the world normal to o0 and o1&lt;br /&gt;&lt;br /&gt;ambient_cube_map.psh : Samples from the dynamically generated ambient cube map&lt;br /&gt;&lt;br /&gt;ambient_cube_map.mat : [cubeRenderTarget] ambientCubeMap&lt;br /&gt;&lt;br /&gt;Problem - AmbientLightingChannel is now culling to the light frustum.  Out of frustum, all there is is SSDO colours.&lt;br /&gt;Hmmm - See following code in LightingRenderChannel:&lt;br /&gt;&lt;br /&gt;//BIG HACK&lt;br /&gt;if ( rtName == "AMBIENT" )&lt;br /&gt;{&lt;br /&gt;multiplicative_ = true;  rtName_ = "lightMap1";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This explains the lighting bug; ambient lighting is hacked into the standard LightingRenderChannel, and is culling against the first light. removing :&lt;br /&gt;- lightCuller_.culled(bb) the bug is fixed, however the performance improvement is still not in place&lt;br /&gt;- fixed with a hack in lightingRenderChannel : don't cull by light when this is 'ambient' channel.. erk&lt;br /&gt;&lt;br /&gt;Proper fix :&lt;br /&gt;- python property on LightingRenderChannel - whether to cull to light's volume or not&lt;br /&gt;- or, don't use LightingRenderChannel for ambient lighting - its more just like a post-process&lt;br /&gt;&lt;br /&gt;Now need to cull the light projection matrices to their far attenuation radius. Then will need to actually do the attenuation too.&lt;br /&gt;&lt;br /&gt;Quick thoughts :&lt;br /&gt;The near/far plane should be passed into most shaders as shader constants from C++&lt;br /&gt;Idea : have shader files/xml sections include 'state blocks'.  These files describe, for example, sets of shader constants such as those explicitly hard-coded in c++ right now.  Thus instead of 'set lit world mesh shader constants', you wrap those up in a '.stateblock' file, treat them as stateblocks just like .material files, and render channels can optimally sort by these.&lt;br /&gt;&lt;br /&gt;Final screenshot shows an intermediate step from last night with just the lighting channels turned on.  There's the main front white light, and the red light from the cockpit spilling out onto the land.  This was before I added the attenuation in from the lights in Max, and this is why it was running so slow!  Looks pretty cool though, and it's nice having an arbitrary number of full shadow-mapped lights to play with :&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_XGycRLjx-NY/S7PTC2_VWqI/AAAAAAAAAE8/Oi0AzUXdZJE/s1600/0060.bmp"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 320px;" src="http://2.bp.blogspot.com/_XGycRLjx-NY/S7PTC2_VWqI/AAAAAAAAAE8/Oi0AzUXdZJE/s400/0060.bmp" alt="" id="BLOGGER_PHOTO_ID_5454935619750156962" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;It's really useful with the way the render channels are setup, that individual channels can be turned off.  Debugging lighting is much easier when you can toggle all the other stages of the pipeline off at runtime.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6207239601092653215-4610939552653643250?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/4610939552653643250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2010/03/lighting-cockpit-pt-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/4610939552653643250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/4610939552653643250'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2010/03/lighting-cockpit-pt-2.html' title='Lighting the cockpit, pt. 2'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_XGycRLjx-NY/S7PSC1wtTDI/AAAAAAAAAE0/v2m1pahTIjQ/s72-c/0063.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-9148422918781496575</id><published>2010-03-28T15:59:00.000-07:00</published><updated>2010-03-28T16:03:04.856-07:00</updated><title type='text'>Lighting the cockpit</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_XGycRLjx-NY/S6_f_Ty1AtI/AAAAAAAAAEk/Efrv9uFKxv4/s1600/0055.bmp"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 400px; height: 320px;" src="http://4.bp.blogspot.com/_XGycRLjx-NY/S6_f_Ty1AtI/AAAAAAAAAEk/Efrv9uFKxv4/s400/0055.bmp" alt="" id="BLOGGER_PHOTO_ID_5453823952507175634" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Fixed light map projection by setting the wrap mode in TextureStage to border.  This may affect other maps, yet to see any side-effects yet.&lt;br /&gt;&lt;br /&gt;Cockpit is now properly attached to the spaceship, and has its own lights working. If you link a 'CockpitPos' object when making a spaceship, the cockpit will be attached in that spot.&lt;br /&gt;&lt;br /&gt;Cockpit camera now uses cockpit-local transform from 'Camera/Transform/Position'&lt;br /&gt;&lt;br /&gt;Screenshot shows one outside light and two in-cockpit lights&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6207239601092653215-9148422918781496575?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/9148422918781496575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2010/03/lighting-cockpit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/9148422918781496575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/9148422918781496575'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2010/03/lighting-cockpit.html' title='Lighting the cockpit'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_XGycRLjx-NY/S6_f_Ty1AtI/AAAAAAAAAEk/Efrv9uFKxv4/s72-c/0055.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-679271274702319995</id><published>2010-03-16T05:13:00.001-07:00</published><updated>2010-03-16T05:17:43.207-07:00</updated><title type='text'>That's all for now!</title><content type='html'>Ok so now I'm up to date, I've blogged all my diary entries I had in a text file on the computer.  The posts won't come as frequent anymore because they'll happen when they happen, and before they happen I'm going on a 2 month road trip and moving up to Darwin :)&lt;br /&gt;&lt;br /&gt;After that I hope to settle into a new place, a new lifestyle and new PEGWARS development.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_XGycRLjx-NY/S592vlRQ1ZI/AAAAAAAAADw/AmHSwFr9PaE/s1600-h/0042.bmp"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 400px; height: 320px;" src="http://4.bp.blogspot.com/_XGycRLjx-NY/S592vlRQ1ZI/AAAAAAAAADw/AmHSwFr9PaE/s400/0042.bmp" alt="" id="BLOGGER_PHOTO_ID_5449204633972037010" 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/6207239601092653215-679271274702319995?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/679271274702319995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2010/03/thats-all-for-now.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/679271274702319995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/679271274702319995'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2010/03/thats-all-for-now.html' title='That&apos;s all for now!'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_XGycRLjx-NY/S592vlRQ1ZI/AAAAAAAAADw/AmHSwFr9PaE/s72-c/0042.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-511085002890049053</id><published>2010-03-16T05:07:00.001-07:00</published><updated>2010-03-16T05:12:13.196-07:00</updated><title type='text'>Retrospective 15/3/2010</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_XGycRLjx-NY/S591eRcbfqI/AAAAAAAAADo/tfwjEHYoAGo/s1600-h/0053.bmp"&gt;&lt;img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 320px; height: 256px;" src="http://2.bp.blogspot.com/_XGycRLjx-NY/S591eRcbfqI/AAAAAAAAADo/tfwjEHYoAGo/s320/0053.bmp" alt="" id="BLOGGER_PHOTO_ID_5449203237080759970" border="0" /&gt;&lt;/a&gt;Made a new city block, this one a little park with 8 trees.&lt;br /&gt;&lt;br /&gt;Added option to include Logic=****** in the user properties, this is initially&lt;br /&gt;so I can export City Pieces with &lt;logic&gt; WrapWorldPosition &lt;/logic&gt; already there.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_XGycRLjx-NY/S5907OrOvGI/AAAAAAAAADg/11yB8O1_S9s/s1600-h/0052.bmp"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 320px; height: 256px;" src="http://4.bp.blogspot.com/_XGycRLjx-NY/S5907OrOvGI/AAAAAAAAADg/11yB8O1_S9s/s320/0052.bmp" alt="" id="BLOGGER_PHOTO_ID_5449202635042110562" border="0" /&gt;&lt;/a&gt;Used the new .object exporter, works well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6207239601092653215-511085002890049053?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/511085002890049053/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-1532010.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/511085002890049053'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/511085002890049053'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-1532010.html' title='Retrospective 15/3/2010'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_XGycRLjx-NY/S591eRcbfqI/AAAAAAAAADo/tfwjEHYoAGo/s72-c/0053.bmp' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-3710092518859906058</id><published>2010-03-16T05:01:00.001-07:00</published><updated>2010-03-16T05:06:58.348-07:00</updated><title type='text'>Retrospective 14/3/2010</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_XGycRLjx-NY/S59zlMnYJrI/AAAAAAAAADQ/FbYAgM5JiD4/s1600-h/0050.bmp"&gt;&lt;img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 320px; height: 256px;" src="http://2.bp.blogspot.com/_XGycRLjx-NY/S59zlMnYJrI/AAAAAAAAADQ/FbYAgM5JiD4/s320/0050.bmp" alt="" id="BLOGGER_PHOTO_ID_5449201157020329650" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Got many boost::python things working now that I am using shared_ptrs.  Always knew I should have but was too lazy to do so, it finally became necessary.  The main thing is I can now access worldObject hierarchies *safely* and pass IData back and forth from python.&lt;br /&gt;&lt;br /&gt;From this I now get WorldObjects loading, creating Python LogicObjects from the object files, and now have an onLoaded call.  All Logic Objects get onLoaded called once the entire WorldObject is loaded.&lt;br /&gt;&lt;br /&gt;Lights are now loaded from .object files, and they are controlled via LightLogic scripts (which currently have to be loaded via the ScriptLogic wrapper class).&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_XGycRLjx-NY/S590IpohZAI/AAAAAAAAADY/cscASsX2Lc4/s1600-h/0051.bmp"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 320px; height: 256px;" src="http://1.bp.blogspot.com/_XGycRLjx-NY/S590IpohZAI/AAAAAAAAADY/cscASsX2Lc4/s320/0051.bmp" alt="" id="BLOGGER_PHOTO_ID_5449201766105179138" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The LightLogic currently sets the light matrix based on the position of its worldObject.  I should make a C++ light object that is intrinsically tied to world objects.&lt;br /&gt;&lt;br /&gt;Also created is the ControlCentre script.  This will be responsible for running all the ships' systems. First up I'll just be using it to shoot pulse lasers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6207239601092653215-3710092518859906058?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/3710092518859906058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-1432010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/3710092518859906058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/3710092518859906058'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-1432010.html' title='Retrospective 14/3/2010'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_XGycRLjx-NY/S59zlMnYJrI/AAAAAAAAADQ/FbYAgM5JiD4/s72-c/0050.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-2726631582943045504</id><published>2010-03-16T04:57:00.000-07:00</published><updated>2010-03-16T05:00:55.019-07:00</updated><title type='text'>Retrospective 5/3/2010</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_XGycRLjx-NY/S59yvh99AaI/AAAAAAAAADI/PHK1RkMN4tY/s1600-h/0049.bmp"&gt;&lt;img style="cursor: pointer; width: 320px; height: 256px;" src="http://1.bp.blogspot.com/_XGycRLjx-NY/S59yvh99AaI/AAAAAAAAADI/PHK1RkMN4tY/s320/0049.bmp" alt="" id="BLOGGER_PHOTO_ID_5449200235039228322" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Loads done since the last posts.  Just a quick comment though.&lt;br /&gt;&lt;br /&gt;I was getting no WorldObject::Ptr to python by-value runtime errors, simply trying to return a child smart pointer.  I thought boost would have taken care of this since I carefully made sure all my WorldObjects are now reference counted via boost::shared_ptr.&lt;br /&gt;&lt;br /&gt;However, to fix the runtime error, I had to declare that my WorldObject::Ptr was indeed simlar to a WorldObject by changing the class declaration :&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;class_&lt;worldobject, bases=""&gt;&lt;matrixprovider&gt; &gt;("WorldObject", no_init)&lt;br /&gt;&lt;br /&gt;to&lt;br /&gt;&lt;br /&gt;class_&lt;worldobject, bases=""&gt;&lt;matrixprovider&gt; &gt;("WorldObject", no_init)&lt;br /&gt;&lt;/matrixprovider&gt;&lt;/worldobject,&gt;&lt;/matrixprovider&gt;&lt;/worldobject,&gt;&lt;/blockquote&gt;Funnily enough I didn't have to do this with IData::Ptr, weird&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6207239601092653215-2726631582943045504?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/2726631582943045504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-532010.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/2726631582943045504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/2726631582943045504'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-532010.html' title='Retrospective 5/3/2010'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_XGycRLjx-NY/S59yvh99AaI/AAAAAAAAADI/PHK1RkMN4tY/s72-c/0049.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-2055961297623478606</id><published>2010-03-16T04:54:00.000-07:00</published><updated>2010-03-16T04:57:21.035-07:00</updated><title type='text'>Retrospective 22/10/2009</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_XGycRLjx-NY/S59yCXCsu4I/AAAAAAAAADA/yOOE5RMs1AU/s1600-h/0048.bmp"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 256px;" src="http://3.bp.blogspot.com/_XGycRLjx-NY/S59yCXCsu4I/AAAAAAAAADA/yOOE5RMs1AU/s320/0048.bmp" alt="" id="BLOGGER_PHOTO_ID_5449199459012230018" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Now to tweak I need realtime control over shader constants, python access would be good enough.&lt;br /&gt;&lt;br /&gt;So I'm going to try and hook in with the ShaderManager and register values by shader name and register.  &lt;span style="font-weight: bold;"&gt;Done&lt;/span&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6207239601092653215-2055961297623478606?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/2055961297623478606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-22102009.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/2055961297623478606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/2055961297623478606'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-22102009.html' title='Retrospective 22/10/2009'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_XGycRLjx-NY/S59yCXCsu4I/AAAAAAAAADA/yOOE5RMs1AU/s72-c/0048.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-4448164193508761739</id><published>2010-03-16T04:18:00.000-07:00</published><updated>2010-03-16T04:54:25.092-07:00</updated><title type='text'>Retrospective 20/10/2009</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_XGycRLjx-NY/S59sj_gefBI/AAAAAAAAACY/EQbgvOmnlKc/s1600-h/0045.bmp"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 320px; height: 256px;" src="http://3.bp.blogspot.com/_XGycRLjx-NY/S59sj_gefBI/AAAAAAAAACY/EQbgvOmnlKc/s320/0045.bmp" alt="" id="BLOGGER_PHOTO_ID_5449193439740460050" border="0" /&gt;&lt;/a&gt;Debugging SSDO, although only at the SSAO stage.&lt;br /&gt;&lt;br /&gt;Just changed the depth_normals shader to output projectablePos.zw from the vertex shader and dividing z by w in the Pixel Shader to get the desired depth.  This should be the correct depth, and removes the /50000.0 hack in the previous vertex shader.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_XGycRLjx-NY/S59wPaPwESI/AAAAAAAAACw/ajBc1_gT9yA/s1600-h/0044.bmp"&gt;&lt;img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 320px; height: 256px;" src="http://3.bp.blogspot.com/_XGycRLjx-NY/S59wPaPwESI/AAAAAAAAACw/ajBc1_gT9yA/s320/0044.bmp" alt="" id="BLOGGER_PHOTO_ID_5449197484187324706" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The SSDO effect is very sensitive to its world radius,  you can either see the small details or the large details.&lt;br /&gt;&lt;br /&gt;But doing importance sampling on the filter taps allows for a much vaster range for the effect to be visible.&lt;br /&gt;&lt;br /&gt;Gonna randomise over time the taps.&lt;br /&gt;&lt;br /&gt;The effect reallly needs 64 taps to look good.  So I'm going to try and downsample the depth image and do SSDO on that.&lt;br /&gt;&lt;br /&gt;Now trying to change the visibility function.  Even the testVisibility function gave decent results.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_XGycRLjx-NY/S59ptzIjpzI/AAAAAAAAACI/Ho08ZEzaSeQ/s1600-h/0043.bmp"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 320px; height: 256px;" src="http://4.bp.blogspot.com/_XGycRLjx-NY/S59ptzIjpzI/AAAAAAAAACI/Ho08ZEzaSeQ/s320/0043.bmp" alt="" id="BLOGGER_PHOTO_ID_5449190309682718514" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_XGycRLjx-NY/S59xC0XaopI/AAAAAAAAAC4/-z-ISOG9kZo/s1600-h/0047.bmp"&gt;&lt;img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 320px; height: 128px;" src="http://3.bp.blogspot.com/_XGycRLjx-NY/S59xC0XaopI/AAAAAAAAAC4/-z-ISOG9kZo/s320/0047.bmp" alt="" id="BLOGGER_PHOTO_ID_5449198367372124818" 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/6207239601092653215-4448164193508761739?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/4448164193508761739/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-20102009.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/4448164193508761739'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/4448164193508761739'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-20102009.html' title='Retrospective 20/10/2009'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_XGycRLjx-NY/S59sj_gefBI/AAAAAAAAACY/EQbgvOmnlKc/s72-c/0045.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-1961912320626727335</id><published>2010-03-16T04:16:00.000-07:00</published><updated>2010-03-16T04:18:41.587-07:00</updated><title type='text'>Retrospective 22/9/2009</title><content type='html'>Now trying to get lighting working using the new Scene construct and support for n lights. Split LightScene into a write and read phase, each with their own RenderChannelStrip&lt;br /&gt;&lt;br /&gt;The goal of this is to have the draw order for all render channels interleaved to look like this:&lt;br /&gt;   &lt;blockquote&gt; light1 write&lt;br /&gt;    light2 write&lt;br /&gt;        ...&lt;br /&gt;    camera1 draw depth&lt;br /&gt;    light1 read&lt;br /&gt;    light2 read&lt;br /&gt;    camera1 draw materials&lt;br /&gt;   &lt;br /&gt;    camera2 draw depth&lt;br /&gt;    light1 read&lt;br /&gt;    light2 read&lt;br /&gt;    camera2 draw materials&lt;br /&gt;        ...&lt;/blockquote&gt;&lt;br /&gt;       &lt;br /&gt;This is now done.  Now there are heaps of Render Channel Strips, each describing one stage of the pipeline.&lt;br /&gt;&lt;br /&gt;Multiple lights are not completely working, as they have no current way of utilising a separate render target (all are hard-coded to use data/lightMap1.xml)&lt;br /&gt;&lt;br /&gt;If lightX write, lightX read can be customised to use any render target, the lighting can be performed.&lt;br /&gt;&lt;br /&gt;OK gots this all pretty much working, for n lights.  The light maps seem at least to write correctly.&lt;br /&gt;&lt;br /&gt;The throwing of the light on the objects doesn't yet work..  and i think its because in the LightingRenderChannel it sets no states whatsoever to do with the light's view matrix - so can't be right.&lt;br /&gt;&lt;br /&gt;lights (1 and 2) and (3 and 4) seem to be reading from each other's depth maps.  but if you set 1 and 2, you get a consistent shadow map, separate from 3 and 4.  But why would they influence each other?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6207239601092653215-1961912320626727335?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/1961912320626727335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-2292009.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/1961912320626727335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/1961912320626727335'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-2292009.html' title='Retrospective 22/9/2009'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-58278235960571514</id><published>2010-03-16T04:15:00.000-07:00</published><updated>2010-03-16T04:16:16.717-07:00</updated><title type='text'>Retrospective 26/8/2009</title><content type='html'>Thing are going so fast it's hard to keep track.  Heres some current thoughts:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;All is working as planned, benefits of thoroughly testing the python scene library before using it in PyPegwars&lt;/li&gt;&lt;li&gt;There are a bunch of Python classes mirroring C++ classes, and confusing things right now, e.g. MeshPiece, RenderChannelStrip&lt;/li&gt;&lt;li&gt;The 'planets' aka light probes are being rendered via worldObject bind to CameraChannelStrip.&lt;/li&gt;&lt;li&gt;The lightmaps are being rendered via worldObject bind to LightChannelStrip.&lt;/li&gt;&lt;li&gt;The lighting on the objects is happening via the old system, i.e. C++ world objects binding to render channel strips.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;How do I have 3 camera scenes, i.e. Far, Near and Cockpit, all rendered from the same viewpoint?  how do I share a camera around?&lt;br /&gt;Currently there are 5 scenes:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;farScene&lt;/li&gt;&lt;li&gt;scene&lt;/li&gt;&lt;li&gt;cockpitScene&lt;/li&gt;&lt;li&gt;camera's CameraScene&lt;/li&gt;&lt;li&gt;light's LightScene&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;TODO&lt;/span&gt; tonight&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Get rid of the python RenderChannelStrip concept entirely&lt;/li&gt;&lt;li&gt;Change WorldObject to store (material,drawCommand) map instead of (renderChannelName,drawCommand) map&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Done&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Added newmaterial / newmesh format, and late binding/creation of world draw commands&lt;/li&gt;&lt;li&gt;Added c++ MeshPiece&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6207239601092653215-58278235960571514?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/58278235960571514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-2682009.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/58278235960571514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/58278235960571514'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-2682009.html' title='Retrospective 26/8/2009'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-4349129575070053930</id><published>2010-03-16T04:12:00.000-07:00</published><updated>2010-03-16T04:15:00.651-07:00</updated><title type='text'>Retrospective 25/8/2009</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Goal&lt;/span&gt; : get planets and suns rendering.  This requires displaying the render channel strip that the world objects are currently being bound to.&lt;br /&gt;&lt;br /&gt;Changed the "DrawScene" update command to actually draw a scene, instead of a render channel strip.  This is because the scene has extra stuff like a camera/lens to setup rendering with - it may also have render targets etc.  Basically we need to go via the full RenderMethod::standard fn because it does important stuff like clearing the back buffer and calling beginScene()/endScene(). In the end we may not want to use RenderMethod::standard&lt;br /&gt;&lt;br /&gt;Split out RenderMethod::standard to ::beginScene and ::endScene&lt;br /&gt;&lt;br /&gt;Problem now is the 'debug render channel' uses / clears the depthTexture.  Alternatives here:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;'debug render channel' only has 'Gui' and 'Console' channels&lt;/li&gt;&lt;li&gt;makes old modules (dog fight, architect) not work&lt;/li&gt;&lt;li&gt;make them work with the new scene architecture ALL DONE&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;TODO&lt;/span&gt; : get rid of the 'debug render channel' entirely. Instead have this created by main.py, and registered with the appropriate instances.&lt;br /&gt;&lt;br /&gt;Got all old modules and new working with the RenderChannelStrip concept&lt;br /&gt;&lt;br /&gt;Tried to get lights working, as that will greatly expand the number of objects i can load, i.e. planets.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CURRENT STATUS&lt;/span&gt; :&lt;br /&gt;&lt;ul&gt;&lt;li&gt;no lighting on objects.  If you get "MeshPiece" and add a "Lighting" object to it, then the mesh piece will get bound to the light channel&lt;/li&gt;&lt;li&gt;currently only the light objects have a "lighting" object.  This is actually how it is designed - for deferred lighting&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;New Scene Library&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;has CameraScene, LightScene, owned by cameras and lights.  These have CameraChannelStrips and LightChannelStrips.  Those classes setup the appropriate render channels, and when an object is added&lt;/li&gt;&lt;li&gt;supports n cameras and n lights&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;OldScene&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;has a strip and explicitly sets up render channels, combining lights+materials+debug all as one giant strip.  Supports 1 camera and 4 lights only.&lt;/li&gt;&lt;li&gt;has useful addWorldObject / addMesh fns that the new scene library lacks.  However, with the new scene library, try to keep all the data loaded in from scene files and avoid explicitly creating objects wherever possible.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6207239601092653215-4349129575070053930?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/4349129575070053930/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-2582009.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/4349129575070053930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/4349129575070053930'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-2582009.html' title='Retrospective 25/8/2009'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-2680168110227305308</id><published>2010-03-16T04:09:00.000-07:00</published><updated>2010-03-16T04:12:15.199-07:00</updated><title type='text'>Retrospective 24/8/2009</title><content type='html'>Created all the old Pegwars Application Modules&lt;br /&gt;ObjectPool - added error msg to report objects that have no vizCallback&lt;br /&gt;Working on SpaceFlight module.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;should this module create a solar system, or have one passed in?  &lt;span style="font-style: italic;"&gt;doesn't matter yet, defer this decision.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;got it promoting planets and suns to the appropriate far/normal/cockpit scenes&lt;/li&gt;&lt;li&gt;made first link between python and c++ game : planets + suns now *have a* world object that represents themselves.&lt;/li&gt;&lt;li&gt;planet and sun created by solar system and added to SpaceFlight's scene.&lt;/li&gt;&lt;li&gt;SpaceFlight has far/near scenes, ticks all objects and culls them between far/near objects.&lt;/li&gt;&lt;li&gt;bindMesh for sun/planet now binds the 'debug python mesh' and its world object.&lt;/li&gt;&lt;/ul&gt;Created C++ RenderChannelStrip ( instanceable RenderChannelManagers )&lt;br /&gt;Replaced WorldObject::visible with bind( RenderChannelStrip ) and unbind(RenderChannelStrip )&lt;br /&gt;Added DebugChannelStrip for now, a singleton channel strip used by python console / engine statistics etc and also the one used by main.py, architect etc.  things using the OldScene idea.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6207239601092653215-2680168110227305308?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/2680168110227305308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-2482009.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/2680168110227305308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/2680168110227305308'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2010/03/retrospective-2482009.html' title='Retrospective 24/8/2009'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-516052435483078538</id><published>2010-03-15T13:52:00.000-07:00</published><updated>2010-03-16T03:49:58.061-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='deferred rendering'/><category scheme='http://www.blogger.com/atom/ns#' term='3D engine design'/><category scheme='http://www.blogger.com/atom/ns#' term='z pre-pass rendering'/><title type='text'></title><content type='html'>&lt;span style="font-weight: bold;"&gt;Stingray : the new engine&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Stingray is organised into a Channel strips.  Each has a list of RenderChannels, and each of these have a list of DrawCommands.&lt;br /&gt;&lt;br /&gt;The strips and channels are created and arranged in an order specified by the&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_XGycRLjx-NY/S56q8DBzeiI/AAAAAAAAABw/SqNBWecMN2Y/s1600-h/Stingray1.bmp"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 289px; height: 320px;" src="http://4.bp.blogspot.com/_XGycRLjx-NY/S56q8DBzeiI/AAAAAAAAABw/SqNBWecMN2Y/s320/Stingray1.bmp" alt="" id="BLOGGER_PHOTO_ID_5448980547746626082" border="0" /&gt;&lt;/a&gt; game programmer. This design means that a Stingray game is not bound to forward-rendering, or deferred-rendering, single or multi-pass materials etc.  It is completely flexible from this standpoint.&lt;br /&gt;&lt;br /&gt;Channel Strips are purely for convenience, they are repeatable blocks of Render Channels, for example implementing shadow-mapped light requires light-map-write and light-map-read channels.  These two make up a LightMapChannelStrip; each light-mapped light thus creates its own LightMapChannelStrip.&lt;br /&gt;&lt;br /&gt;The fundamental drawing unit in Stingray, the DrawCommand, exists so that all draw commands can be sorted with respect to one another.  This allow&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_XGycRLjx-NY/S59eCK4XnrI/AAAAAAAAAB4/pyI-KeO4KJo/s1600-h/Stingray2.bmp"&gt;&lt;img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 242px; height: 320px;" src="http://1.bp.blogspot.com/_XGycRLjx-NY/S59eCK4XnrI/AAAAAAAAAB4/pyI-KeO4KJo/s320/Stingray2.bmp" alt="" id="BLOGGER_PHOTO_ID_5449177465515122354" border="0" /&gt;&lt;/a&gt;s each render channel to sort its draw commands to draw in the most optimal order.  For example the depth-pass channel requires little state changing, and so sorts its draw commands front-to-back to take advantage of the GPU's z-occlusion culling.  The Texturing render channel on the other hand utilises heavy state-setting, and thus sorts its render commands via state blocks.  DrawCommands are highly frame coherent, and this fact is taken advantage of - draw commands are not issued to channels per-frame at runtime, instead draw commands are owned by objects and meshes, and meshes are bound() and unbound() infrequently to channel strips.&lt;br /&gt;&lt;br /&gt;Mesh files contain a list of MeshPieces - parts of a mesh that have the same material.&lt;br /&gt;&lt;br /&gt;Material files contain a list of RenderChannels that draw a mesh piece, for example texture, light, then post-process.  For each render channel, XML invokes class factories to create DrawCommands.  This means a material may contain passes that are not used by a particular game; if a game only implements some render channels, then parts of the material simply won't be bound at runtime.  Thus we have a dynamically-bound multi-pass material system.&lt;br /&gt;&lt;br /&gt;When a mesh is bound(), all its mesh pieces use their materials to register draw commands to the appropriate r&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_XGycRLjx-NY/S59hxtigPqI/AAAAAAAAACA/1z26__c4i0M/s1600-h/Stingray3.bmp"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 320px; height: 270px;" src="http://4.bp.blogspot.com/_XGycRLjx-NY/S59hxtigPqI/AAAAAAAAACA/1z26__c4i0M/s320/Stingray3.bmp" alt="" id="BLOGGER_PHOTO_ID_5449181580807388834" border="0" /&gt;&lt;/a&gt;ender channels.  In some instances, a draw command will be bound to multiple channels - for example, there may be two cameras with complete render channel strips, or five lighting channel strips.  Cameras and Lights are therefore treated exactly the same, they are simply render channel strips.&lt;br /&gt;&lt;br /&gt;All resources are referenced by integer IDs and stored in Managers, thus any resource can be reloaded at runtime, and the instance memory is kept to a minimum.&lt;br /&gt;&lt;br /&gt;Stingray uses Boost::Python to expose nearly all of the engine to Python.  There is no inherent render pipeline, this is created by the game python scripts.&lt;br /&gt;&lt;br /&gt;There is no multi-threading in this engine, however it is designed for it.  Draw Commands are independent objects, thus getting the draw commands ready on render channels can be done in any order, before the final rendering stage goes through a sorted list of draw commands and submits them to DirectX.  So each render channel can cull and sort draw commands in parallel, only the final submission must be done in order.  And before this is done, it is possible to double buffer the draw command lists such that the next frame can be made ready while draw command submission is taking place.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6207239601092653215-516052435483078538?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/516052435483078538/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2010/03/stingray-new-engine-stingray-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/516052435483078538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/516052435483078538'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2010/03/stingray-new-engine-stingray-is.html' title=''/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_XGycRLjx-NY/S56q8DBzeiI/AAAAAAAAABw/SqNBWecMN2Y/s72-c/Stingray1.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6207239601092653215.post-4820125352806210456</id><published>2010-03-15T04:47:00.000-07:00</published><updated>2010-03-15T06:07:10.263-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pegwars'/><category scheme='http://www.blogger.com/atom/ns#' term='elite'/><category scheme='http://www.blogger.com/atom/ns#' term='intro'/><title type='text'>What is PEGWARS?</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_XGycRLjx-NY/S54t3lsvtRI/AAAAAAAAAAs/NBK5kW2oK2E/s1600-h/collage.bmp"&gt;&lt;img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 320px; height: 134px;" src="http://2.bp.blogspot.com/_XGycRLjx-NY/S54t3lsvtRI/AAAAAAAAAAs/NBK5kW2oK2E/s320/collage.bmp" alt="" id="BLOGGER_PHOTO_ID_5448843032200721682" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Pegwars, or Political Economic and Galactic Warfare, is my hobby computer game that I've been writing since, um about October 1997.  That's 12 years ago!&lt;br /&gt;&lt;br /&gt;For anyone that has been around computer games a long time, the word ELITE should mean something to you.  Something special.  ELITE was the game that hooked me for life.  Until ELITE, games were a fun curiosity, usually involving run and jumping a little man , llama or 'Horace' around 2D levels, requiring pixel-perfect accuracy and some bleepy soundtrack that these days is considered somewhat 'retro-cool'.  ELITE was a full 3D (wireframe) space combat exploration and trading game, which involved 8 entire galaxies, alien races, missions and more. All of this on a 48K ZX Spectrum.  For an 11 year old boy, that was quite something, and my mind was truly blown.&lt;br /&gt;&lt;br /&gt;Ever since university and being able to write somewhat coherent code, I've been writing PEGWARS, my interpretation of this genre.  It's my hobby project, and it is now in its 6th iteration.  On the way down this merry merry path of late night coding, I've learnt about art, music, game programming and more; I've used it as a demo to get a job in the computer game industry, it's catapulted me into writing electronic music, and it's kept me learning all these years and given me something creative to do and a good reason to avoid television.&lt;br /&gt;&lt;br /&gt;This blog is going to be my project diary of the PEGWARS project, a place to document the long-term development of a hobby computer game project.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_XGycRLjx-NY/S54lLH-4b2I/AAAAAAAAAAM/biR4V27s690/s1600-h/scr_001.bmp"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 320px; height: 241px;" src="http://1.bp.blogspot.com/_XGycRLjx-NY/S54lLH-4b2I/AAAAAAAAAAM/biR4V27s690/s320/scr_001.bmp" alt="" id="BLOGGER_PHOTO_ID_5448833472216461154" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Pegwars, v1.  2D&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;My first version of Pegwars, written using DirectDraw 2.  Involves such fun as implemented transparencies by ORing colours directly into the framebuffer.&lt;br /&gt;&lt;br /&gt;Went on a bit of a tangent in this version, this one had enemy AI that was trained using a Genetic Algorithm.  Each enemy had a short DNA string that dictated what they would do given per-frame sensory input.  I even had use of a bunch of computers at my workplace at the time to run evolutions of these DNA pilots overnight.  Moral of this foray into GA's is, if you want to run many evolutions of something, don't make it a full graphical game - test their fitness in a simulated game environment.  Otherwise the amount of time required to run just 100 generations of 100 pilots is going to be far too long and you'll get nowhere.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_XGycRLjx-NY/S54nXtLNpoI/AAAAAAAAAAU/CoEcGJFLbCQ/s1600-h/scr_001.bmp"&gt;&lt;img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 320px; height: 247px;" src="http://4.bp.blogspot.com/_XGycRLjx-NY/S54nXtLNpoI/AAAAAAAAAAU/CoEcGJFLbCQ/s320/scr_001.bmp" alt="" id="BLOGGER_PHOTO_ID_5448835887381980802" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Pegwars, v2&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;My first 3D version of Pegwars, and this one was written entirely in software.  As you can see, there's no texturing, some pretty crappy 3D models etc.  This was a 3D layer on top of my 2D engine written for v1, thus this still involved a fully working 2D interface.&lt;br /&gt;&lt;br /&gt;This version featured fully customisable spaceships, you drag and drop engines, thrusters, pulse lasers onto your 3D spaceship and then join the game.  If you forgot to add Thrusters you couldn't go anywhere!  And that was the gist of what Pegwars was all about - fully modular and customisable spaceships.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_XGycRLjx-NY/S54pBdYdNNI/AAAAAAAAAAc/9r7H1S01p7g/s1600-h/0013.bmp"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_XGycRLjx-NY/S54pBdYdNNI/AAAAAAAAAAc/9r7H1S01p7g/s320/0013.bmp" alt="" id="BLOGGER_PHOTO_ID_5448837704208692434" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Pegwars, v3.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;My first 3D accelerated version, written using GLIDE and then DirectX.  This one featured fraggable spaceships, even down to the polygon level!  Plus some more pretty bad programmer-art.  I used this version for my demo to BigWorld Technology, and it got me a job in computer games, surely a dream come true :)&lt;br /&gt;&lt;br /&gt;After this version I started to really learn about games programming and decided that I had it all wrong... time to start again&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_XGycRLjx-NY/S54sXIBFGnI/AAAAAAAAAAk/-5KZ48dDZHg/s1600-h/0027.bmp"&gt;&lt;img style="float: right; margin: 0pt 0pt 10px 10px; cursor: pointer; width: 320px; height: 240px;" src="http://2.bp.blogspot.com/_XGycRLjx-NY/S54sXIBFGnI/AAAAAAAAAAk/-5KZ48dDZHg/s320/0027.bmp" alt="" id="BLOGGER_PHOTO_ID_5448841374965504626" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Pegwars, v4.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The first one featuring my new Relativity Engine.  Didn't get too far on this before deciding to start again.  But as you can, it certainly featured fully modular ships again, just look at all those thrusters...&lt;br /&gt;&lt;br /&gt;The look is starting to get a little more refined, at least I had the FOV sorted out (no more egg-shaped suns or planets).  The guys at BigWorld taught me a lot about writing computer games and it was now that I was starting to get the feeling that maybe I'd bitten off just a little too much.  My advice to anyone beginning their own hobby computer game is, don't be too ambitious!  It's possibly the worst idea in the world to begin writing your own entire universe simulation in your spare time.  Which leads me to the next version of my game...&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_XGycRLjx-NY/S54vE0_TmYI/AAAAAAAAAA8/nHDhP32aZQg/s1600-h/pw75.bmp"&gt;&lt;img style="float: left; margin: 0pt 10px 10px 0pt; cursor: pointer; width: 320px; height: 240px;" src="http://3.bp.blogspot.com/_XGycRLjx-NY/S54vE0_TmYI/AAAAAAAAAA8/nHDhP32aZQg/s320/pw75.bmp" alt="" id="BLOGGER_PHOTO_ID_5448844359155030402" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold;"&gt;Pegwars, v5.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Also featured in the montage image in this post, v5 was the furthest I got and the best Pegwars yet!&lt;br /&gt;&lt;br /&gt;In this version, you can literally fly down and land on any planet in the entire galaxy, then hop out in a motorbike or car and drive around!  You could land on space stations, fight enemies and collect bounties, even advance your rank.&lt;br /&gt;&lt;br /&gt;A really nice feature that just kind of fell out of this game was sunrise and sunsets :)  You just fly down into the atmosphere of a planet, and start flying around it.  Lo and behold, as you fly around the night time towards the sun, you slowly see the sun begin to rise, the atmosphere lighten up sunrise colours through the sky.  You could keep flying around as the sun rose in the sky then slowly sets behind your spaceship.&lt;br /&gt;&lt;br /&gt;This version took years of work and unfortunately it showed.  The code started becoming unmaintanable, I could see huge inadequacies in the graphics engine design, and there was no scripting language.  Everything was still being written in C++ and this bogged down the speed of developing any new part of the game.  I wanted to do more with the graphics but the engine was too inflexible.  I took this version of the game as an inspirational prototype and have begun work on an entirely new version of Pegwars, the current version that I am writing now.  And this time, I am making no compromises.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6207239601092653215-4820125352806210456?l=pegwars.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://pegwars.blogspot.com/feeds/4820125352806210456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://pegwars.blogspot.com/2010/03/what-is-pegwars.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/4820125352806210456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6207239601092653215/posts/default/4820125352806210456'/><link rel='alternate' type='text/html' href='http://pegwars.blogspot.com/2010/03/what-is-pegwars.html' title='What is PEGWARS?'/><author><name>Phill</name><uri>http://www.blogger.com/profile/13864977567539050829</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_XGycRLjx-NY/S56d7Utd3QI/AAAAAAAAABI/WGTpA-qxBpk/S220/Herbie.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_XGycRLjx-NY/S54t3lsvtRI/AAAAAAAAAAs/NBK5kW2oK2E/s72-c/collage.bmp' height='72' width='72'/><thr:total>3</thr:total></entry></feed>
