My nephew is playing with ShaderToy all the time. For him it's really easy to display the various layers he's working with - depth, stencil, etc.
I want a simple way to provide him the same ability. Can someone please show me how to do this right?
I've tried glReadPizels to a buffer. I get an insufficient memory error on the thread for trying to allocate ~500kb.
I've tried glBlitFramebuffer to copy the 8 bit stencil buffer to the back buffer. There I get a "GL error 1282: invalid operation" on the next shader call. Somehow GL3 thinks that I'm not bound to the default framebuffer even though I double checked every bind is paired with a gl3.glBindFramebuffer(GL3.GL_FRAMEBUFFER,0), guaranteed in a finally()...
I have successfully mapped the shadow buffer from my lighting system to a texture and displayed that in the past (
https://github.com/MarginallyClever/Robot-Overlord-App/blob/45d63c5b4c9a180451c78711e197c0a9323e87bf/src/main/java/com/marginallyclever/ro3/apps/viewport/renderpass/DrawMeshes.java#L142)... so maybe I shouldn't use the system capabilities to create the stencil buffer and instead should create a separate FBO? idk.
Any advice at all would be greatly appreciated. Thank you!