FilterPostProcessor and gl_FragDepth

We’re using a lot of post processing effects in our game, and I’m trying to resolve a couple artifacts.



I’m doing a downsample blur in one of our filter chains. It looks fine. But, I also need a downsampled depth buffer for the compositing pass! I had thought this was as easy as taking the depth texture of the scene (handled by FilterPostProcessor) and copying it over in the fragment shader by writing to gl_FragDepth. But, I can’t get the Pass to output a depth buffer.



I know that Filter.Pass wasn’t designed with outputting depth in mind. However, I’ve gone through the code and hacked in appropriate setup for binding a depth texture to the renderFrameBuffer. And I’ve removed the explicit disabling of depth writing.



Anybody know where other impediments might be?