Hi all!
I tried to implement a paper called “Stencil Routed A-Buffer” from Nvidia with OpenGL and GLSL, using the extension mentioned on one of the authors’ homepage L. Bavoil. What the paper does is routing samples by setting different stencil bitmasks for every sample in the multisampled stencilbuffer. The extension does allow reading from single samples after rendering, and setting alpha bit masks to render to specific samples per pass… but no separate stencil mask for every sample that could be decremented during the pass to render different values into each single sample.
Is it in any way possible to access the stencil buffer from within the shader, maybe with a packed depth stencil renderbuffer? Or can i in some way create a multisample stencil buffer? Maybe i am overlooking something…
Among other things, provides “The ability to fetch a specific sample from a multisampled texture”. Could be used to infer the stencil values, even if the multisample stencil buffer couldn’t be queried directly (and I don’t know – maybe it can).