Tuesday, March 30, 2010

More on Shader Post-Processing

Today I didn't get much solid work done, but have experimented a little more with my shader post-processing setup. The decision for now is to leave the standard refresh as is, but to use render to texture with post-processing as a replacement for both the underwater warp and the regular polyblend (bonus flash, damage tint, etc). This works out faster than the regular polyblend, but does involve a slightly more convoluted code path. Never mind though, it's done and what we now have is more solid performance.

I need to research more on render to texture and techniques for optimizing it, as I suspect that I could be pulling more performance out of it, so this (and the possibility of further effects such as motion blur) is on the list of possible things for 1.9.0; the 1.8.x series will retain the more basic setup.

In other news, I've just had a crazy idea for lightmap updating, which would involve creating the lightmaps as render target textures, then running the updates on the GPU. In theory it could be blisteringly fast as it wouldn't involve a copy of data from system meory to video memory. In practice I don't know as it's just the beginnings of an idea. At the very least I would need to get a test app together for bashing this into shape.

2 comments:

=peg= said...

Sounds promising!

While you're at it, how about a lil DirectCompute to let people with unified shader hardware take advantage of it ;)

mhquake said...

Nah, I'm more of the opinion that the GPU should do graphics. It would be quite nice though to use it for something like lightmaps or other things where there is a strong link between what the CPU does and what the GPU does. But I think that lightmaps could be done in a regular shader all the same.