Tuesday, March 30, 2010

This is Interesting...

Yesterday - after my difficulties with fog - I did some work on the underwater warp. There is now a post-processing shader that handles it per-pixel for r_hlsl 1 mode. Ordinarily this would be slower than the old way (which was per-vertex at a reasonably fine tesselation level) but I was able to integrate the underwater screen tint into the shader, thereby avoiding the second blend pass for that (I got it effectively for free) so it's actually faster.

This is where things get exciting. The underwater warp is done via render-to-texture, and I think I can set things up so that everything always goes through render-to-texture, but still retains the same speed as before. This means that I can also get the screen tint for damage and item pickups for free, and it also opens the possibility of doing other post-processing effects reasonably cheap. It seems as though motion blur would be possible with minimal FPS drop (it would involve no more than a texture lookup and 1 or 2 extra instructions), and HDR bloom would also be very fast.

This is quite theoretical and does go slightly against the trad ethos of DirectQ, but at the same time if I can get effects like this with minimal performance impact I see no reason to not include them as disabled-by-default options.

0 comments: