GBAA demo updated
Monday, August 22, 2011 | Permalink
I have updated the GBAA demo with a few fixes to performance and image quality. The most glaring oversight I did in the previous version was that I made a copy of the backbuffer for the last resolve pass to read. I tend to copy an old demo and start from that rather than setting up everything from scratch. In this case I copied the GPAA demo and it didn't pass my mind that the backbuffer copy that was necessary for GPAA is not necessary when you have a final fullscreen pass like in GBAA. Instead you can just render to a temporary render target and read that while writing to the backbuffer in the end. This buffer copy was nearly half the cost of the resolve process, so eliminating this is significant win. The other thing I did was to only clear the buffers that need it, i.e. the depth buffer and geometry buffer. I could have removed the geometry buffer clear too, but felt it was good for educational purposes to leave it there, plus I would have had to change the skybox pass to accommodate the change, so it wouldn't necessarily be a win in all cases. For image quality I changed the unused component to be 0.5 instead of 0. This is to avoid the case where the distance computation landed exactly on zero, which would be interpreted as "no edge here" rather than edge cutting through pixel center. This resulted in some rare single pixel errors, especially for lower precision formats like RG8S. This demo is still using RG16F though because I saw nearly no performance gain to go down to RG8S.