I'm implementing texture masking using framebuffer's depth buffer following this example:
https://github.com/mattdesl/lwjgl-basics/wiki/LibGDX-Masking#masking-with-depth-buffer
I got it working with ShapeRenderer altering depth buffer, but now I want to alter depth buffer with a Pixmap. I need all non-opaque pxiels from pixmap to be written to depth buffer as 1.0 depth value, and all opaque ones as 0.0 depth value.
I see a solution in writing individual pixels from Pixmap with ShapeRenderer. But that seems rather inefficient. Is there a more appropriate and efficient way?