I've been spending most of my time finishing up the 'Techniques for per-pixel lighting' chapter of my book. This basically meant implementing Relief Mapping.
So far my implementation is pretty broken [lol]:
Broken implementation of 'Relief Mapping' taking an average of 14.8 seconds per frame.
But I'm pretty sure it's just down to having a vector the wrong way around or a messed up constant etc..etc..
I managed to explode the RefRast a couple of times whilst implementing Relief Mapping - lots of errors from the timeout detection routines that kill a GPU process if it hangs or takes an unreasonable amount of time. Basically that translates to my code was crap and got stuck in a loop and WDDM killed it. If WDDM kills your GPU thread it brings your entire application down - going to be interesting debugging these and seeing how many millions of threads are started about it [rolleyes]
Once I've got RM working I should have some interesting results to post:
- Samples-per-pixel for Relief Mapping. I'm using dynamic branching so I want to implement a debug mode that outputs a counter of how many samples are taken for any given pixel.
- Comparative timing. I've now got code that will determine the average frame time for each of the techniques used. It's only the RefRast (expect it to be seconds-per-frame rather than frames-per-second [lol]) but it could be an interesting comparison.
- Assembly analysis. I'll be putting together a table summarising what fxc10.exe does with my HLSL - what sort of instructions and how many of them. Try to generate a code-complexity metric for the techniques discussed.
I also decided to install the Nvidia SDK and FXComposer on my Vista machine. They don't seem hugely compatible with Vista RC1 - lots of security stuff getting in their way, some hard crashes and so on...
Seems that HLSL/FX highlighting in VS'05 is broken these days so I'm hoping that FXComposer will handle SM4/FX10 files and at least allow me a slightly less notepad-like view on my code.
Man, I'd go crazy working exclusivly with the REF device....when do you think you're going to get your hands on some DX10 hardware?