I'm doing some screen-space reflections that are pretty expensive. I'd like to render them to a half-size buffer, but they require a lot of input information, so I end up with a lot of color attachments on my first render buffer.
I was thinking maybe I could draw to every fourth pixel in the initial pass, but this is exactly the kind of problem GPU logic would probably not be efficient with. An if statement would likely result in all four pixels executing the expensive reflection code.
So I was thinking maybe I could use the stencil buffer to only render to one pixel for each 2x2 group. I have never used the stencil buffer before, and it seems like something that rarely gets used.
Is this a good idea for performance? How do I set this up? I just want a stencil pattern like this across the whole screen:
1 0
0 0