ShaderX3

Today received my ‘contributor copy’ of ShaderX3. Pretty sad that the authors themselves receive the book only now, when it has been released in November. Well, maybe that’s because for some reason my shipping address contained city ‘Kannas’ instead of ‘Kaunas’, and an obsolete postal index (we’ve got ‘refactoring’ of postal indices recently here :)). Anyway.

Like with most similar books, half of this one is old, well known or pretty basic stuff. At a first glance, Generating Shaders from HLSL Fragments by Shawn Hargreaves is really good; Dean Calver’s stuff (Accessing and Modifying Topology on the GPU and Deferred Lighting on PS3.0 with HDR) also looks very cool. Probably these alone are worth the book; much like Kozlov’s article on PSMs in GPU Gems was. My own articles - oh well; one (Shaderey…) is really useless; the other (Fake Soft Shadows…) is maybe ‘interesting’, but of unknown practical purpose :)

Ok, back to reading…


Linear programming, redefined

I’d like to redefine the term ’linear programming. No, it’s not about optimization problems; instead it’s about programming style. You know you deal with linear programming when:

  • You see a function that’s 6 pages long. It’s been programmed linearly, literally. Similar things: a try-catch block of several pages, in C++, that catches everything and prints just “error occured” into log.

  • You see 6 functions that each is pretty long, and the differences between them are a couple of lines.

  • In a big project, you find 10 long functions that are exactly the same, each do exactly the same thing, but are defined in 10 different places/modules.

The other name for it could be ‘copy-paste programming’, except for the 1st point, where everything is coded linearly.

I tend to find lots of linear programming at work.


The video cards are damn fast

I was working on our next demo the other day. Boy, the video cards are damn fast nowadays!

We have a high-poly model for the main character (~200k tris), for the demo we use low-poly (~6500 tris) and a normalmap. Now, I’ve put 128 lights scattered on the hemisphere above him, each using shadow buffer. I have 4 shadow buffers, render to these from four lights, then render the character, fetching shadows from four shadowmaps at once. The result is that it’s almost realtime ambient occlusion for the animating character, and it runs at ~40FPS on my geforce 6800gt!

This is of course pretty useless, we don’t need realtime AO in the demo. But it has been nice :)