<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Posts on Miles Macklin</title>
    <link>http://blog.mmacklin.com/posts/</link>
    <description>Recent content in Posts on Miles Macklin</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <copyright>&amp;copy; 2019 Miles Macklin</copyright>
    <lastBuildDate>Wed, 17 May 2017 00:00:00 +0000</lastBuildDate><atom:link href="http://blog.mmacklin.com/posts/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Recommended Books</title>
      <link>http://blog.mmacklin.com/posts/books/</link>
      <pubDate>Wed, 17 May 2017 00:00:00 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/posts/books/</guid>
      <description>Some people always seem to have the right answer. The kind of people who casually pop up and make a difficult problem seem trivial. These people can be impressive, but the question I am often left with is: &amp;quot;how did you know that?&amp;quot;
It is somehow unsatisfying to just be given the answer, I want to know the backstory. More often than not, that backstory is written in books. Blog posts and Twitter threads are great to get exposure to a new problem or subject, but they can also be shallow treatments.</description>
    </item>
    
    <item>
      <title>XPBD slides and stiffness</title>
      <link>http://blog.mmacklin.com/2016/10/12/xpbd-slides-and-stiffness/</link>
      <pubDate>Wed, 12 Oct 2016 05:16:03 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2016/10/12/xpbd-slides-and-stiffness/</guid>
      <description>The slides for my talk on XPBD are now up on the publications page, or available here.
I spoke to someone who had already implemented the method and who was surprised to find they needed to use very small compliance values in the range of 10-6 to get stiffness comparable to regular PBD.
The reason for this is that, unlike stiffness in PBD, compliance in XPBD has a direct correspondence to engineering stiffness, i.</description>
    </item>
    
    <item>
      <title>XPBD</title>
      <link>http://blog.mmacklin.com/2016/09/15/xpbd/</link>
      <pubDate>Thu, 15 Sep 2016 00:54:50 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2016/09/15/xpbd/</guid>
      <description>Anyone who has worked with Position-Based Dynamics (PBD) in production will know that the constraint stiffness is heavily dependent on the number of iterations performed by the solver. Regardless of how you set the stiffness coefficients, the solver will converge to an infinitely stiff solution given enough iterations.
We have a new paper that solves this iteration count and time step dependent stiffness with a very small addition to the original algorithm.</description>
    </item>
    
    <item>
      <title>New SIGGRAPH paper</title>
      <link>http://blog.mmacklin.com/2014/05/15/new-siggraph-paper/</link>
      <pubDate>Thu, 15 May 2014 00:28:00 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2014/05/15/new-siggraph-paper/</guid>
      <description>Just a quick note to say that the pre-print for our paper on particle physics for real-time applications is now available. Visit the project page for all the downloads, or check out the submission video below:

The paper contains most of the practical knowledge and insight about Position-Based Dynamics that I gained while developing Flex. In addition, it introduces a few new features such as implicit friction and smoke simulation.</description>
    </item>
    
    <item>
      <title>FLEX</title>
      <link>http://blog.mmacklin.com/2013/11/13/flex/</link>
      <pubDate>Wed, 13 Nov 2013 03:51:40 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2013/11/13/flex/</guid>
      <description>FLEX is the name of the new GPU physics solver I have been working on at NVIDIA. It was announced at the Montreal editor&#39;s day a few weeks ago, and today we have released some more information in the form of a video trailer and a Q&amp;amp;A with the PhysX fan site.
The solver builds on my Position Based Fluids work, but adds many new features such as granular materials, clothing, pressure constraints, lift + drag model, rigid bodies with plastic deformation, and more.</description>
    </item>
    
    <item>
      <title>SIGGRAPH slides</title>
      <link>http://blog.mmacklin.com/2013/07/25/siggraph-slides/</link>
      <pubDate>Thu, 25 Jul 2013 18:08:59 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2013/07/25/siggraph-slides/</guid>
      <description>Slides for my SIGGRAPH presentation of Position Based Fluids are available here:
http://mmacklin.com/pbf_slides.pdf
During the presentation I showed videos of some more recent results including two-way coupling of fluids with clothing and rigid bodies. They&#39;re embedded below:




Overall it has been a great SIGGRAPH, I met tons of new people who provided lots of inspiration for new research ideas. Thanks!</description>
    </item>
    
    <item>
      <title>Real-Time Video Capture with FFmpeg</title>
      <link>http://blog.mmacklin.com/2013/06/11/real-time-video-capture-with-ffmpeg/</link>
      <pubDate>Tue, 11 Jun 2013 23:46:33 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2013/06/11/real-time-video-capture-with-ffmpeg/</guid>
      <description>Working on a distributed team means that often the best way to share new results is via video captures of simulations. Previously I would do this by dumping uncompressed frames from OpenGL to disk, and then compressing with FFmpeg. I prefer this over tools like Fraps because it gives more control over compression quality, and has no watermarking or time limits.
The problem with this method is simply that saving uncompressed frames generates a large amount of data that quickly fills up the write cache and slows down the whole system during capture, it also makes FFmpeg disk bound on reads during encoding.</description>
    </item>
    
    <item>
      <title>Position Based Fluids</title>
      <link>http://blog.mmacklin.com/2013/04/24/position-based-fluids/</link>
      <pubDate>Wed, 24 Apr 2013 06:33:12 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2013/04/24/position-based-fluids/</guid>
      <description>Position Based Fluids (PBF) is the title of our paper that has been accepted for presentation at SIGGRAPH 2013. I&#39;ve set up a project page where you can download the paper and all the related content here:
http://blog.mmacklin.com/publications
I have continued working on the technique since the submission, mainly improving the rendering, and adding features like spray and foam (based on the excellent paper from the University of Freiburg: Unified Spray, Foam and Bubbles for Particle-Based Fluids).</description>
    </item>
    
    <item>
      <title>2D FEM</title>
      <link>http://blog.mmacklin.com/2012/06/27/2d-fem/</link>
      <pubDate>Wed, 27 Jun 2012 10:40:40 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2012/06/27/2d-fem/</guid>
      <description>This post is about generating meshes for finite element simulations. I&#39;ll be covering other aspects of FEM based simulation in a later post, until then I recommend checking out Matthias Müller&#39;s very good introduction in the SIGGRAPH 2008 Real Time Physics course [1].
After spending the last few weeks reading, implementing and debugging meshing algorithms I have a new-found respect for people in this field. It is amazing how many ways meshes can &amp;quot;go wrong&amp;quot;, even the experts have it tough:</description>
    </item>
    
    <item>
      <title>Implicit Springs</title>
      <link>http://blog.mmacklin.com/2012/05/04/implicitsprings/</link>
      <pubDate>Fri, 04 May 2012 11:43:39 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2012/05/04/implicitsprings/</guid>
      <description>This is a quick post to document some work I did while writing a mass spring simulation using an implicit integrator. Implicit, or backward Euler integration is well described in David Baraff&#39;s Physically Based Modelling SIGGRAPH course and this post assumes some familiarity with it.
Springs are a workhorse in physical simulation, once you have unconditionally stable springs you can use them to model just about anything, from rigid bodies to drool and snot.</description>
    </item>
    
    <item>
      <title>New Look</title>
      <link>http://blog.mmacklin.com/2012/05/03/new-look/</link>
      <pubDate>Thu, 03 May 2012 00:29:09 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2012/05/03/new-look/</guid>
      <description>Hi all, welcome to my new site. I&#39;ve moved to my own hosting and have updated a few things - a new theme and a switch to MathJax for equation rendering. Apologies to RSS readers who will now see only a bunch of Latex code, but it is currently by far the easiest way to put decent looking equations in a web page.
It&#39;s been a little over a year since I started working at NVIDIA and not coincidentally, since my last blog post.</description>
    </item>
    
    <item>
      <title>Blackbody Rendering</title>
      <link>http://blog.mmacklin.com/2010/12/29/blackbody-rendering/</link>
      <pubDate>Wed, 29 Dec 2010 08:21:08 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2010/12/29/blackbody-rendering/</guid>
      <description>In between bouts of festive over-eating I added support for blackbody emission to my fluid simulator and thought I&#39;d describe what was involved.
Briefly, a blackbody is an idealised substance that gives off light when heated. Planck&#39;s formula describes the intensity of light per-wavelength with units W·sr-1·m-2·m-1 for a given temperature in Kelvins.
Radiance has units W·sr-1·m-2 so we need a way to convert the wavelength dependent power distribution given by Planck&#39;s formula to a radiance value in RGB that we can use in our shader / ray-tracer.</description>
    </item>
    
    <item>
      <title>Adventures in Fluid Simulation</title>
      <link>http://blog.mmacklin.com/2010/11/01/adventures-in-fluid-simulation/</link>
      <pubDate>Tue, 02 Nov 2010 01:34:27 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2010/11/01/adventures-in-fluid-simulation/</guid>
      <description>I have to admit to being simultaneously fascinated and slightly intimidated by the fluid simulation crowd. I&#39;ve been watching the videos on Ron Fedkiw&#39;s page for years and am still in awe of his results, which sometimes seem little short of magic.
Recently I resolved to write my first fluid simulator and purchased a copy of Fluid Simulation for Computer Graphics by Robert Bridson.
Like a lot of developers my first exposure to the subject was Jos Stam&#39;s stable fluids paper and his more accessible Fluid Dynamics for Games presentation, while the ideas are undeniable great I never came away feeling like I truly understood the concepts or the mathematics behind it.</description>
    </item>
    
    <item>
      <title>Tracing</title>
      <link>http://blog.mmacklin.com/2010/10/03/tracing/</link>
      <pubDate>Sun, 03 Oct 2010 23:37:47 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2010/10/03/tracing/</guid>
      <description>Gregory Pakosz reminded me to write a follow up on my path tracing efforts since my last post on the subject. It&#39;s good timing because the friendly work-place competition between Tom and me has been in full swing. The great thing about ray tracing is that there are many opportunities for optimisation at all levels of computation. This keeps you &#34;hooked&#34; by constantly offering decent speed increases for relatively little effort.</description>
    </item>
    
    <item>
      <title>Faster Fog</title>
      <link>http://blog.mmacklin.com/2010/06/10/faster-fog/</link>
      <pubDate>Fri, 11 Jun 2010 03:24:11 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2010/06/10/faster-fog/</guid>
      <description>Cedrick at Lucas suggested some nice optimisations for the in-scattering equation I posted last time.
I had left off at:
\[L_{s} = \frac{\sigma_{s}I}{v}( \tan^{-1}\left(\frac{d+b}{v}\right) - \tan^{-1}\left(\frac{b}{v}\right) )\]
But we can remove one of the two inverse trigonometric functions by using the following identity:
\[\tan^{-1}x - \tan^{-1}y = \tan^{-1}\frac{x-y}{1+xy}\]
Which simplifies the expression for $L_{s}$ to:
\[L_{s} = \frac{\sigma_{s}I}{v}( \tan^{-1}\frac{x-y}{1+xy} )\]
With $x$ and $y$ being replaced by:
\[\begin{array}{lcl} x = \frac{d+b}{v} \\ y = \frac{b}{v}\end{array}\]</description>
    </item>
    
    <item>
      <title>In-Scattering Demo</title>
      <link>http://blog.mmacklin.com/2010/05/29/in-scattering-demo/</link>
      <pubDate>Sat, 29 May 2010 23:32:07 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2010/05/29/in-scattering-demo/</guid>
      <description>This demo shows an analytic solution to the differential in-scattering equation for light in participating media. It&#39;s a similar but simplified version of equations found in[1], [2] and as I recently discovered [3]. However I thought showing the derivation might be interesting for some out there, plus it was a good excuse for me to brush up on my  \(\LaTeX\).
You might notice I also updated the site&#39;s theme, unfortunately you need a white background to make wordpress.</description>
    </item>
    
    <item>
      <title>Threading Fun</title>
      <link>http://blog.mmacklin.com/2010/05/24/threading-fun/</link>
      <pubDate>Tue, 25 May 2010 06:01:41 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2010/05/24/threading-fun/</guid>
      <description>So we had an interesting threading bug at work today which I thought I&#39;d write up here as I hadn&#39;t seen this specific problem before (note I didn&#39;t write this code, I just helped debug it). The set up was a basic single producer single consumer arrangement something like this:
#include &amp;lt;Windows.h&amp;gt; #include &amp;lt;cassert&amp;gt; volatile LONG gAvailable = 0; // thread 1 DWORD WINAPI Producer(LPVOID) { while (1) { InterlockedIncrement(&amp;amp;gAvailable); } } // thread 2 DWORD WINAPI Consumer(LPVOID) { while (1) { // pull available work with a limit of 5 items per iteration LONG work = min(gAvailable, 5); // this should never fire.</description>
    </item>
    
    <item>
      <title>GOW III: Shadows</title>
      <link>http://blog.mmacklin.com/2010/03/11/gow-iii-shadows/</link>
      <pubDate>Fri, 12 Mar 2010 06:09:31 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2010/03/11/gow-iii-shadows/</guid>
      <description>I checked out this session at GDC today - I&#39;ll try and sum up the main takeaways (at least for me):

Artist controlled cascaded shadow maps, each cascade is accumulated into a &#39;white buffer&#39; (new term coined?) in deferred style passes using standard PCF filtering
Shadow accumulation pass re-projects world space position from an FP32 depth buffer (separate from the main depth buffer). The motivation for the separate depth buffer is performance so I assume they store linear depth which means they can reconstruct the world position using just a single multiply-add (saving a reciprocal).</description>
    </item>
    
    <item>
      <title>Stochastic Pruning (2)</title>
      <link>http://blog.mmacklin.com/2010/02/07/stochastic-pruning-2/</link>
      <pubDate>Sun, 07 Feb 2010 07:39:41 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2010/02/07/stochastic-pruning-2/</guid>
      <description>A quick update for anyone who was having problems running my stochastic pruning demo on NVIDIA cards, I&#39;ve updated the demo with a fix (I had forgotten to disable a vertex array).
While I was at it I added some grass:

The grass uses stochastic pruning but still generates a lot of geometry, it&#39;s just one grass tile flipped around and rendered multiple times. I wanted to see if it would be practical for games to render grass using pure geometry but really you&#39;d need to be much more aggressive with the LOD (Update: apparently the same technique was used in Flower, see comments).</description>
    </item>
    
    <item>
      <title>Stochastic Pruning for Real-Time LOD</title>
      <link>http://blog.mmacklin.com/2010/01/12/stochastic-pruning-for-real-time-lod/</link>
      <pubDate>Tue, 12 Jan 2010 07:28:31 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2010/01/12/stochastic-pruning-for-real-time-lod/</guid>
      <description>Rendering plants efficiently has always been a challenge in computer graphics, a relatively new technique to address this is Pixar&#39;s stochastic pruning algorithm. Originally developed for rendering the desert scenes in Cars, Weta also claim to have used the same technique on Avatar.
Although designed with offline rendering in mind it maps very naturally to the GPU and real-time rendering. The basic algorithm is this:
 Build your mesh of N elements (in the case of a tree the elements would be leaves, usually represented by quads)</description>
    </item>
    
    <item>
      <title>Sky</title>
      <link>http://blog.mmacklin.com/2009/12/31/sky/</link>
      <pubDate>Thu, 31 Dec 2009 22:46:48 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2009/12/31/sky/</guid>
      <description>I had been meaning to implement Preetham&#39;s analytic sky model ever since I first came across it years ago. Well I finally got around to it and was pleased to find it&#39;s one of those few papers that gives you pretty much everything you need to put together an implementation (although with over 50 unique constants you need to be careful with your typing).
I integrated it into my path tracer which made for some nice images:</description>
    </item>
    
    <item>
      <title>Path Tracing</title>
      <link>http://blog.mmacklin.com/2009/12/02/path-tracing/</link>
      <pubDate>Thu, 03 Dec 2009 06:59:48 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2009/12/02/path-tracing/</guid>
      <description>A few of us at work have been having a friendly path-tracing competition (greets to Tom &amp;amp; Dom). It&#39;s been a lot of fun and comparing images in the office each Monday morning is a great motivation to get features in and renders out. I thought I&#39;d write a post about it to record my progress and gather links to some reference material.
Here&#39;s a list of features I&#39;ve implemented so far and some pics below:</description>
    </item>
    
    <item>
      <title>Trees (the green kind)</title>
      <link>http://blog.mmacklin.com/2009/09/28/trees-the-green-kind/</link>
      <pubDate>Mon, 28 Sep 2009 17:13:26 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2009/09/28/trees-the-green-kind/</guid>
      <description>I&#39;ve always had an interest in computer generated plants so I was pleased to read Self-organising tree models for image synthesis from Siggraph this year.
The paper basically pulls together a bunch of techniques that have been around for a while and uses them to generate some really good looking tree models.
Seeing as I&#39;ve had a bit of time on my hands between Batman and before I start at LucasArts I decided to put together an implementation in OpenGL (being a games programmer I want realtime feedback).</description>
    </item>
    
    <item>
      <title>Atomic float&#43;</title>
      <link>http://blog.mmacklin.com/2009/08/19/atomic-float/</link>
      <pubDate>Wed, 19 Aug 2009 12:50:56 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2009/08/19/atomic-float/</guid>
      <description>No hardware I know of has atomic floating point operations but here&#39;s a handy little code snippet from Matt Pharr over on the PBRT mailing list which emulates the same functionality using an atomic compare and swap:
inline float AtomicAdd(volatile float *val, float delta) { union bits { float f; int32_t i; }; bits oldVal, newVal; do { oldVal.f = *val; newVal.f = oldVal.f + delta; } while (AtomicCompareAndSwap(*((AtomicInt32 *)val), newVal.</description>
    </item>
    
    <item>
      <title>Fin!</title>
      <link>http://blog.mmacklin.com/2009/08/14/fin/</link>
      <pubDate>Fri, 14 Aug 2009 12:49:11 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2009/08/14/fin/</guid>
      <description>Batman: Arkham Asylum is finished and the demo is up on PSN and Xbox Live. I was pretty much responsible for the PS3 version on the engineering side so anything wrong with it is ultimately my fault. I think most PS3 engineers working on a cross platform title will tell you that there is always some apprehension of the &#39;side by side comparisons&#39; which are so popular these days. This one popped up pretty quickly after the demo was released:</description>
    </item>
    
    <item>
      <title>Tim Sweeney&#39;s HPG talk</title>
      <link>http://blog.mmacklin.com/2009/08/14/tim-sweeneys-hpg-talk/</link>
      <pubDate>Fri, 14 Aug 2009 12:14:37 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2009/08/14/tim-sweeneys-hpg-talk/</guid>
      <description>This link was going round our office, a discussion over at Lambda the Ultimate regarding Tim Sweeney&#39;s HPG talk.
http://lambda-the-ultimate.org/node/3560
Tim chimes in a bit further down in the comments.</description>
    </item>
    
    <item>
      <title>Handy hints for Bovine occlusion</title>
      <link>http://blog.mmacklin.com/2009/07/24/handy-hints-for-bovine-occlusion/</link>
      <pubDate>Fri, 24 Jul 2009 10:42:55 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2009/07/24/handy-hints-for-bovine-occlusion/</guid>
      <description>Code517E recently  reminded me of a site I&#39;ve used before when looking up form factors for various geometric configurations.
One I had missed the first time though is the differential element on ceiling, floor or wall to cow.
http://www.me.utexas.edu/~howell/sectionb/B-68.html
Very handy if you&#39;re writing a farmyard simulator I&#39;m sure.</description>
    </item>
    
    <item>
      <title>Particle lighting</title>
      <link>http://blog.mmacklin.com/2009/06/15/particle-lighting/</link>
      <pubDate>Mon, 15 Jun 2009 22:39:50 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2009/06/15/particle-lighting/</guid>
      <description>I put together an implementation of the particle shadowing technique NVIDIA showed off a while ago. My original intention was to do a survey of particle lighting techniques, in the end I just tried out two different methods that I thought sounded promising.
The first was the one ATI used in the Ruby White Out demo, the best take away from it is that they write out the min distance, max distance and density in one pass.</description>
    </item>
    
    <item>
      <title>Code charity</title>
      <link>http://blog.mmacklin.com/2009/04/01/code-charity/</link>
      <pubDate>Wed, 01 Apr 2009 23:11:17 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2009/04/01/code-charity/</guid>
      <description>A friend just sent me this:
http://playpower.org/
It&#39;s a non-profit organisation with the goal of developing educational games for developing countries that run on 8bit NES hardware. The old Nintedo chips are now patent-free and clones are very common:

They&#39;re trying to recruit programmers with a social conscience, I&#39;m not old-school enough to know 8bit assembly but then I wouldn&#39;t mind learning.. who needs GPUs anyway!</description>
    </item>
    
    <item>
      <title>Red balls</title>
      <link>http://blog.mmacklin.com/2009/04/01/red-balls/</link>
      <pubDate>Wed, 01 Apr 2009 23:00:13 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2009/04/01/red-balls/</guid>
      <description>A small update on my global illumination renderer, I&#39;ve ported the radiance transfer to the GPU. It was fairly straight forward as my CPU tree structure was already set up for easy GPU traversal, basically just a matter of converting array offsets into texture coordinates and packing into an indices texture.
The hardest part is of course wrangling OpenGL to do what you want and give you a proper error message.</description>
    </item>
    
    <item>
      <title>Tree traversals</title>
      <link>http://blog.mmacklin.com/2009/02/22/tree-traversals/</link>
      <pubDate>Sun, 22 Feb 2009 21:37:27 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2009/02/22/tree-traversals/</guid>
      <description>I changed my surfel renderer over to use a pre-order traversal layout for the nodes, this generally gives better cache utilisation and I did see a small speed up from using it. The layout is quite nice because to traverse your tree you just linearly iterate over your array and whenever you find a subtree you want to skip you just increment your node pointer by the size of that subtree (which is precomputed, see Real Time Collision Detection 6.</description>
    </item>
    
    <item>
      <title>PBRT</title>
      <link>http://blog.mmacklin.com/2009/02/22/pbrt/</link>
      <pubDate>Sun, 22 Feb 2009 20:25:55 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2009/02/22/pbrt/</guid>
      <description>I just bought a copy of Physically Based Rendering, I&#39;ve been meaning to get one for ages as it&#39;s often recommended and I thought it might be useful given my recent interest in global illumination. I&#39;m also hoping to get a more formal background in rendering rather than the hacktastic world of real time.
The subjects covered are broad and it&#39;s very readable. It&#39;s my first exposure to literate programming, where essentially the book describes and contains the full implementation of a program.</description>
    </item>
    
    <item>
      <title>(Almost) realtime GI</title>
      <link>http://blog.mmacklin.com/2009/01/21/almost-realtime-gi/</link>
      <pubDate>Wed, 21 Jan 2009 23:40:01 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2009/01/21/almost-realtime-gi/</guid>
      <description>After my initial implementation of surfel based illumination I&#39;ve extended it to do hierarchical clustering of surfels based on a similar idea to the one presented in GPU Gems 2.
A few differences:
I&#39;m using a k-means clustering to build the approximation hierarchy bottom up. A couple of iterations of Lloyd&#39;s algorithm provides pretty good results. Really you could get away with one iteration.
To seed the clustering I&#39;m simply selecting every n&#39;th surfel from the source input.</description>
    </item>
    
    <item>
      <title>Indirect illumination</title>
      <link>http://blog.mmacklin.com/2009/01/11/indirect-illumination/</link>
      <pubDate>Sun, 11 Jan 2009 23:44:57 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2009/01/11/indirect-illumination/</guid>
      <description>It&#39;s been a while since I checked in on the state of the art in global illumination but there is some seriously cool research happening at the moment.
I liked the basic idea Dreamworks used on Shrek2 (An Approximate Global Illumination System for Computer Generated Films) which stores direct illumination in light maps and then runs a final gather pass on that to calculate one bounce of indirect. It might be possible to adapt this to real-time if you could pre-compute and store the sample coordinates for each point.</description>
    </item>
    
    <item>
      <title>Branch free Clamp()</title>
      <link>http://blog.mmacklin.com/2009/01/09/branch-free-clamp/</link>
      <pubDate>Fri, 09 Jan 2009 23:03:37 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2009/01/09/branch-free-clamp/</guid>
      <description>One of my work mates had some code with a lot of floating point clamps in it the other day so I wrote this little branch free version using the PS3&#39;s floating point select intrinsic:
float Clamp(float x, float lower, float upper) { float t = __fsels(x-lower, x, lower); return __fsels(t-upper, upper, t); }  __fsels basically does this:
float __fsels(float x, float a, float b) { return (x = 0.</description>
    </item>
    
    <item>
      <title>Two threads, one cache line</title>
      <link>http://blog.mmacklin.com/2009/01/09/two-threads-one-cache-line/</link>
      <pubDate>Fri, 09 Jan 2009 22:20:30 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2009/01/09/two-threads-one-cache-line/</guid>
      <description>An interesting thread going around the GDA mailing list at the moment about multithreaded programming reminded me of a little test app I wrote a while back to measure the cost of two threads accessing memory on the same cache line.
The program basically creates two threads which increment a variable a large number of times measuring the time it takes to complete with different distances between the write addresses. Something like this:</description>
    </item>
    
    <item>
      <title>More Metaballs</title>
      <link>http://blog.mmacklin.com/2008/12/28/more-metaballs/</link>
      <pubDate>Sun, 28 Dec 2008 16:46:09 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2008/12/28/more-metaballs/</guid>
      <description>So after running my Metaballs demo on my girlfriends laptop it appears to be GPU limited due to fillrate. This is mainly due to the overkill number of particles in my test setup and the fact they hang round for so long, but the technique is fillrate heavy so it might be a problem.
It&#39;d be nice to do a multithreaded CPU implementation to see how that compares, but the advantage of the current method is that it keeps the CPU free to do other things.</description>
    </item>
    
    <item>
      <title>GPU Metaballs</title>
      <link>http://blog.mmacklin.com/2008/12/20/gpu-metaballs/</link>
      <pubDate>Sat, 20 Dec 2008 14:10:56 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2008/12/20/gpu-metaballs/</guid>
      <description>I&#39;ve been meaning to implement this idea for ages, it&#39;s a GPU implementation of 2D metaballs. It&#39;s very simple, very fast and doesn&#39;t even require hardware shader support. Seems like the kind of effect that could be useful in some little game..
It&#39;s quite fun to play with (use left drag to rotate the emitter), so I might try and fancy it up with some better graphics and collision.
The demo is below, I&#39;ll probably release source at some stage but at the moment it&#39;s all tied up in my dev framework which needs to be cleaned up (the exe is also larger than it should be as I have all sorts of crap linked in).</description>
    </item>
    
    <item>
      <title>Sprite mipmaps</title>
      <link>http://blog.mmacklin.com/2008/11/03/sprite-mipmaps/</link>
      <pubDate>Mon, 03 Nov 2008 22:31:35 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2008/11/03/sprite-mipmaps/</guid>
      <description>Information on how to correctly make sprite textures is just not on the web anywhere. There are so many subtle problems with making transparent textures for use in a 3D engine, here are some of the things I learned recently from my hobby project:
Generally the easiest way is to paint on a transparent background, that is, don&#39;t try and paint the alpha channel yourself. That&#39;s because it&#39;s a complete nightmare trying to match up your rgb and alpha channels correctly.</description>
    </item>
    
    <item>
      <title>iPhone GL specs</title>
      <link>http://blog.mmacklin.com/2008/09/06/iphone-gl-specs/</link>
      <pubDate>Sat, 06 Sep 2008 12:23:52 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2008/09/06/iphone-gl-specs/</guid>
      <description>So I&#39;ve been trying to find out a bit more about the iPhone&#39;s capabilities, this site has some good details. No shaders, roughly enough power for 15000 lit triangles @ 30hz. Not too shabby, I wonder about the power consumption and if certain hardware paths drain the battery faster than others. It would be nice to make something that people can play for more than 3 hours.
So the word on the street is that O2 are bringing out a pre-pay iPhone in December, I&#39;m currently debating whether to wait for that or just get an iPod touch which you can still develop for using pretty much the same feature set.</description>
    </item>
    
    <item>
      <title>Parallelisation and cups of tea</title>
      <link>http://blog.mmacklin.com/2008/07/18/parallelisation-and-cups-of-tea/</link>
      <pubDate>Fri, 18 Jul 2008 08:51:54 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2008/07/18/parallelisation-and-cups-of-tea/</guid>
      <description>While I was at Sony I spent a lot of time thinking about making tasks run concurrently and how they should be scheduled to maximise performance.
Recently this kind of analysis has been spilling over into my everyday life and you start seeing ways you could parallelise all sorts of tasks. Of course this is just common sense and something we all do naturally do different degrees.
A simple example is making a cup of tea, you don&#39;t want to get the tea bags and the cups first, no, that would be a waste of precious milliseconds.</description>
    </item>
    
    <item>
      <title>New job</title>
      <link>http://blog.mmacklin.com/2008/07/17/5/</link>
      <pubDate>Thu, 17 Jul 2008 23:25:31 +0000</pubDate>
      
      <guid>http://blog.mmacklin.com/2008/07/17/5/</guid>
      <description>So I took a new job today, working for Rocksteady in London. Quite exciting, they use Unreal3 tech which I&#39;ve always respected (and stolen ideas from). It&#39;s a big game title and technically I don&#39;t know what it is.. but it&#39;s a big franchise and should do well.
Plus working with friends in Kentish Town, s&#39;all good.</description>
    </item>
    
  </channel>
</rss>
