Hi Guys,
Another 4AM and another moment of weakness. I have taken a snapshot of my latest and greatest thingy. Ripped out almost all of the depth of field code I added last week for the simple reason that every shader would have to be added to, and I would also have to re-create the fixed function pipeline as a shader too just to get it all looking 'normal' under depth of field. Here is a shot of what my new depth of field looks like.
Confused? I understand. What you are seeing in the top left corner is a new depth camera image, where red indicates depth and is blurred in the final scene. The other non-red colours (green and blue) control distortion. You can't see it in this shot, but as the fire decal animates, the final render is distorted as the green and blue elements in the fire texture shift the source texel of the input frame. All I need now is some specifically designed distortion textures and I'll be laughing. I could have shown you a better depth of field shot, but I don't want to spoil the surprise.
So how did I do it? Whilst making a cup of tea I hit upon the idea of NOT transporting the depth through the alpha and instead render out a completely separate depth image. The advantage would be that no new shaders need be written, and all fixed function rendering would work without any tweaks. Well it may have started with that simple concept, but it ended with a rather nice 'bonus' in that once I had used the RED channel to transport my depth (with clever use of fog), I had GREEN and BLUE channels spare. So guess what I used them for
Displacement mapping. Long boring techie story short, this new technique allows the rendering of objects to the depth camera which allow a distortion pattern to be applied to the final render. This technique can be used for things like refraction in windows, heat hazes above fires, a hot desert ripple in the distance and my personal favourite, the cloaked enemy character
I am sure new model packs will be available to provide the media that goes with these ideas, but it's great to know the technology will be available right in the middle of V117, waiting to be exploited. Even X10 did not have heat wave distortion and invisible enemies, and all done with humble PS 2.0 shaders
I drink tea, and in my spare time I write software.