<?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-19919004</id><updated>2012-02-02T22:23:04.678+01:00</updated><title type='text'>Ramblings in 3D (and other stuff)</title><subtitle type='html'>3d coding and other geeky stuff!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>46</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-19919004.post-6757049632796785513</id><published>2008-02-22T09:44:00.002+01:00</published><updated>2008-02-22T09:58:25.613+01:00</updated><title type='text'></title><content type='html'>&lt;strong&gt;Tip of the day&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Nope, no engine updates today. Instead I'll give you a website recommendation.&lt;br /&gt;&lt;br /&gt;If you're a bit weird like me, that is, you rather read graphics papers than fiction before you go to sleep, you probably already have this one in your bookmarks.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://kesen.huang.googlepages.com/"&gt;Ke-Sen Huang&lt;/a&gt; keeps an index of all papers available online from every academic graphics conference worth it's name.&lt;br /&gt;&lt;br /&gt;I'm yet to find a good rescource that lists all papers and presentations from more commercially oriented conferences like GDC. Feel free to share your own bookmarks :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-6757049632796785513?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/6757049632796785513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=6757049632796785513' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/6757049632796785513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/6757049632796785513'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2008/02/tip-of-day-nope-no-engine-updates-today.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-5967015335131860193</id><published>2008-02-20T08:59:00.005+01:00</published><updated>2008-02-21T15:47:28.376+01:00</updated><title type='text'></title><content type='html'>&lt;strong&gt;Soft shadows &lt;/strong&gt;&lt;br /&gt;&lt;p&gt;I've added soft shadows to the engine. I use Percentage-Closer Soft Shadows (PCSS), described in &lt;a href="http://developer.download.nvidia.com/shaderlibrary/docs/shadow_PCSS.pdf"&gt;this paper&lt;/a&gt;. It differs from regular PCF in that a "blocker-serach" step is used to approximate a shadow penumbra size. The estimated penumbra size is then used to control the filter size. It's not real penumbra shadows but it looks quite convincing.&lt;/p&gt;Believe it or not, but until now my engine had no support for normal mapping. Now it does. The dynamic indirect lighting is also affected by the normal maps.&lt;br /&gt;Time for the screenshots:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_Qn3H-rTPwac/R7vd-7TxcTI/AAAAAAAAADg/0S4-u6-vGlI/s1600-h/room1.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5168969070480027954" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_Qn3H-rTPwac/R7vd-7TxcTI/AAAAAAAAADg/0S4-u6-vGlI/s400/room1.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_Qn3H-rTPwac/R7veQ7TxcUI/AAAAAAAAADo/9l01qf7ZI80/s1600-h/room2.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5168969379717673282" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_Qn3H-rTPwac/R7veQ7TxcUI/AAAAAAAAADo/9l01qf7ZI80/s400/room2.PNG" border="0" /&gt;&lt;/a&gt; &lt;p align="center"&gt;&lt;span style="font-size:78%;"&gt;Note the green light that is reflected from the wall (not visible) onto the scene.&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;a href="http://3.bp.blogspot.com/_Qn3H-rTPwac/R7vedLTxcVI/AAAAAAAAADw/yvVTpgRTsvQ/s1600-h/room3.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5168969590171070802" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_Qn3H-rTPwac/R7vedLTxcVI/AAAAAAAAADw/yvVTpgRTsvQ/s400/room3.PNG" border="0" /&gt; &lt;p align="center"&gt;&lt;/a&gt;&lt;/p&gt;&lt;span style="font-size:78%;"&gt;Soft shadows.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_Qn3H-rTPwac/R7veprTxcWI/AAAAAAAAAD4/7sON1arWBDU/s1600-h/room4.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5168969804919435618" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_Qn3H-rTPwac/R7veprTxcWI/AAAAAAAAAD4/7sON1arWBDU/s400/room4.PNG" border="0" /&gt; &lt;p align="center"&gt;&lt;/a&gt;&lt;/p&gt;&lt;span style="font-size:78%;"&gt;The scene is also lit by an enviroment map.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-5967015335131860193?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/5967015335131860193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=5967015335131860193' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/5967015335131860193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/5967015335131860193'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2008/02/soft-shadows-ive-added-soft-shadows-to.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Qn3H-rTPwac/R7vd-7TxcTI/AAAAAAAAADg/0S4-u6-vGlI/s72-c/room1.PNG' height='72' width='72'/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-1119935702631773333</id><published>2008-02-08T12:47:00.000+01:00</published><updated>2008-02-08T13:01:46.158+01:00</updated><title type='text'></title><content type='html'>&lt;strong&gt;Dynamic indirect lighting&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I got the indirect lighting to work correctly. There were some stupid bugs in my SH code. In the screenshots I use a 3x3x3 grid of sampling points (see last post) and one bonce of indirect light. There is also a (very) small constant ambient term so that no surfaces are completely black. Combined with SSAO it looks quite nice.&lt;br /&gt;&lt;br /&gt;The scene is simple and HDR is deactivated so that the lighting effects is more apparent.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_Qn3H-rTPwac/R6xCwmPGy_I/AAAAAAAAADI/rYweISfRV2M/s1600-h/indirect_red.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5164576275352177650" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_Qn3H-rTPwac/R6xCwmPGy_I/AAAAAAAAADI/rYweISfRV2M/s400/indirect_red.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_Qn3H-rTPwac/R6xC6WPGzAI/AAAAAAAAADQ/woaJSrAKwOk/s1600-h/indirect_green.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5164576442855902210" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_Qn3H-rTPwac/R6xC6WPGzAI/AAAAAAAAADQ/woaJSrAKwOk/s400/indirect_green.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_Qn3H-rTPwac/R6xDC2PGzBI/AAAAAAAAADY/oCT4ACoyN6E/s1600-h/indirect_purple.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5164576588884790290" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_Qn3H-rTPwac/R6xDC2PGzBI/AAAAAAAAADY/oCT4ACoyN6E/s400/indirect_purple.PNG" 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/19919004-1119935702631773333?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/1119935702631773333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=1119935702631773333' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/1119935702631773333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/1119935702631773333'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2008/02/dynamic-indirect-lighting-i-got.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Qn3H-rTPwac/R6xCwmPGy_I/AAAAAAAAADI/rYweISfRV2M/s72-c/indirect_red.PNG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-5307440860018202862</id><published>2008-02-01T14:14:00.000+01:00</published><updated>2008-02-01T15:43:26.552+01:00</updated><title type='text'></title><content type='html'>I've been quite busy with the engine lately. The new stuff is:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Dynamic reflections&lt;/strong&gt;&lt;br /&gt;Each reflective object has it's own cube enviroment map. I support multiple bounces by spreading out the cube map updates over a number of frames. This means there can be some subtle "popping" in the reflections. Acceptable for my application.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;HDR pipeline&lt;/strong&gt;&lt;br /&gt;I now support 64 or 128 bit HDR rendering. Pretty standard stuff where I do tone mapping based on image luminance. Of course there is also a bloom filter (as if we're not tired of that one by now;))&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Antialiasing&lt;/strong&gt;&lt;br /&gt;One of the biggest drawbacks with deferred shading is the lack of support for multisample antialias (at least with DX9). The usual thing to do is to hack antialias by performing an edge detection filter and blurring the image only on the edges. It's a dirty hack but it works quite well.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Dynamic indirect illumination&lt;/strong&gt;&lt;br /&gt;This is a variant of &lt;a href="http://graphics.cs.ucf.edu/GPUassistedGI/GPUGISubmission.pdf"&gt;this paper&lt;/a&gt;. In short, I partition the world into a uniform grid, and at each grid point I capture the incident radiance field. This is done by rendering a cube map and then projecting it to spherical harmonics coefficients. The coefficients are stored in a number of volume textures. When rendering the frame, SH cofficients representing the incident radiance at each pixel are fetched from the volume texture and used to approximate the incident diffuse lighting at each pixel.&lt;br /&gt;&lt;br /&gt;Right now there are some problems with my implementation but I'll solve that soon ;)&lt;br /&gt;&lt;br /&gt;At last, the mandotary screenshot:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_Qn3H-rTPwac/R6Mb1mPGy-I/AAAAAAAAADA/AC2hsl_NBDA/s1600-h/reflections_hdr.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5162000205507644386" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_Qn3H-rTPwac/R6Mb1mPGy-I/AAAAAAAAADA/AC2hsl_NBDA/s400/reflections_hdr.PNG" 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/19919004-5307440860018202862?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/5307440860018202862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=5307440860018202862' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/5307440860018202862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/5307440860018202862'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2008/02/ive-been-quite-busy-with-engine-lately.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Qn3H-rTPwac/R6Mb1mPGy-I/AAAAAAAAADA/AC2hsl_NBDA/s72-c/reflections_hdr.PNG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-2040501469330825961</id><published>2008-01-10T16:21:00.000+01:00</published><updated>2008-01-10T19:37:02.859+01:00</updated><title type='text'></title><content type='html'>I've finally started working on the engine after the holidays.&lt;br /&gt;&lt;br /&gt;I've done quite a lot of non graphic stuff. I've improved the engine code here and there and I've added picking for example.&lt;br /&gt;&lt;br /&gt;On the graphic side, I've added support for cube maps and thus omidirectional shadows. All lights now also supports gobos, i.e. color textures that are projected from the lights. There is also support for reflections, but I'm still working on dynamic ones.&lt;br /&gt;&lt;br /&gt;Scenes with a lot of lights also means a lot of shadow maps. For this reason, I've implemented a shadow map queue. When a shadow map needs an update it's added to the queue and every frame a number of entries in the queue are removed and processed. So only a small number of shadow maps are updated each frame. This of course means that there can be some noticable shadow lag when objects are moved around. For the type of application I have in mind for this engine, that is acceptable.&lt;br /&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;a href="http://4.bp.blogspot.com/_Qn3H-rTPwac/R4Y4ckbJfPI/AAAAAAAAAC4/DQvONjmc7no/s1600-h/omni_shadows.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5153868887037148402" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_Qn3H-rTPwac/R4Y4ckbJfPI/AAAAAAAAAC4/DQvONjmc7no/s400/omni_shadows.PNG" border="0" /&gt;&lt;/a&gt; &lt;span style="font-size:78%;"&gt;Omnidirectional shadow mapping&lt;/span&gt;&lt;/div&gt;&lt;span style="font-size:78%;"&gt;&lt;/span&gt;&lt;div align="center"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="center"&gt;&lt;a href="http://4.bp.blogspot.com/_Qn3H-rTPwac/R4Y4VkbJfOI/AAAAAAAAACw/K7_DCnJvnk8/s1600-h/gobos.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5153868766778064098" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_Qn3H-rTPwac/R4Y4VkbJfOI/AAAAAAAAACw/K7_DCnJvnk8/s400/gobos.PNG" border="0" /&gt;&lt;/a&gt; &lt;span style="font-size:78%;"&gt;Point- and spotlights with gobos&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;a href="http://3.bp.blogspot.com/_Qn3H-rTPwac/R4Y4OUbJfNI/AAAAAAAAACo/0BDhXhnbkGs/s1600-h/gobos2.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5153868642224012498" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_Qn3H-rTPwac/R4Y4OUbJfNI/AAAAAAAAACo/0BDhXhnbkGs/s400/gobos2.PNG" border="0" /&gt;&lt;/a&gt; &lt;span style="font-size:78%;"&gt;Lots of lights! All cast shadows and some use gobos.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-2040501469330825961?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/2040501469330825961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=2040501469330825961' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/2040501469330825961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/2040501469330825961'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2008/01/blog-post.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Qn3H-rTPwac/R4Y4ckbJfPI/AAAAAAAAAC4/DQvONjmc7no/s72-c/omni_shadows.PNG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-6261829064365481048</id><published>2007-12-03T15:23:00.001+01:00</published><updated>2007-12-03T16:13:32.105+01:00</updated><title type='text'>The power of vectorization</title><content type='html'>&lt;p&gt;Since I have no new cool visuals to show, I'd thought I should blog about some random tech-topic. So lets talk about vectorization in shaders. Doing this in your HLSL code can improve the compiled code significantly. For example, a naive implementation of my bilateral boxfilter looks something like this: &lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;half d[9];&lt;br /&gt;half3 n[9];&lt;br /&gt;half2 uv[9];&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i=0; i&amp;lt;9; ++i)&lt;br /&gt;{&lt;br /&gt;    uv[i] = texCoord + offsets[i];&lt;br /&gt;    d[i] = GB_GetDepth(uv[i]);&lt;br /&gt;    n[i] = GB_GetNormal(uv[i]);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;// calculate wieghts&lt;/span&gt;&lt;br /&gt;half w[9];&lt;br /&gt;half wSum = 0;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i=0; i&amp;lt;9; i++)&lt;br /&gt;{&lt;br /&gt;    half wn = pow(dot(n[0], n[i]),32);&lt;br /&gt;    half wz = (EPSILON + abs(d[0] - d[i]));&lt;br /&gt;&lt;br /&gt;    w[i] = wn / wz;&lt;br /&gt;    wSum += w[i];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;// normalize weights&lt;/span&gt;&lt;br /&gt;wSum = 1.0f/wSum;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;// sample and apply weights&lt;/span&gt;&lt;br /&gt;half3 color = 0;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i=0; i&amp;lt;9; i++)&lt;br /&gt;    color += GB_GetDiffuse(uv[i]) * w[i] * wSum;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;return&lt;/span&gt; float4(color,1);&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;With the ps2_b profile, this compiles to:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;&lt;br /&gt;  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;ps_2_x&lt;br /&gt; def c9, 2, -1, 32, 100&lt;br /&gt; def c10, 0.00999999978, 0, 0, 0&lt;br /&gt; dcl t0.xy&lt;br /&gt; dcl_2d s0&lt;br /&gt; dcl_2d s1&lt;br /&gt; dcl_2d s2&lt;br /&gt; add r0.xy, t0, c1&lt;br /&gt; add r1.xy, t0, c0&lt;br /&gt; add r2.xy, t0, c2&lt;br /&gt; add r3.xy, t0, c3&lt;br /&gt; add r4.xy, t0, c4&lt;br /&gt; add r5.xy, t0, c5&lt;br /&gt; add r6.xy, t0, c6&lt;br /&gt; add r7.xy, t0, c7&lt;br /&gt; add r8.xy, t0, c8&lt;br /&gt; texld r9, r0, s2&lt;br /&gt; texld r10, r1, s2&lt;br /&gt; texld r11, r0, s1&lt;br /&gt; texld r0, r0, s0&lt;br /&gt; texld r12, r1, s1&lt;br /&gt; texld r1, r1, s0&lt;br /&gt; texld r13, r2, s2&lt;br /&gt; texld r14, r2, s1&lt;br /&gt; texld r2, r2, s0&lt;br /&gt; texld r15, r3, s2&lt;br /&gt; texld r16, r3, s1&lt;br /&gt; texld r3, r3, s0&lt;br /&gt; texld r17, r4, s2&lt;br /&gt; texld r18, r4, s1&lt;br /&gt; texld r4, r4, s0&lt;br /&gt; texld r19, r5, s2&lt;br /&gt; texld r20, r5, s1&lt;br /&gt; texld r5, r5, s0&lt;br /&gt; texld r21, r6, s2&lt;br /&gt; texld r22, r6, s1&lt;br /&gt; texld r6, r6, s0&lt;br /&gt; texld r23, r7, s2&lt;br /&gt; texld r24, r7, s1&lt;br /&gt; texld r7, r7, s0&lt;br /&gt; texld r25, r8, s2&lt;br /&gt; texld r26, r8, s1&lt;br /&gt; texld r8, r8, s0&lt;br /&gt; add_pp r0.w, -r9.x, r10.x&lt;br /&gt; abs_pp r0.w, r0.w&lt;br /&gt; add_pp r0.w, r0.w, c10.x&lt;br /&gt; rcp r0.w, r0.w&lt;br /&gt; mad r9.xyz, r11, c9.x, c9.y&lt;br /&gt; mad r11.xyz, r12, c9.x, c9.y&lt;br /&gt; dp3_pp r1.w, r11, r9&lt;br /&gt; pow_pp r2.w, r1.w, c9.z&lt;br /&gt; mul r0.w, r0.w, r2.w&lt;br /&gt; dp3_pp r1.w, r11, r11&lt;br /&gt; pow_pp r2.w, r1.w, c9.z&lt;br /&gt; mad_pp r1.w, r2.w, c9.w, r0.w&lt;br /&gt; mul r0.xyz, r0, r0.w&lt;br /&gt; mul r0.w, r2.w, c9.w&lt;br /&gt; add_pp r2.w, r10.x, -r13.x&lt;br /&gt; abs_pp r2.w, r2.w&lt;br /&gt; add_pp r2.w, r2.w, c10.x&lt;br /&gt; rcp r2.w, r2.w&lt;br /&gt; mad r9.xyz, r14, c9.x, c9.y&lt;br /&gt; dp3_pp r3.w, r11, r9&lt;br /&gt; pow_pp r4.w, r3.w, c9.z&lt;br /&gt; mad_pp r1.w, r4.w, r2.w, r1.w&lt;br /&gt; mul r2.w, r2.w, r4.w&lt;br /&gt; add_pp r3.w, r10.x, -r15.x&lt;br /&gt; abs_pp r3.w, r3.w&lt;br /&gt; add_pp r3.w, r3.w, c10.x&lt;br /&gt; rcp r3.w, r3.w&lt;br /&gt; mad r9.xyz, r16, c9.x, c9.y&lt;br /&gt; dp3_pp r4.w, r11, r9&lt;br /&gt; pow_pp r5.w, r4.w, c9.z&lt;br /&gt; mad_pp r1.w, r5.w, r3.w, r1.w&lt;br /&gt; mul r3.w, r3.w, r5.w&lt;br /&gt; add_pp r4.w, r10.x, -r17.x&lt;br /&gt; abs_pp r4.w, r4.w&lt;br /&gt; add_pp r4.w, r4.w, c10.x&lt;br /&gt; rcp r4.w, r4.w&lt;br /&gt; mad r9.xyz, r18, c9.x, c9.y&lt;br /&gt; dp3_pp r5.w, r11, r9&lt;br /&gt; pow_pp r6.w, r5.w, c9.z&lt;br /&gt; mad_pp r1.w, r6.w, r4.w, r1.w&lt;br /&gt; mul r4.w, r4.w, r6.w&lt;br /&gt; add_pp r5.w, r10.x, -r19.x&lt;br /&gt; abs_pp r5.w, r5.w&lt;br /&gt; add_pp r5.w, r5.w, c10.x&lt;br /&gt; rcp r5.w, r5.w&lt;br /&gt; mad r9.xyz, r20, c9.x, c9.y&lt;br /&gt; dp3_pp r6.w, r11, r9&lt;br /&gt; pow_pp r7.w, r6.w, c9.z&lt;br /&gt; mad_pp r1.w, r7.w, r5.w, r1.w&lt;br /&gt; mul r5.w, r5.w, r7.w&lt;br /&gt; add_pp r6.w, r10.x, -r21.x&lt;br /&gt; abs_pp r6.w, r6.w&lt;br /&gt; add_pp r6.w, r6.w, c10.x&lt;br /&gt; rcp r6.w, r6.w&lt;br /&gt; mad r9.xyz, r22, c9.x, c9.y&lt;br /&gt; dp3_pp r7.w, r11, r9&lt;br /&gt; pow_pp r8.w, r7.w, c9.z&lt;br /&gt; mad_pp r1.w, r8.w, r6.w, r1.w&lt;br /&gt; mul r6.w, r6.w, r8.w&lt;br /&gt; add_pp r7.w, r10.x, -r23.x&lt;br /&gt; abs_pp r7.w, r7.w&lt;br /&gt; add_pp r7.w, r7.w, c10.x&lt;br /&gt; rcp r7.w, r7.w&lt;br /&gt; mad r9.xyz, r24, c9.x, c9.y&lt;br /&gt; dp3_pp r8.w, r11, r9&lt;br /&gt; pow_pp r11.w, r8.w, c9.z&lt;br /&gt; mad_pp r1.w, r11.w, r7.w, r1.w&lt;br /&gt; mul r7.w, r7.w, r11.w&lt;br /&gt; add_pp r8.w, r10.x, -r25.x&lt;br /&gt; abs_pp r8.w, r8.w&lt;br /&gt; add_pp r8.w, r8.w, c10.x&lt;br /&gt; rcp r8.w, r8.w&lt;br /&gt; mad r9.xyz, r26, c9.x, c9.y&lt;br /&gt; dp3_pp r9.x, r11, r9&lt;br /&gt; pow_pp r10.x, r9.x, c9.z&lt;br /&gt; mad_pp r1.w, r10.x, r8.w, r1.w&lt;br /&gt; mul r8.w, r8.w, r10.x&lt;br /&gt; rcp_pp r1.w, r1.w&lt;br /&gt; mul r0.xyz, r0, r1.w&lt;br /&gt; mul r1.xyz, r1, r0.w&lt;br /&gt; mad_pp r0.xyz, r1, r1.w, r0&lt;br /&gt; mul r1.xyz, r2, r2.w&lt;br /&gt; mad_pp r0.xyz, r1, r1.w, r0&lt;br /&gt; mul r1.xyz, r3, r3.w&lt;br /&gt; mad_pp r0.xyz, r1, r1.w, r0&lt;br /&gt; mul r1.xyz, r4, r4.w&lt;br /&gt; mad_pp r0.xyz, r1, r1.w, r0&lt;br /&gt; mul r1.xyz, r5, r5.w&lt;br /&gt; mad_pp r0.xyz, r1, r1.w, r0&lt;br /&gt; mul r1.xyz, r6, r6.w&lt;br /&gt; mad_pp r0.xyz, r1, r1.w, r0&lt;br /&gt; mul r1.xyz, r7, r7.w&lt;br /&gt; mad_pp r0.xyz, r1, r1.w, r0&lt;br /&gt; mul r1.xyz, r8, r8.w&lt;br /&gt; mad_pp r0.xyz, r1, r1.w, r0&lt;br /&gt; mov_pp r0.w, -c9.y&lt;br /&gt; mov_pp oC0, r0&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This is an example of bad vectorization. The shader compiles to 151 instructions of witch 124 is arithmetic. The problem is that many instructions (like &lt;strong&gt;pow&lt;/strong&gt; and &lt;strong&gt;abs&lt;/strong&gt;) are not used with full power. Many instructions are SIMD instructions and can work on multiple data in parallel. &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;We can rewrite this shader to perform some of the arithmetic's in parallel like this:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;&lt;br /&gt;  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;half3 n[9];&lt;br /&gt;half3 c[9];&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i=0; i&amp;lt;9; ++i)&lt;br /&gt;{&lt;br /&gt;    half2 uv = texCoord + offsets[i];&lt;br /&gt;    n[i] = GB_GetNormal(uv);&lt;br /&gt;    c[i] = GB_GetDiffuse(uv);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;// calculate normal wieghts &lt;/span&gt;&lt;br /&gt;half4 wn1;&lt;br /&gt;wn1.x = dot(n[0], n[1]);&lt;br /&gt;wn1.y = dot(n[0], n[2]);&lt;br /&gt;wn1.z = dot(n[0], n[3]);&lt;br /&gt;wn1.w = dot(n[0], n[4]);&lt;br /&gt;wn1 = pow(wn1, 32);&lt;br /&gt;&lt;br /&gt;half4 wn2;&lt;br /&gt;wn2.x = dot(n[0], n[5]);&lt;br /&gt;wn2.y = dot(n[0], n[6]);&lt;br /&gt;wn2.z = dot(n[0], n[7]);&lt;br /&gt;wn2.w = dot(n[0], n[8]);&lt;br /&gt;wn2 = pow(wn2, 32);&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;// calculate depth wieghts &lt;/span&gt;&lt;br /&gt;half d = GB_GetDepth(texCoord + offsets[0]);&lt;br /&gt;&lt;br /&gt;half4 d1;&lt;br /&gt;d1.x = GB_GetDepth(texCoord + offsets[1]);&lt;br /&gt;d1.y = GB_GetDepth(texCoord + offsets[2]);&lt;br /&gt;d1.z = GB_GetDepth(texCoord + offsets[3]);&lt;br /&gt;d1.w = GB_GetDepth(texCoord + offsets[4]);&lt;br /&gt;&lt;br /&gt;half4 d2;&lt;br /&gt;d2.x = GB_GetDepth(texCoord + offsets[5]);&lt;br /&gt;d2.y = GB_GetDepth(texCoord + offsets[6]);&lt;br /&gt;d2.z = GB_GetDepth(texCoord + offsets[7]);&lt;br /&gt;d2.w = GB_GetDepth(texCoord + offsets[8]);&lt;br /&gt;&lt;br /&gt;half4 wd1 = EPSILON + abs(d - d1);&lt;br /&gt;half4 wd2 = EPSILON + abs(d - d2);&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;// divide normal weights with depth ones&lt;/span&gt;&lt;br /&gt;half4 w1 = wn1 / wd1;&lt;br /&gt;half4 w2 = wn2 / wd2;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;// calc weight 0&lt;/span&gt;&lt;br /&gt;half w0 = pow(dot(n[0], n[0]),32) / EPSILON;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;// calc sum&lt;/span&gt;&lt;br /&gt;half4 wSumTmp = w1 + w2; &lt;span style="color: #008000"&gt;// perform sumation of weights 1+4,2+5,3+6,4+8&lt;/span&gt;&lt;br /&gt;half wSum = w0 + dot(wSumTmp, float4(1,1,1,1)); &lt;span style="color: #008000"&gt;// sum all weights&lt;/span&gt;&lt;br /&gt;wSum = 1.0f/wSum;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;// normalize weights&lt;/span&gt;&lt;br /&gt;w0 *= wSum;&lt;br /&gt;w1 *= wSum;&lt;br /&gt;w2 *= wSum;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #008000"&gt;//apply weights&lt;/span&gt;&lt;br /&gt;half3 color = c[0] * w0;&lt;br /&gt;color += c[1] * w1.x;&lt;br /&gt;color += c[2] * w1.y;&lt;br /&gt;color += c[3] * w1.z;&lt;br /&gt;color += c[4] * w1.w;&lt;br /&gt;color += c[5] * w2.x;&lt;br /&gt;color += c[6] * w2.y;&lt;br /&gt;color += c[7] * w2.z;&lt;br /&gt;color += c[8] * w2.w;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This compiles to:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4"&gt;&lt;br /&gt;  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;ps_2_x&lt;br /&gt;def c9, 2, -1, 0.00999999978, 32&lt;br /&gt;def c10, 100, 0, 0, 0&lt;br /&gt;dcl t0.xy&lt;br /&gt;dcl_2d s0&lt;br /&gt;dcl_2d s1&lt;br /&gt;dcl_2d s2&lt;br /&gt;add_pp r0.xy, t0, c5&lt;br /&gt;add_pp r1.xy, t0, c0&lt;br /&gt;add_pp r2.xy, t0, c6&lt;br /&gt;add_pp r3.xy, t0, c7&lt;br /&gt;add_pp r4.xy, t0, c8&lt;br /&gt;add_pp r5.xy, t0, c1&lt;br /&gt;add_pp r6.xy, t0, c2&lt;br /&gt;add_pp r7.xy, t0, c3&lt;br /&gt;add_pp r8.xy, t0, c4&lt;br /&gt;texld r9, r0, s1&lt;br /&gt;texld r10, r1, s1&lt;br /&gt;texld r11, r2, s1&lt;br /&gt;texld r12, r3, s1&lt;br /&gt;texld r13, r4, s1&lt;br /&gt;texld_pp r14, r0, s2&lt;br /&gt;texld r0, r0, s0&lt;br /&gt;texld_pp r15, r2, s2&lt;br /&gt;texld r2, r2, s0&lt;br /&gt;texld_pp r16, r3, s2&lt;br /&gt;texld r3, r3, s0&lt;br /&gt;texld_pp r17, r4, s2&lt;br /&gt;texld r4, r4, s0&lt;br /&gt;texld_pp r18, r1, s2&lt;br /&gt;texld r1, r1, s0&lt;br /&gt;texld r19, r5, s1&lt;br /&gt;texld r20, r6, s1&lt;br /&gt;texld r21, r7, s1&lt;br /&gt;texld r22, r8, s1&lt;br /&gt;texld_pp r23, r5, s2&lt;br /&gt;texld r5, r5, s0&lt;br /&gt;texld_pp r24, r6, s2&lt;br /&gt;texld r6, r6, s0&lt;br /&gt;texld_pp r25, r7, s2&lt;br /&gt;texld r7, r7, s0&lt;br /&gt;texld_pp r26, r8, s2&lt;br /&gt;texld r8, r8, s0&lt;br /&gt;mad r9.xyz, r9, c9.x, c9.y&lt;br /&gt;mad r10.xyz, r10, c9.x, c9.y&lt;br /&gt;dp3_pp r9.x, r10, r9&lt;br /&gt;mad r11.xyz, r11, c9.x, c9.y&lt;br /&gt;dp3_pp r9.y, r10, r11&lt;br /&gt;mad r11.xyz, r12, c9.x, c9.y&lt;br /&gt;dp3_pp r9.z, r10, r11&lt;br /&gt;mad r11.xyz, r13, c9.x, c9.y&lt;br /&gt;dp3_pp r9.w, r10, r11&lt;br /&gt;mul_pp r9, r9, r9&lt;br /&gt;mul_pp r9, r9, r9&lt;br /&gt;mul_pp r9, r9, r9&lt;br /&gt;mul_pp r9, r9, r9&lt;br /&gt;mul_pp r9, r9, r9&lt;br /&gt;mov_pp r14.y, r15.x&lt;br /&gt;mov_pp r14.z, r16.x&lt;br /&gt;mov_pp r14.w, r17.x&lt;br /&gt;add_pp r11, r18.x, -r14&lt;br /&gt;abs_pp r11, r11&lt;br /&gt;add_pp r11, r11, c9.z&lt;br /&gt;rcp r12.x, r11.x&lt;br /&gt;rcp r12.y, r11.y&lt;br /&gt;rcp r12.z, r11.z&lt;br /&gt;rcp r12.w, r11.w&lt;br /&gt;mul_pp r9, r9, r12&lt;br /&gt;mad r11.xyz, r19, c9.x, c9.y&lt;br /&gt;dp3_pp r11.x, r10, r11&lt;br /&gt;mad r12.xyz, r20, c9.x, c9.y&lt;br /&gt;dp3_pp r11.y, r10, r12&lt;br /&gt;mad r12.xyz, r21, c9.x, c9.y&lt;br /&gt;dp3_pp r11.z, r10, r12&lt;br /&gt;mad r12.xyz, r22, c9.x, c9.y&lt;br /&gt;dp3_pp r11.w, r10, r12&lt;br /&gt;dp3_pp r0.w, r10, r10&lt;br /&gt;mul_pp r10, r11, r11&lt;br /&gt;mul_pp r10, r10, r10&lt;br /&gt;mul_pp r10, r10, r10&lt;br /&gt;mul_pp r10, r10, r10&lt;br /&gt;mul_pp r10, r10, r10&lt;br /&gt;mov_pp r23.y, r24.x&lt;br /&gt;mov_pp r23.z, r25.x&lt;br /&gt;mov_pp r23.w, r26.x&lt;br /&gt;add_pp r11, r18.x, -r23&lt;br /&gt;abs_pp r11, r11&lt;br /&gt;add_pp r11, r11, c9.z&lt;br /&gt;rcp r12.x, r11.x&lt;br /&gt;rcp r12.y, r11.y&lt;br /&gt;rcp r12.z, r11.z&lt;br /&gt;rcp r12.w, r11.w&lt;br /&gt;mad_pp r11, r10, r12, r9&lt;br /&gt;mul_pp r10, r10, r12&lt;br /&gt;dp4 r1.w, r11, -c9.y&lt;br /&gt;pow_pp r2.w, r0.w, c9.w&lt;br /&gt;mad_pp r0.w, r2.w, c10.x, r1.w&lt;br /&gt;mul_pp r1.w, r2.w, c10.x&lt;br /&gt;rcp_pp r0.w, r0.w&lt;br /&gt;mul_pp r10, r10, r0.w&lt;br /&gt;mul_pp r5.xyz, r5, r10.x&lt;br /&gt;mul_pp r1.w, r1.w, r0.w&lt;br /&gt;mul_pp r9, r9, r0.w&lt;br /&gt;mad_pp r1.xyz, r1, r1.w, r5&lt;br /&gt;mad_pp r1.xyz, r6, r10.y, r1&lt;br /&gt;mad_pp r1.xyz, r7, r10.z, r1&lt;br /&gt;mad_pp r1.xyz, r8, r10.w, r1&lt;br /&gt;mad_pp r0.xyz, r0, r9.x, r1&lt;br /&gt;mad_pp r0.xyz, r2, r9.y, r0&lt;br /&gt;mad_pp r0.xyz, r3, r9.z, r0&lt;br /&gt;mad_pp r0.xyz, r4, r9.w, r0&lt;br /&gt;mov_pp r0.w, -c9.y&lt;br /&gt;mov_pp oC0, r0&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This time there is 108 instructions of witch 81 arithmetic. &lt;br /&gt;  &lt;br /&gt;In this shader, when calculating the weights, more work is done per instruction. For example, the pow instruction is used only three times instead of eight. The summation of weights are done with two add and one dp4 instead of nine add. &lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;Note that we could have vectorized the texture coordinate calculations as well, but then we would need SM 3.0 (arbitrary swizzles) and change how the offset constant is set up.&amp;#160; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;With a small effort we got rid of 43 ALU instructions! It should be noted that this necessarily won't lead to a speed-up since instruction count is just part of the story. ALU/Texture instruction ratio, texture cache etc. comes in to play as well. On my Radeon X1600 this shader is limitied by texture lookups so the win is not that big.&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;At last I would like to point out that I'm by no means a shader optimization guru, just a guy trying to fill his blog ;)&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-6261829064365481048?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/6261829064365481048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=6261829064365481048' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/6261829064365481048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/6261829064365481048'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2007/12/power-of-vectorization.html' title='The power of vectorization'/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-4877366753776793164</id><published>2007-11-29T17:06:00.000+01:00</published><updated>2007-11-29T17:41:04.068+01:00</updated><title type='text'></title><content type='html'>&lt;strong&gt;Light volumes and more&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I've not been able to work much on the engine the last week since I've been busy with school projects.&lt;br /&gt;&lt;br /&gt;Some things have been done though. I've updated the deferred rendering system to work with light volumes instead of full-screen quads. This alone provides a huge speedup as long as the lights are reasonably small. This also made me think about light attenuation. Funny enough, &lt;a href="http://www.gamedev.net/community/forums/topic.asp?topic_id=474015"&gt;this thread&lt;/a&gt; at gamdev popped up today. As discussed in the thread, I also wanted to find a way to set a maximum radius for a light, without affecting its atenuation too much. After some playing around with Maple, I found that max(0, 1-1/maxRadius*x)/(1+k*x^2) does the job quite good (this function is suggested in the thread) . I implemented it in my lighting shaders and the result is fine. I also took the opportunity to shave of a few instructions.&lt;br /&gt;&lt;br /&gt;Here are some screens:&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_Qn3H-rTPwac/R07o0F9yLII/AAAAAAAAACg/tZ9M5jH2zio/s1600-h/lights.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5138300206528474242" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_Qn3H-rTPwac/R07o0F9yLII/AAAAAAAAACg/tZ9M5jH2zio/s400/lights.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_Qn3H-rTPwac/R07ol19yLHI/AAAAAAAAACY/RaFtciDYvSA/s1600-h/100_plus_lights.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5138299961715338354" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_Qn3H-rTPwac/R07ol19yLHI/AAAAAAAAACY/RaFtciDYvSA/s400/100_plus_lights.PNG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;In the second shot there is 100+ lights. As you can see, the point lights does not cast shadows yet. I will also need to implement a 64 bit HDR pipeline as I get oversaturation and banding artifacts. &lt;/p&gt;&lt;p&gt;I've also ordered a AMD HD3870. While slightly slower than the Nvidia 8800GT, it's slightly cheaper and most importantly: it's &lt;em&gt;available&lt;/em&gt; ;)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-4877366753776793164?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/4877366753776793164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=4877366753776793164' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/4877366753776793164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/4877366753776793164'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2007/11/light-volumes-and-more-ive-not-been.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Qn3H-rTPwac/R07o0F9yLII/AAAAAAAAACg/tZ9M5jH2zio/s72-c/lights.PNG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-8470238434474897818</id><published>2007-11-20T12:51:00.000+01:00</published><updated>2007-11-20T13:14:40.683+01:00</updated><title type='text'></title><content type='html'>&lt;strong&gt;Eliminating noise&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The last couple of days I have tried to reduse the noise in the SSAO output. It proved to be a hard problem. My initial attempt was to simply apply a separable gaussian blur. It produced a nice, smooth image. But as I expected it resulted in ugly halos around object edges when combined with the albedo term. Next I tried to combine the gaussian with some edge detection trickery. Looked kind of cool, but unfortunally it just reduced the halos and did not eliminate them.&lt;br /&gt;&lt;br /&gt;Then I turned to bilateral upsampling (&lt;a href="http://levelofdetail.wordpress.com/2007/11/01/image-based-proxy-accumulation-for-real-time-soft-global-illumination/"&gt;see Jeremy Shopf's blog&lt;/a&gt;). Eliminated halos, but the SSAO input was way to noisy for simple bilinear filtering. My last atempt was a combination of a box blur and a variant of bilateral filtering. The result is acceptable. I'm not satisfied, but it will do for now.&lt;br /&gt;&lt;br /&gt;Next up is some speed optimizations and then I'm on to indirect lighting. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_Qn3H-rTPwac/R0LKjlo9trI/AAAAAAAAACQ/8vraKNjI-U0/s1600-h/ssao_direct_filtered.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5134889237903947442" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_Qn3H-rTPwac/R0LKjlo9trI/AAAAAAAAACQ/8vraKNjI-U0/s400/ssao_direct_filtered.PNG" border="0" /&gt;&lt;/a&gt;  &lt;div align="center"&gt;&lt;a href="http://1.bp.blogspot.com/_Qn3H-rTPwac/R0LKa1o9tqI/AAAAAAAAACI/VWTVbUPgBZg/s1600-h/ssao_filtered.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5134889087580092066" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_Qn3H-rTPwac/R0LKa1o9tqI/AAAAAAAAACI/VWTVbUPgBZg/s400/ssao_filtered.PNG" border="0" /&gt;&lt;/a&gt; &lt;span style="font-size:78%;"&gt;SSAO + "bilateral filtering"-hack&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-8470238434474897818?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/8470238434474897818/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=8470238434474897818' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/8470238434474897818'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/8470238434474897818'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2007/11/eliminating-noise-last-couple-of-days-i.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Qn3H-rTPwac/R0LKjlo9trI/AAAAAAAAACQ/8vraKNjI-U0/s72-c/ssao_direct_filtered.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-1569465062194095147</id><published>2007-11-13T15:14:00.000+01:00</published><updated>2007-11-13T15:51:06.768+01:00</updated><title type='text'></title><content type='html'>&lt;div align="left"&gt;I've been playing around with screen-space ambient occlusion (SSAO) today, one of the AO-techniques used in Crysis. It's not trivial to get it to look good. I use the randomized normal trick described in the Crytek paper but I only sample on a hemisphere around the pixel normal to avoid self occlusion. I need to optimize the shader quite a bit, but so far this is just an evaluation of the technique and I'm quite pleased with the initial results.&lt;br /&gt;&lt;br /&gt;Mandatory screenshots: &lt;/div&gt;&lt;div align="center"&gt;&lt;span style="font-size:78%;"&gt;SSAO Only:&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_Qn3H-rTPwac/Rzm4zGWznAI/AAAAAAAAABw/JA8p1a7BgMk/s1600-h/ssao_raw.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5132336438384499714" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_Qn3H-rTPwac/Rzm4zGWznAI/AAAAAAAAABw/JA8p1a7BgMk/s400/ssao_raw.PNG" border="0" /&gt; &lt;p align="center"&gt;&lt;/a&gt; &lt;span style="font-size:78%;"&gt;SSAO + direct lighting&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;a href="http://3.bp.blogspot.com/_Qn3H-rTPwac/Rzm49GWznBI/AAAAAAAAAB4/8ux-KItlAQI/s1600-h/ssao_combined4.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5132336610183191570" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_Qn3H-rTPwac/Rzm49GWznBI/AAAAAAAAAB4/8ux-KItlAQI/s400/ssao_combined4.PNG" border="0" /&gt;&lt;/a&gt; &lt;a href="http://3.bp.blogspot.com/_Qn3H-rTPwac/Rzm5IGWznCI/AAAAAAAAACA/zAN1x-bC6EI/s1600-h/ssao_combined2.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5132336799161752610" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_Qn3H-rTPwac/Rzm5IGWznCI/AAAAAAAAACA/zAN1x-bC6EI/s400/ssao_combined2.PNG" 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/19919004-1569465062194095147?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/1569465062194095147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=1569465062194095147' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/1569465062194095147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/1569465062194095147'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2007/11/ive-been-playing-around-with-screen.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_Qn3H-rTPwac/Rzm4zGWznAI/AAAAAAAAABw/JA8p1a7BgMk/s72-c/ssao_raw.PNG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-6520291856410057298</id><published>2007-11-09T16:30:00.000+01:00</published><updated>2007-11-09T16:36:56.051+01:00</updated><title type='text'></title><content type='html'>Wheee! Shadows!&lt;br /&gt;&lt;div&gt;&lt;a href="http://1.bp.blogspot.com/_Qn3H-rTPwac/RzR-A2Wzm6I/AAAAAAAAABA/LP51ChIFCo4/s1600-h/nebulax_shadows2.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5130864428538108834" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_Qn3H-rTPwac/RzR-A2Wzm6I/AAAAAAAAABA/LP51ChIFCo4/s400/nebulax_shadows2.PNG" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;a href="http://4.bp.blogspot.com/_Qn3H-rTPwac/RzR-ImWzm7I/AAAAAAAAABI/wmo9PQIBHFM/s1600-h/nebulax_shadows.PNG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5130864561682095026" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_Qn3H-rTPwac/RzR-ImWzm7I/AAAAAAAAABI/wmo9PQIBHFM/s400/nebulax_shadows.PNG" 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/19919004-6520291856410057298?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/6520291856410057298/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=6520291856410057298' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/6520291856410057298'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/6520291856410057298'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2007/11/wheee-shadows.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_Qn3H-rTPwac/RzR-A2Wzm6I/AAAAAAAAABA/LP51ChIFCo4/s72-c/nebulax_shadows2.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-6304105613420464182</id><published>2007-10-24T21:32:00.000+02:00</published><updated>2007-10-24T22:44:56.618+02:00</updated><title type='text'></title><content type='html'>&lt;strong&gt;First screenshots of NebulaX&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I have been working on my new engine for some months now and I thought it was time to start blogging again.&lt;br /&gt;&lt;br /&gt;Here are some random facts about the new engine:&lt;br /&gt;&lt;br /&gt;* Complete rewrite of my old engine.&lt;br /&gt;* Despite its name and contrary to my previous posts: it's 100% API-independent.&lt;br /&gt;* Only XNA 1.1 renderer at the moment&lt;br /&gt;* Pluggable rendering pipeline, but only deferred shading pipeline atm.&lt;br /&gt;* DXEffect-like effect system based on XML&lt;br /&gt;* Shader language independent, only HLSL impl. atm.&lt;br /&gt;* "Super-shader"-style effects for generating shader permutations&lt;br /&gt;* Post-processing framework&lt;br /&gt;* Pluggable scene management system&lt;br /&gt;* Pluggable mesh import pipeline, only COLLADA support atm.&lt;br /&gt;* Optimized math library&lt;br /&gt;* Everything is witten in C# execpt the math lib witch is written in C++/CLI.&lt;br /&gt;* &lt;strong&gt;Zero&lt;/strong&gt; GC collections during runtime!&lt;br /&gt;&lt;br /&gt;Sounds like marketing bull, and it is:) There's quite a few places in the code that needs to get cleaned up but this is work in progress.&lt;br /&gt;&lt;br /&gt;Below is some screenies showing some deferred shading tests.&lt;br /&gt;One point light and 5 colored spot lights.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://4.bp.blogspot.com/_Qn3H-rTPwac/Rx-lEk3c09I/AAAAAAAAAAo/Nvh-yTZT11w/s1600-h/deferred2.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5124996399005225938" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_Qn3H-rTPwac/Rx-lEk3c09I/AAAAAAAAAAo/Nvh-yTZT11w/s320/deferred2.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_Qn3H-rTPwac/Rx-lzE3c0-I/AAAAAAAAAAw/jO6BTnSsg20/s1600-h/deferred3.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5124997197869143010" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_Qn3H-rTPwac/Rx-lzE3c0-I/AAAAAAAAAAw/jO6BTnSsg20/s320/deferred3.jpg" 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/19919004-6304105613420464182?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/6304105613420464182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=6304105613420464182' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/6304105613420464182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/6304105613420464182'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2007/10/first-screenshots-of-nebulax-i-have.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_Qn3H-rTPwac/Rx-lEk3c09I/AAAAAAAAAAo/Nvh-yTZT11w/s72-c/deferred2.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-1604331267091549968</id><published>2007-03-01T19:06:00.000+01:00</published><updated>2007-03-01T19:47:44.471+01:00</updated><title type='text'></title><content type='html'>&lt;strong&gt;Update at last&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;I realize I'm one lazy blogger. I'm not even sure I'm &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_0"&gt;allowed&lt;/span&gt; to call this a blog with these infrequent updates:)&lt;br /&gt;&lt;br /&gt;Anyway, in my last post I mentioned that I might release some code for my GUI system. Sorry, won't happen anytime soon. The reason?&lt;br /&gt;The usual. School eating up my time.&lt;br /&gt;&lt;br /&gt;I'm taking a course in &lt;a href="http://www.cs.lth.se/DAT032/"&gt;AI&lt;/a&gt;. And it has turned out to be one of the best courses I've taken so far.&lt;br /&gt;The first assignment was to implement a &lt;a href="http://en.wikipedia.org/wiki/Draughts"&gt;Checkers &lt;/a&gt;program, and to be approved we had to enter a tournament. I teamed up with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Jesper&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;Ek&lt;/span&gt; (again) and Jacob &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;Persson&lt;/span&gt; and we set out with a &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_4"&gt;reasonable&lt;/span&gt; goal: to win the competition.&lt;br /&gt;&lt;br /&gt;And that &lt;a href="http://www.it.lth.se/courses/tai/2007/assignment1/results.stm"&gt;we did&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Our program, Black Doctor, won six games in a row but &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_5"&gt;unfortunately&lt;/span&gt; lost the last one. That was enough to win the tournament, however.&lt;br /&gt;&lt;br /&gt;Some info about the program:&lt;br /&gt;* Written in C++, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;multi&lt;/span&gt;-platform&lt;br /&gt;* &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;Bitboard&lt;/span&gt; representation of game board.&lt;br /&gt;* Alpha-Beta (iterative + recursive) and &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;MTD&lt;/span&gt;(f) searching&lt;br /&gt;* Transposition table&lt;br /&gt;* &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;Quiescense&lt;/span&gt;&lt;br /&gt;* Dynamic time management&lt;br /&gt;* Simple opening book and endgame database (3-pieces)&lt;br /&gt;* ~1M nodes/sec on a 1.7MHz Pentium M&lt;br /&gt;&lt;br /&gt;No screenie this time. Console UI's just aren't that sexy...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-1604331267091549968?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/1604331267091549968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=1604331267091549968' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/1604331267091549968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/1604331267091549968'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2007/03/update-at-last-i-realize-im-one-lazy.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-6467587397729758550</id><published>2006-12-14T22:09:00.000+01:00</published><updated>2006-12-14T22:31:16.117+01:00</updated><title type='text'></title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_Qn3H-rTPwac/RYHCfVrRzvI/AAAAAAAAAAY/vIl7PWh0Zmc/s1600-h/xnagui.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5008498104263102194" style="FLOAT: right; MARGIN: 0px 0px 10px 10px; CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_Qn3H-rTPwac/RYHCfVrRzvI/AAAAAAAAAAY/vIl7PWh0Zmc/s320/xnagui.jpg" border="0" /&gt;&lt;/a&gt;&lt;strong&gt;Going &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0" onclick="BLOG_clickHandler(this)"&gt;sloooow&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Since I just have a few hours a week to spare for engine coding, not much is happening &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1" onclick="BLOG_clickHandler(this)"&gt;atm&lt;/span&gt;. I simply have too much in school.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;That said, at least I'm doing &lt;em&gt;some &lt;/em&gt;progress:)&lt;/div&gt;&lt;div&gt;I have a nice and flexible GUI system up and running. It works pretty much like the usual &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2" onclick="BLOG_clickHandler(this)"&gt;winforms&lt;/span&gt; stuff (or any other GUI:)) and I have the most common controls implemented.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;It's fully &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3" onclick="BLOG_clickHandler(this)"&gt;skinnable&lt;/span&gt; and easy to customize and extend. Since I'm too lazy for drawing my own skin, I "&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_4"&gt;borrowed&lt;/span&gt;" a texture from &lt;a href="http://www.c-unit.com/"&gt;this&lt;/a&gt; guy:)&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;I plan to add some more stuff (including 360-controller support) and polish the &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_5"&gt;code and&lt;/span&gt; make this public with source and all. Probably some time after Christmas.&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Hopefully they don't add GUI support to XNA too soon. Would make all this pretty pointless ;)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-6467587397729758550?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/6467587397729758550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=6467587397729758550' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/6467587397729758550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/6467587397729758550'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/12/going-sloooow.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_Qn3H-rTPwac/RYHCfVrRzvI/AAAAAAAAAAY/vIl7PWh0Zmc/s72-c/xnagui.jpg' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-7476586761312580608</id><published>2006-11-09T19:39:00.000+01:00</published><updated>2006-11-09T19:58:57.928+01:00</updated><title type='text'></title><content type='html'>I have begun coding on my new engine, entitled &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0" onclick="BLOG_clickHandler(this)"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0" onclick="BLOG_clickHandler(this)"&gt;NebulaX&lt;/span&gt;&lt;/span&gt;.&lt;br /&gt;Today I threw together a simple text rendering component and started working on a complete GUI library. Most stuff is directly ported from my old engine and altered to fit the pretty cool game component and content pipeline stuff in &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1" onclick="BLOG_clickHandler(this)"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1" onclick="BLOG_clickHandler(this)"&gt;XNA&lt;/span&gt;&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;I've &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;also&lt;/span&gt; got myself a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3" onclick="BLOG_clickHandler(this)"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2" onclick="BLOG_clickHandler(this)"&gt;XBox&lt;/span&gt; &lt;/span&gt;360 &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4" onclick="BLOG_clickHandler(this)"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3" onclick="BLOG_clickHandler(this)"&gt;gamepad&lt;/span&gt;&lt;/span&gt; for my PC. Need that to test my input code.&lt;br /&gt;&lt;br /&gt;A few days ago I found a cool open source project: &lt;a href="http://www.taoframework.com/Mono.Xna"&gt;Mono.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5" onclick="BLOG_clickHandler(this)"&gt;XNA&lt;/span&gt;&lt;/a&gt;, witch is going to be an implementation of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6" onclick="BLOG_clickHandler(this)"&gt;XNA&lt;/span&gt; using &lt;a href="http://www.mono-project.com/Main_Page"&gt;Mono&lt;/a&gt; and &lt;a href="http://www.taoframework.com/Home"&gt;Tao&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So, all you "I-use-C++-instead-of-C#-since-I-want-platform-independence" people, stop whining and start using 21&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7" onclick="BLOG_clickHandler(this)"&gt;th&lt;/span&gt; century technology:)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-7476586761312580608?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/7476586761312580608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=7476586761312580608' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/7476586761312580608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/7476586761312580608'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/11/i-have-begun-coding-on-my-new-engine.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-5138386992963214445</id><published>2006-10-23T12:22:00.000+02:00</published><updated>2006-10-23T13:19:05.471+02:00</updated><title type='text'></title><content type='html'>&lt;strong&gt;Long time, no see.. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0" onclick="BLOG_clickHandler(this)"&gt;erhm&lt;/span&gt;.. update.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I haven't worked on the engine for quite some time now. I've had lots of other stuff to do.&lt;br /&gt;This semester I've taken a course in &lt;a href="http://www.cs.lth.se/DAT075/"&gt;mobile computer graphics&lt;/a&gt;. A really great course that have given me a lot of useful knowledge about graphics hardware.&lt;br /&gt;&lt;br /&gt;In course we had to do a mobile game project using the M3G (&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1" onclick="BLOG_clickHandler(this)"&gt;JSR&lt;/span&gt;-184) Java API, and once again I teamed up with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2" onclick="BLOG_clickHandler(this)"&gt;Jesper&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3" onclick="BLOG_clickHandler(this)"&gt;Ek&lt;/span&gt;. We decided to do something different and we ended up doing a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4" onclick="BLOG_clickHandler(this)"&gt;OpenGL&lt;/span&gt; accelerated J2SE implementation of M3G. There was a competition to award the greatest game. We obviously didn't win, since we didn't make a game:) We received a Technical Achievement Award, however. The jury consisted of people from the industry, including folks from &lt;a href="http://www.sonyericsson.com/"&gt;Sony &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5" onclick="BLOG_clickHandler(this)"&gt;Ericsson&lt;/span&gt;&lt;/a&gt;, &lt;a href="http://www.tat.se/"&gt;TAT&lt;/a&gt; and &lt;a href="http://graphics.cs.lth.se/"&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6" onclick="BLOG_clickHandler(this)"&gt;LUGG&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You can check out the project &lt;a href="http://www.0xdeadbeef.se/m3g/"&gt;here&lt;/a&gt;, and the other game entries &lt;a href="http://www.cs.lth.se/DAT075/project/"&gt;here &lt;/a&gt;(some are really cool!).&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What about my engine then?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;It's discontinued. Yep. Discontinued.&lt;br /&gt;&lt;br /&gt;I have decided to not develop it any further and instead start on a completely new engine using Microsoft &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7" onclick="BLOG_clickHandler(this)"&gt;XNA&lt;/span&gt;!&lt;br /&gt;&lt;br /&gt;My old engine was 100% graphics API independent and that's &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_8"&gt;of course&lt;/span&gt; a good thing. However, &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_9"&gt;being&lt;/span&gt; a single developer with very little spare time, that resulted in slowing down the project considerably. By selecting only one API, I will be able to speed up the &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_10"&gt;development&lt;/span&gt; and focus on the cool stuff.&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11" onclick="BLOG_clickHandler(this)"&gt;XNA&lt;/span&gt; is &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_12"&gt;of course&lt;/span&gt; the obvious &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_13"&gt;choice&lt;/span&gt;.&lt;br /&gt;It still lacks some important &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_14"&gt;functionality&lt;/span&gt;, but I'm very &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_15"&gt;confident&lt;/span&gt; that that will be addressed when it's finally released. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16" onclick="BLOG_clickHandler(this)"&gt;Micsosoft&lt;/span&gt; seems very serious about &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17" onclick="BLOG_clickHandler(this)"&gt;XNA&lt;/span&gt; and I think it has a bright future.&lt;br /&gt;&lt;br /&gt;And yeah, I've "upgraded" to the new &lt;a href="http://beta.blogger.com"&gt;Blogger beta&lt;/a&gt;, so I changed to a new blog template. Sweet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-5138386992963214445?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/5138386992963214445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=5138386992963214445' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/5138386992963214445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/5138386992963214445'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/10/long-time-no-see.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-115057522667038600</id><published>2006-06-17T22:06:00.000+02:00</published><updated>2006-10-23T12:04:03.605+02:00</updated><title type='text'></title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/3231/1981/1600/refraction.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0px 0px 10px 10px; CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/3231/1981/320/refraction.jpg" border="0" /&gt;&lt;/a&gt;Today I added refraction to the water. Pretty standard stuff where the reflection and refraction textures are blended together based on the fresnel term.&lt;br /&gt;&lt;br /&gt;I've also improved the texturing a bit. If you look at the second image in my last post, you can see that the terrain at "medium" distance from the camera is blurry. I now use yet another detail texture in this region and the result is that the terrain appears to have detail at all distances.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-115057522667038600?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/115057522667038600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=115057522667038600' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/115057522667038600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/115057522667038600'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/06/today-i-added-refraction-to-water.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-115022746758631261</id><published>2006-06-13T21:33:00.000+02:00</published><updated>2006-10-23T12:04:03.541+02:00</updated><title type='text'></title><content type='html'>&lt;table style="FLOAT: right; MARGIN: 0pt 0pt 10px 10px; CURSOR: pointer" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/terrainnormalmap1.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0pt 0pt 0px 0px; CURSOR: pointer" alt="" src="http://photos1.blogger.com/blogger/3231/1981/320/terrainnormalmap1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/terrainnormalmap2.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0pt 0pt 0px 0px; CURSOR: pointer" alt="" src="http://photos1.blogger.com/blogger/3231/1981/320/terrainnormalmap2.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;Well, It has been a while since I had time to work on the engine, but today I had some time left.&lt;br /&gt;A few days ago a found a tool called &lt;a href="http://www.bundysoft.com/L3DT/"&gt;L3DT&lt;/a&gt;. It's a very cool and capable terrain generator and it inspired me to improve the texturing of the terrain.&lt;/p&gt;&lt;p&gt;Near the camera I use the same splatting technique as before but the textures are tiled at a much higher density so the ground look really highly detailed even if you look straight down. This ofcourse causes ugly repetition patterns further away. To hide this I blend in a large (1024x1024) color texture on terrain far from the camera.&lt;/p&gt;&lt;p&gt;I've also changed from vertex lighting to a normal map. This makes the lighting independent of the LOD and reduces popping artifacts. It also makes the distant terrain look more detailed.&lt;/p&gt;&lt;p&gt;I use L3DT to generate all texture data I need, since it does that a lot better than my own hack;)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-115022746758631261?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/115022746758631261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=115022746758631261' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/115022746758631261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/115022746758631261'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/06/well-it-has-been-while-since-i-had.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114867288537828780</id><published>2006-05-26T21:38:00.000+02:00</published><updated>2006-10-23T12:04:03.424+02:00</updated><title type='text'></title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/3231/1981/1600/shadows.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0px 0px 10px 10px; CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/3231/1981/320/shadows.jpg" border="0" /&gt;&lt;/a&gt; Well, Jesper and I have finished the final assignment in the ASR course. This time it was about shadows.&lt;br /&gt;&lt;br /&gt;We implemented both shadow mapping and z-fail shadow volumes. All done on the GPU. The geometry needs to be preprocessed for shadow volume extraction to work entirely on the GPU.&lt;br /&gt;&lt;br /&gt;The shot shows "soft" shadow mapping with 3x3 PCF.&lt;br /&gt;&lt;br /&gt;Nothing special, but I have to fill my blog with something when I don't have time to work on the engine:)&lt;br /&gt;&lt;br /&gt;Btw, my lecturers got their paper &lt;a href="http://graphics.cs.lth.se/research/papers/hdrtexture2006/"&gt;"High Dynamic Range Texure Compression For Graphics Hardware"&lt;/a&gt; accepted to SIGGRAPH 2006. Really sweet stuff!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114867288537828780?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114867288537828780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114867288537828780' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114867288537828780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114867288537828780'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/05/well-jesper-and-i-have-finished-final.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114777636188184024</id><published>2006-05-16T12:35:00.000+02:00</published><updated>2006-10-23T12:04:03.363+02:00</updated><title type='text'></title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/3231/1981/1600/oceanwater.0.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0px 0px 10px 10px; CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/3231/1981/320/oceanwater.0.jpg" border="0" /&gt;&lt;/a&gt; Well, I'm back from India. It was a great vacation and it feels a bit strange to be home, but I guess it's time to get back to normal life.&lt;br /&gt;&lt;br /&gt;The image is a shot from an ocean water simulation I did for an assignment in the ASR course. It features two superpositioned Gerstner waves calculated in a vertex shader.&lt;br /&gt;&lt;br /&gt;In the pixel shader I use three scrolling normal maps to add fine detail to the water. There's also cubemap reflection and refraction with fresnel terms. Finally there's a simple HDR hack to add some shininess to the highlights.&lt;br /&gt;&lt;br /&gt;When I have time to work on the engine, I'll probably update the water with a similar approach.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114777636188184024?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114777636188184024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114777636188184024' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114777636188184024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114777636188184024'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/05/well-im-back-from-india.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114567938592124442</id><published>2006-04-22T06:07:00.000+02:00</published><updated>2006-10-23T12:04:03.281+02:00</updated><title type='text'></title><content type='html'>As some might have noticed, I haven't updated the blog for some time now. The reason is that I'm on vacation in India with my girlfriend. I'll be staying here for three weeks so there will be no coding for a while:)&lt;br /&gt;&lt;br /&gt;I just wanted to thank everybody who have left comments and sent me email. It's very encouraging and makes me want to keep on going!&lt;br /&gt;&lt;br /&gt;In a few hours we're leaving for Kerala. It's supposed to be a real paradise and I think we'll have a great time!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114567938592124442?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114567938592124442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114567938592124442' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114567938592124442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114567938592124442'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/04/as-some-might-have-noticed-i-havent.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114466634957721623</id><published>2006-04-10T12:41:00.000+02:00</published><updated>2006-10-23T12:04:03.208+02:00</updated><title type='text'></title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/3231/1981/1600/grass1.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0px 0px 10px 10px; CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/3231/1981/320/grass1.jpg" border="0" /&gt;&lt;/a&gt;Yesterday I did a quick test of grass rendering.&lt;br /&gt;The grass waves slowly in the wind and is rendered as thousands of camera facing billboards. The nice thing is that everything is done on the GPU. The billboards are stored in one single static vertex buffer and the transformation to face the camera and the animation is done in a vertex shader.&lt;br /&gt;I'm also using a neat trick to "fade" the grass out over distance without the need of alpha sorting.&lt;br /&gt;&lt;br /&gt;It's not that good looking right now, but it's just a quick test. Putting it on real terrain with more variation of foliage and good texturing and lighting will hopefully make it look better.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114466634957721623?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114466634957721623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114466634957721623' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114466634957721623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114466634957721623'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/04/yesterday-i-did-quick-test-of-grass.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114437535004243416</id><published>2006-04-07T03:44:00.000+02:00</published><updated>2006-10-23T12:04:03.129+02:00</updated><title type='text'></title><content type='html'>&lt;p&gt;I got stuck when trying to redesign my engine to better support materials that depend on multiple render passes. So I started working on a cloud system instead:) &lt;/p&gt;&lt;p&gt;The system if fully dynamic and the clouds move and deform. The lighting is a (rather) simple trick but looks quite nice. I got the basic idea from an article by Michael Gehling in last months GDMag. I just modified it to suit my needs. The main problem I have is that it's very hard to tweak the system to look good in all situations. Settings that look good at dawn look crap at noon and vice versa. But I think I can solve that by interpolating settings over the day-night cycle.&lt;/p&gt;&lt;p&gt;Another problem is that things are getting rather costly as you can see on the fps counter:) So far I've done no optimizations what so ever so I think I can squeeze quite a few more fps out of this baby.&lt;/p&gt;&lt;p&gt;Here's a few new screenshots:&lt;/p&gt;&lt;p&gt;&lt;a href="http://photos1.blogger.com/blogger/3231/1981/1600/clouds1.0.jpg"&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/blogger/3231/1981/400/clouds1.0.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/3231/1981/1600/clouds4.jpg"&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/blogger/3231/1981/400/clouds4.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/3231/1981/1600/clouds2.jpg"&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/blogger/3231/1981/400/clouds2.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/3231/1981/1600/clouds3.jpg"&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/blogger/3231/1981/400/clouds3.jpg" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114437535004243416?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114437535004243416/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114437535004243416' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114437535004243416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114437535004243416'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/04/i-got-stuck-when-trying-to-redesign-my.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114418039286584174</id><published>2006-04-04T21:38:00.000+02:00</published><updated>2006-10-23T12:04:03.071+02:00</updated><title type='text'></title><content type='html'>&lt;table style="FLOAT: right; MARGIN: 0pt 0pt 10px 10px; CURSOR: pointer" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/water1.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0pt 0pt 0px 0px; CURSOR: pointer" alt="" src="http://photos1.blogger.com/blogger/3231/1981/320/water1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/water2.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0pt 0pt 0px 0px; CURSOR: pointer" alt="" src="http://photos1.blogger.com/blogger/3231/1981/320/water2.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;I've added water to the engine. So far there's only reflections but refractions are coming up.&lt;/p&gt;&lt;p&gt;Now I need to render the scene multiple times per frame. The geometry that is going to show up in reflections is first rendered to a texture. This texure is then used in a second pass where the scene is rendered as normal but the reflection texture is projected onto the water plane. The same has to be done for refractions. The reflection pass is done with a lower LOD setting to increase speed, and the distortion of the water makes it very hard to notice the decreased LOD anyway.&lt;/p&gt;&lt;p&gt;I'm not totally happy with the way these multiple render passes are handled by the engine, so I think I have to redesign a bit. That's why I left out refractions for now.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114418039286584174?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114418039286584174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114418039286584174' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114418039286584174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114418039286584174'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/04/ive-added-water-to-engine.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114407998630963661</id><published>2006-04-03T17:44:00.000+02:00</published><updated>2006-10-23T12:04:02.979+02:00</updated><title type='text'></title><content type='html'>&lt;table style="FLOAT: right; MARGIN: 0pt 0pt 10px 10px; CURSOR: pointer" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/pathtracer1.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0pt 0pt 0px 0px; CURSOR: pointer" alt="" src="http://photos1.blogger.com/blogger/3231/1981/200/pathtracer1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/pathtracer2.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0pt 0pt 0px 0px; CURSOR: pointer" alt="" src="http://photos1.blogger.com/blogger/3231/1981/200/pathtracer2.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;For the second assignment in the &lt;a href="http://www.cs.lth.se/DAT135/"&gt;ASR &lt;/a&gt;course we took a dive into the beautiful world of Global Illumination. &lt;p&gt;We had to write a Monte Carlo path tracer. The math is a bit involved but it all boils down to a very simple algorithm. Take a loot at &lt;a href="http://www.cs.lth.se/DAT135/lectures/L3.pdf"&gt;this slide&lt;/a&gt; for more information. &lt;p&gt;What you gain in simplicity you loose in speed. Since we approximate the rendering equation with random sampling (Monte Carlo integration) we need to sample a lot to reduce noise. The first image was redered at a resolution of 1024 x 1024 with 625 samples per pixel. It took 72 minutes to complete. The second one uses 2304 samples per pixels and took about 6 hours to render:) &lt;p&gt;I really like the second image. Note the caustics formed by light passing through the glass objects. Quite pretty! Kudos to Jesper for setting up that scene!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114407998630963661?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114407998630963661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114407998630963661' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114407998630963661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114407998630963661'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/04/for-second-assignment-in-asr-course-we.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114368112419979358</id><published>2006-03-30T03:01:00.000+02:00</published><updated>2006-10-23T12:04:02.915+02:00</updated><title type='text'></title><content type='html'>I've completed the atmospheric scattering implementation, and now the terrain is also affected by the scattering. Here's a few screenshots:&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://photos1.blogger.com/blogger/3231/1981/1600/terrainsky_2.jpg"&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/blogger/3231/1981/400/terrainsky_2.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/3231/1981/1600/terrainsky_1.jpg"&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/blogger/3231/1981/400/terrainsky_1.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/3231/1981/1600/terrainsky_3.0.jpg"&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/blogger/3231/1981/400/terrainsky_3.0.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/3231/1981/1600/terrainsky_4.jpg"&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/blogger/3231/1981/400/terrainsky_4.jpg" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114368112419979358?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114368112419979358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114368112419979358' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114368112419979358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114368112419979358'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/03/ive-completed-atmospheric-scattering.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114358636105073783</id><published>2006-03-29T00:37:00.000+02:00</published><updated>2006-10-23T12:04:02.848+02:00</updated><title type='text'></title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/3231/1981/1600/terrainsky1.0.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0px 0px 10px 10px; CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/3231/1981/320/terrainsky1.0.jpg" border="0" /&gt;&lt;/a&gt; I'm working on a fully dynamic sky system. It's far from finished but I couldn't resist uploading a teaser screenshot:)&lt;br /&gt;&lt;br /&gt;The system simulates atmospheric scattering, i.e. the effect of sun light scattering in different directions as it hits particles in the atmosphere.&lt;br /&gt;This is what makes the sky blue at noon and red at dawn.&lt;br /&gt;The method is described in &lt;a href="http://www.ati.com/developer/dx9/ATI-LightScattering.pdf"&gt;this paper&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The sun in the picture is not a skybox or a billboard. It's a direct result of the scattering simulation!&lt;br /&gt;&lt;br /&gt;I'll get back with more info as soon as I get this working perfeclty.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114358636105073783?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114358636105073783/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114358636105073783' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114358636105073783'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114358636105073783'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/03/im-working-on-fully-dynamic-sky-system.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114354040708386862</id><published>2006-03-28T11:49:00.000+02:00</published><updated>2006-10-23T12:04:02.777+02:00</updated><title type='text'></title><content type='html'>&lt;table style="FLOAT: right; MARGIN: 0pt 0pt 10px 10px; CURSOR: pointer" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/terrain-newtex2.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0pt 0pt 0px 0px; CURSOR: pointer" alt="" src="http://photos1.blogger.com/blogger/3231/1981/320/terrain-newtex2.6.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/terrain-newtex3.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0pt 0pt 0px 0px; CURSOR: pointer" alt="" src="http://photos1.blogger.com/blogger/3231/1981/320/terrain-newtex3.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br /&gt;Good procedural terrain texturing is not easy to achieve. That I learned yesterday. &lt;/p&gt;&lt;p&gt;In the old screenshots I used only one big blurry color texture and one detail texture. This wasn't very realistic since all types of surfaces used the same detail, resulting in for example that grass did not look like grass if I used a rock texture.&lt;/p&gt;&lt;p&gt;Now I use one argb detail texture per surface type and blend them together using a blend controller texture in a pixel shader.&lt;/p&gt;&lt;p&gt;The hard thing is to generate the blend texture. I've made a small tool that generates the this texture based on parameters in the heightmap like elevation and slope. However the result is not as good as I would like. But post-processing the texture in photoshop yields acceptable results;)&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114354040708386862?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114354040708386862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114354040708386862' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114354040708386862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114354040708386862'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/03/good-procedural-terrain-texturing-is.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114345951819778931</id><published>2006-03-27T13:21:00.000+02:00</published><updated>2006-10-23T12:04:02.717+02:00</updated><title type='text'></title><content type='html'>&lt;table style="FLOAT: right; MARGIN: 0pt 0pt 10px 10px; CURSOR: pointer" cellspacing="0" cellpadding="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/raytracer.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0pt 0pt 0px 0px; CURSOR: pointer" alt="" src="http://photos1.blogger.com/blogger/3231/1981/200/raytracer.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/supersampling.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0pt 0pt 0px 0px; CURSOR: pointer" alt="" src="http://photos1.blogger.com/blogger/3231/1981/200/supersampling.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br /&gt;Jesper and I have finished the first assignment in the "Advanced shading and rendering" course. We were given an unfinished raytracer and had to implement shading, shadows, reflections, refractions and super-sampling.&lt;/p&gt;&lt;p&gt;We had to implement at least one super-sampling scheme but we decided to make a comparision between a few schemes and ended up implementing uniform grid, stratified grid and adaptive. The latter is especially intresting since it tries to distribute the rays over the pixel area in a optimal way, resulting in good image quality and fast rendering.&lt;/p&gt;&lt;p&gt;The top screenshot shows the test scene rendered with 5x5 uniform grid super-sampling and the bottom shot is a close-up comparison between different sampling schemes.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114345951819778931?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114345951819778931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114345951819778931' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114345951819778931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114345951819778931'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/03/jesper-and-i-have-finished-first.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114332832534979244</id><published>2006-03-25T23:43:00.000+01:00</published><updated>2006-10-23T12:04:02.656+02:00</updated><title type='text'></title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/3231/1981/1600/terrainperpixel.0.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0px 0px 10px 10px; CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/3231/1981/320/terrainperpixel.0.jpg" border="0" /&gt;&lt;/a&gt; Today I extended the engine with support for vertex and pixel shaders.&lt;br /&gt;&lt;br /&gt;Right now I have support for shaders written in HLSL but to the engine shaders is an abstract concept so there is nothing stopping me from adding support for other shading languages like Cg and GLSL transparently in the future.&lt;br /&gt;Shaders are integrated into the effect/material system and I have a clean and simple interface for setting shader parameters from the engine. I intend to add support for automatic passing of common parameters like transform matrices to the shaders. Using shaders will be almost as easy as using the fixed function pipeline.&lt;br /&gt;&lt;br /&gt;The terrain in the screenshot is rendered with per-pixel diffuse lighting and fog, using a pixel shader. In this kind of scene there is not much visual difference between per-vertex and per-pixel lighting, but when the sun is moving it's more apparent. Also the per-pixel fog is a lot smoother.&lt;br /&gt;I use a slightly reddish sun color to give the impression of late afternoon lighting.&lt;br /&gt;&lt;br /&gt;Now, with shader support in place, I can start doing some cool stuff :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114332832534979244?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114332832534979244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114332832534979244' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114332832534979244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114332832534979244'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/03/today-i-extended-engine-with-support.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114315491623346817</id><published>2006-03-23T23:54:00.000+01:00</published><updated>2006-10-23T12:04:02.603+02:00</updated><title type='text'></title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/3231/1981/1600/terriancollide.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0px 0px 10px 10px; CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/3231/1981/320/terriancollide.jpg" border="0" /&gt;&lt;/a&gt;I've done some minor improvments to the engine.&lt;br /&gt;I added collision detection with the terrian so that the camera alywas stays on the ground.&lt;br /&gt;&lt;br /&gt;I have also begun coding on a light management system. Until now I have hardcoded the sun into the renderer but now I have a more flexible system that handles unlimited (sort of) number of dynamic lights. Still need to add smarter culling of the lights though.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114315491623346817?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114315491623346817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114315491623346817' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114315491623346817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114315491623346817'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/03/ive-done-some-minor-improvments-to.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114306338631318166</id><published>2006-03-22T22:21:00.000+01:00</published><updated>2006-10-23T12:04:02.548+02:00</updated><title type='text'></title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/terrainlod.0.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3231/1981/400/terrainlod.jpg" alt="" border="0" /&gt;&lt;/a&gt;Since I have a lot less to do in school now, I've started working on the engine again.&lt;br /&gt;&lt;br /&gt;Today I finished the terrain LOD system. I'm using the popular GeoMipMapping technique and it works very well. To the left you can see two screenshots taken from the same viewport. The top picture shows brute-force rendering of the terrain and ~2 million triangles are drawn. In the bottom picture the LOD is activated and only ~45k triangles are drawn. That's only ~2% of the original triangles!&lt;br /&gt;&lt;br /&gt;It's pretty hard to see any difference in the pictures, but if you look at the distant mountains you are able to see that the bottom picture misses some of the detail.&lt;br /&gt;&lt;br /&gt;When the camera is moving it's sometimes possible to notice some popping when the terrain patches changes LOD but still I think the result is quite good for such a simple technique.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114306338631318166?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114306338631318166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114306338631318166' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114306338631318166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114306338631318166'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/03/since-i-have-lot-less-to-do-in-school.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114273048238336033</id><published>2006-03-19T01:50:00.000+01:00</published><updated>2006-10-23T12:04:02.492+02:00</updated><title type='text'></title><content type='html'>The last few days I've been writing a simple I/O library in x86 assembly for a course at uni.&lt;br /&gt;We had to use the GNU assembler and debugger.   It's not my idea of fun to use command line tools like that ;) It was a pain in the butt in the beginning but I got used to it quite quickly.&lt;br /&gt;&lt;br /&gt;The GNU assembler is a bit different from other assemblers like MASM. It uses different directives and instruction syntax. The instruction parameters is reversed and you have to use the %-prefix for registers.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;movl eax, ebx&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;becomes:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;movl %ebx, %eax&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A bit anoying at first, but the parameter order actually feels more natural to me since I used to do a lot of MC68000 coding.&lt;br /&gt;It's been a long time since I did this much assembly coding and while it's fun to optimize small routines, it's mostly annoying to write longer programs ;)&lt;br /&gt;It's a good thing that high level languages gives us enough speed nowadays.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114273048238336033?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114273048238336033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114273048238336033' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114273048238336033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114273048238336033'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/03/last-few-days-ive-been-writing-simple.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114246327016238023</id><published>2006-03-15T23:43:00.000+01:00</published><updated>2006-10-23T12:04:02.435+02:00</updated><title type='text'></title><content type='html'>The exams are finally over!&lt;br /&gt;I haven't got the results of all of them yet, but I think I passed them all.&lt;br /&gt;&lt;br /&gt;Today, I had the first lecture in &lt;a href="http://www.cs.lth.se/DAT135/"&gt;Advanced shading and rendering&lt;/a&gt;. The lecturer is &lt;a href="http://www.cs.lth.se/home/Tomas_Akenine_Moller/"&gt;Tomas Akenine-Möller&lt;/a&gt;, one of the authors of the legendary &lt;a href="http://www.realtimerendering.com/"&gt;Real-Time Rendering&lt;/a&gt;. That's pretty cool. I have high expertations of this course, and I don't think I'll be disappointed.&lt;br /&gt;&lt;br /&gt;In this course we're using C++, so no more Python for a while! That's a good thing:)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114246327016238023?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114246327016238023/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114246327016238023' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114246327016238023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114246327016238023'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/03/exams-are-finally-over-i-havent-got.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114113906017710769</id><published>2006-02-28T15:55:00.000+01:00</published><updated>2006-10-23T12:04:02.379+02:00</updated><title type='text'></title><content type='html'>We have released our Bomberman clone! One minute before deadline:) It's not fast, it's not perfect, and it's certanly not bug free. But considering that it was put together in more or less one weekend we're very happy with the result.&lt;br /&gt;&lt;br /&gt;You can check it out and download it &lt;a href="http://mullemeck.serveftp.org/bomberman/"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You can take a look at the work of the other project groups &lt;a href="http://www.cs.lth.se/EDA046/projects.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114113906017710769?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114113906017710769/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114113906017710769' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114113906017710769'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114113906017710769'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/02/we-have-released-our-bomberman-clone.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114099691804624437</id><published>2006-02-27T00:33:00.000+01:00</published><updated>2006-10-23T12:04:02.325+02:00</updated><title type='text'></title><content type='html'>&lt;table style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/bomberman3.jpg"&gt;&lt;img style="margin: 0pt 0pt 0px 0px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3231/1981/320/bomberman3.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/bomberman4.jpg"&gt;&lt;img style="margin: 0pt 0pt 0px 0px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3231/1981/320/bomberman4.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;I've been working quite hard with the bomberman clone this weekend and we're getting there. I've done collision detection, physics (ODE), lighting, sound, and a some of the game play.&lt;br /&gt;&lt;br /&gt;The engine we are using had some support for collisions with static geometry and ODE objects. But for dynamic objects like crates, bombs, players and powerups, I had to do it myself. I went for simple boundingspheres and sphere-sphere tests. For the bombs I'm using simple line segment-sphere tests. Simple and efficient.&lt;br /&gt;&lt;br /&gt;Now there's only characters, AI and some game play left. But thats Jespers job so now I can focus on the other projects.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114099691804624437?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114099691804624437/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114099691804624437' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114099691804624437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114099691804624437'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/02/ive-been-working-quite-hard-with.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114073740940353354</id><published>2006-02-24T00:20:00.000+01:00</published><updated>2006-10-23T12:04:02.272+02:00</updated><title type='text'></title><content type='html'>&lt;table style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/bomberman1.0.jpg"&gt;&lt;img style="margin: 0pt 0pt 0px 0px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3231/1981/320/bomberman1.0.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/bomberman2.jpg"&gt;&lt;img style="margin: 0pt 0pt 0px 0px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3231/1981/320/bomberman2.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;The bomberman clone have to be finished till next Wednesday. Way to little time. Especially since I have projects in the other courses to finish as well. And there is not even two weeks till the exams. I have no idea how I'm going to make this!&lt;br /&gt;&lt;br /&gt;Anyway, I've done some more work on the particle system. Now it can do a lot of stuff. A lot more than we need for the game, so you could argue that I wasted some precious time there. The good news is that I can port it to my C# engine in no time.&lt;br /&gt;&lt;br /&gt;The screens shows the system in action. Pretty nice explosions with fire and smoke.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114073740940353354?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114073740940353354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114073740940353354' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114073740940353354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114073740940353354'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/02/bomberman-clone-have-to-be-finished.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114065418858772952</id><published>2006-02-23T01:16:00.000+01:00</published><updated>2006-10-23T12:04:02.219+02:00</updated><title type='text'></title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/pypaticles2.0.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3231/1981/320/pypaticles2.0.jpg" alt="" border="0" /&gt;&lt;/a&gt;Tonight I enhanced my particle system in the Python engine we're using for the Bomberman clone we're making. In the screenshot you can see my first attempt to use it for the bomb explosions. One of the most important parts of the game:) Pretty neat!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114065418858772952?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114065418858772952/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114065418858772952' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114065418858772952'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114065418858772952'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/02/tonight-i-enhanced-my-particle-system.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114056167253202162</id><published>2006-02-21T23:34:00.000+01:00</published><updated>2006-10-23T12:04:02.162+02:00</updated><title type='text'></title><content type='html'>I and Jesper are making a simple &lt;a href="http://en.wikipedia.org/wiki/Bomberman"&gt;Bomberman&lt;/a&gt; clone in 3D as the mandatory project in the Game Engine Technology course. We put up a very simple project web page &lt;a href="http://mullemeck.serveftp.org/bomberman/"&gt;here&lt;/a&gt; (in swedish). You'll find a list of all this year's projects &lt;a href="http://www.cs.lth.se/EDA046/projects.html"&gt;here&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114056167253202162?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114056167253202162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114056167253202162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114056167253202162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114056167253202162'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/02/i-and-jesper-are-making-simple.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-114004545797529294</id><published>2006-02-16T00:01:00.000+01:00</published><updated>2006-10-23T12:04:02.082+02:00</updated><title type='text'></title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/pyparticles.0.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3231/1981/320/pyparticles.0.jpg" alt="" border="0" /&gt;&lt;/a&gt;I threw together a lame particle system in Python for the Game engine tech course. I can't even count the number of times I ended a statement with ';'! Not that Python cares but it's not supposed to be there:)&lt;br /&gt;I am using far to many programming languages in parallel right now. I wish they didn't try to teach us every damn language in the world at uni ;)&lt;br /&gt;&lt;br /&gt;Game engine technology: Python&lt;br /&gt;Web programming: Java, Perl (and the zillion markup languages that don't count)&lt;br /&gt;Computer organization: MIPS and x86 assembly&lt;br /&gt;...and ofcourse my engine: C#&lt;br /&gt;&lt;br /&gt;I better improve my syntax switching  skills...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-114004545797529294?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/114004545797529294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=114004545797529294' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114004545797529294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/114004545797529294'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/02/i-threw-together-lame-particle-system.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-113987578383744820</id><published>2006-02-14T00:53:00.000+01:00</published><updated>2006-10-23T12:04:02.028+02:00</updated><title type='text'></title><content type='html'>&lt;table style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/terrain-tex2.1.jpg"&gt;&lt;img style="margin: 0pt 0pt 0px 0px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3231/1981/320/terrain-tex2.1.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/terrain-tex1.0.jpg"&gt;&lt;img style="margin: 0pt 0pt 0px 0px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3231/1981/320/terrain-tex1.0.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;I have been working on the GUI system for a few days now. It's not complete, but I have what I need for now so I put it aside temporarily and started working on the terrain again.&lt;br /&gt;&lt;br /&gt;I added simple multi texturing: one base texture stretched over the whole terrain and one tiled detail texture. The result is not as good as splatting but I think it looks suprisingly good. I guess I'll have a look at splatting when I have shaders implemented in the effect system.&lt;br /&gt;&lt;br /&gt;I have a lot of stuff to do in school so guess I need to put the engine aside this week and get some 'real' work done ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-113987578383744820?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/113987578383744820/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=113987578383744820' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/113987578383744820'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/113987578383744820'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/02/i-have-been-working-on-gui-system-for.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-113961195971778388</id><published>2006-02-10T23:46:00.000+01:00</published><updated>2006-10-23T12:04:01.973+02:00</updated><title type='text'></title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/gui1.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3231/1981/320/gui1.jpg" alt="" border="0" /&gt;&lt;/a&gt;The GUI system is slowly emerging and today I added panel controls. All controls are skinnable. They are composed of a set of pieces that are read from a skin texture. As you can see in the screenshot I can set alpha and color individually. The nice drop shadows are slimply an alpha channel in the texture.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-113961195971778388?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/113961195971778388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=113961195971778388' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/113961195971778388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/113961195971778388'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/02/gui-system-is-slowly-emerging-and.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-113943658592655096</id><published>2006-02-08T22:54:00.000+01:00</published><updated>2006-10-23T12:04:01.918+02:00</updated><title type='text'></title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/fonts1.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3231/1981/320/fonts1.jpg" alt="" border="0" /&gt;&lt;/a&gt;I have begun coding a GUI system for the engine. The first thing to be completed is ofcourse text rendering. The fonts are simply textures created by &lt;a href="http://www.angelcode.com/products/bmfont/"&gt;this&lt;/a&gt; nice little tool and each character is rendered with a textured quad. Using a single font I can render texts in different color/alpha/size and use different aligning.&lt;br /&gt;&lt;br /&gt;And yes, there are text in the old screenshots too but I cheated using D3DX fonts;)&lt;br /&gt; I'm trying to keep things API independent, remember?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-113943658592655096?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/113943658592655096/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=113943658592655096' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/113943658592655096'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/113943658592655096'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/02/i-have-begun-coding-gui-system-for.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-113924407109958452</id><published>2006-02-06T17:17:00.000+01:00</published><updated>2006-10-23T12:04:01.825+02:00</updated><title type='text'></title><content type='html'>I like &lt;a href="http://www.perl.com/"&gt;Perl&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Normally I'm an OO purist.  I also favor the C-family-style syntax. This is why i love C# and dig C++. But perl is &lt;span style="font-style: italic;"&gt;fun&lt;/span&gt;. Just fun. And also quite brilliant.&lt;br /&gt;&lt;br /&gt;Consider the UNIX command &lt;a href="http://www.softpanorama.org/Tools/cat.shtml"&gt;cat&lt;/a&gt;. It reads from standard input OR from files specified as arguments and outputs the content to the console.&lt;br /&gt;&lt;br /&gt;In perl you could implement a basic cut command like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;foreach (&lt;&gt;)  { print; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That's it. Try to do the same in C/C#/Java/whatever and you'll end up writing quite a few lines of code.  Another example: the UNIX command &lt;a href="http://www.softpanorama.org/Tools/sort.shtml"&gt;sort&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;foreach (sort &lt;&gt;)  { print; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Bloody brilliant. The cool thing about perl is that it makes easy stuff &lt;span style="font-style: italic;"&gt;really&lt;/span&gt; easy. I wouldn't use it to code larger programs but for simple suff it's amazing. Also the code tends to get quite hard to read so it's not something I would use in team development:)&lt;br /&gt;&lt;br /&gt;Again, coding in perl is &lt;span style="font-style: italic;"&gt;fun&lt;/span&gt;. When you have tried the basic stuff it almost becomes a sport to write as little code as possible. And as you can see, perl is good at doing a lot of stuff in few lines of code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-113924407109958452?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/113924407109958452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=113924407109958452' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/113924407109958452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/113924407109958452'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/02/i-like-perl.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-113909440518790321</id><published>2006-02-05T00:01:00.000+01:00</published><updated>2006-10-23T12:04:01.771+02:00</updated><title type='text'></title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/textures1.2.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" alt="" src="http://photos1.blogger.com/blogger/3231/1981/320/textures1.2.jpg" border="0" /&gt;&lt;/a&gt;I just added texturing to the effects system. Nothing fancy, but at least my test scene looks a bit nicer :)&lt;br /&gt;&lt;br /&gt;At the moment I'm taking a course called &lt;a href="http://www.cs.lth.se/EDA046/"&gt;Game Engine Technology&lt;/a&gt;. Game physics is a part of the course and today I and Jesper (who also is coding a nice engine called &lt;a href="http://www.gamedev.se/forum/viewtopic.php?t=226&amp;amp;highlight="&gt;Milk&lt;/a&gt;) played around with &lt;a href="http://www.ode.org/"&gt;ODE&lt;/a&gt; (Open Dynamics Engine). In the course we use a simple game engine written in &lt;a href="http://www.python.org"&gt;Python &lt;/a&gt;and we used a wrapper for ODE called PyODE. I'll have a rant about my thoughts on Python in another post, but the short story is that I'm not very fond of it.&lt;br /&gt;However, using ODE worked like a charm and we got some nice ridig body physics up and running in no time since most of the stuff were already there in the engine. It's amazingly fun to throw boxes around and watch them collide and respond in a realistic (well, more or less) manner :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-113909440518790321?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/113909440518790321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=113909440518790321' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/113909440518790321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/113909440518790321'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/02/i-just-added-texturing-to-effects.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-113892001338298380</id><published>2006-02-02T23:22:00.000+01:00</published><updated>2006-10-23T12:04:01.713+02:00</updated><title type='text'></title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/3231/1981/1600/effect1.0.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://photos1.blogger.com/blogger/3231/1981/320/effect1.0.jpg" alt="" border="0" /&gt;&lt;/a&gt;Today I started working on an effect/material system. It's inspired by the most common effect formats, CgFX and DirectX Effects. Think of an effect as a kind of high level shader. It encapsluates the whole rendering process for a specific visual apperance. An effect is devided in a set of techniques. A technique is a way to render the desired visual effect. A technique is then devided into passes. This is indeed very flexible. For example, imagine a human skin effect. Close to the camera the effect uses a technique that renders using costly vertex and fragment shaders and/or multiple passes that gives a very high visual quality. Farther away, the effect uses a cheeper teqnique with a single pass and cheep shaders at the cost of visual quality. But since the camera is now far away from the object the loss of quality will not be noticeble. All this is encpsluated in the effect.&lt;br /&gt;&lt;br /&gt;The screenshot shows a simple test of this effect system. The sphere is rendered with a single effect that uses a two-pass technique. The first pass just sets the diffuse color to red and fillmode to solid. The second pass uses a yellow color and wireframe fillmode and depthtesting disabled.&lt;br /&gt;&lt;br /&gt;So far it's all very simple, but now I have something to build on =)&lt;br /&gt;&lt;br /&gt;By the way, I downloaded the new IE7.0 beta and kind of liked it.&lt;br /&gt;Until I tried to edit my blog that is. It simply won't work. Luckily there is firefox=)&lt;br /&gt;But it's still in beta so I guess I shouldn't be to harsh...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-113892001338298380?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/113892001338298380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=113892001338298380' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/113892001338298380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/113892001338298380'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/02/today-i-started-working-on.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19919004.post-113873880359355340</id><published>2006-01-31T20:59:00.000+01:00</published><updated>2006-10-23T12:04:01.589+02:00</updated><title type='text'></title><content type='html'>&lt;a href="http://photos1.blogger.com/blogger/3231/1981/1600/terrain.jpg"&gt;&lt;img style="FLOAT: right; MARGIN: 0px 0px 10px 10px; CURSOR: hand" alt="" src="http://photos1.blogger.com/blogger/3231/1981/320/terrain.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Well, I think it's about time to write my first post on this blog!&lt;br /&gt;&lt;br /&gt;There is much going on right now. My girldfriend is in India and doing her practice for her social work education. You can find her travel blog &lt;a href="http://www.resedagboken.se/Default.aspx?documentId=3&amp;userId=10443&amp;amp;section=blog&amp;amp;journeyId=67211"&gt;here &lt;/a&gt;(in swedish). I'm still in Lund and taking three courses at the university and I have started working on my C# 3D-engine 'Nebula' again.&lt;br /&gt;&lt;br /&gt;The engine is written with 3D API independence in mind. Why, you might wonder. Most people tend to use Managed DirectX in the .NET world and that is ofcourse the most sane thing to do if you want to ever finnish your project :) However, I see this as a learning process and I don't want to constantly be temptated to take the easy road and use the goodies of D3DX utillity classes. By making it API independent I force myself to write everything myself! This ofcourse is not a philosophy I usually follow, but for learning stuff I think it's essential to do it all by yourself!&lt;br /&gt;&lt;br /&gt;Up to this point, I have written a lot of boring plumming code like window management, scene graph management, resorce managment, vector and matrix math etc. The screenshot here is probably the first produced by this engine that is even a little bit intresting =). It features a heightmapped terrain with 1025 x 1025 vertices and simple Blinn-phong lightning. The terrain is divided in chunks of 65 x 65 vertices that are part of the scene grapth and culled against the view frustrum. I'm currently working on a GeoMipMapping implementation (LOD).&lt;br /&gt;&lt;br /&gt;Well, thats about it for this time!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/19919004-113873880359355340?l=risbrandt.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://risbrandt.blogspot.com/feeds/113873880359355340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=19919004&amp;postID=113873880359355340' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/113873880359355340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19919004/posts/default/113873880359355340'/><link rel='alternate' type='text/html' href='http://risbrandt.blogspot.com/2006/01/well-i-think-its-about-time-to-write.html' title=''/><author><name>Jonas Risbrandt</name><uri>http://www.blogger.com/profile/09524984329026113339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://photos1.blogger.com/hello/186/9126/640/jonas.jpg'/></author><thr:total>0</thr:total></entry></feed>
