How to read stencil buffer in glsl? - OpenGL - Khronos Forums
文章推薦指數: 80 %
I have two questions about using stencil buffer: (1) How can I read stencil buffer in glsl? (2) If (1) is possible, should I bind it as a ... Howtoreadstencilbufferinglsl? OpenGL OpenGL:BasicCoding andychen July14,2014,5:16am #1 Ihavetwoquestionsaboutusingstencilbuffer: (1)HowcanIreadstencilbufferinglsl? (2)If(1)ispossible,shouldIbinditasatexture?Howtodoit? Thanks! Agent_D July14,2014,8:48am #2 IfyourendertoanFBO,youcanalwaysbindadepth/stencilorstencilonlytargetandaftertheFBOpassisdonebindthe stenciltextureasaregulartextureandreadfromit. ReadingfromthestencilbufferyouarerenderingtoisAFAIKnotpossible,asstenciltesting(aswellasdepthtestingandblending) isdoneontheresultofthefragmentshader,afterthefragmentshaderforthegivenfragmenthasbeenexecuted.
延伸文章資訊
- 1Improving Shadows and Reflections via the Stencil Buffer
The OpenGL state is for stencil testing is summarized in Table 2. For completeness, OpenGL also s...
- 2How to read back stencil buffer - OpenGL: Advanced Coding
Hi all, I'm need read back the stencil buffer, see the below code ... // Disable depth buffer upd...
- 3Depth and stencils - OpenGL
The drawing operation of the cube uses the values from the stencil buffer to only draw fragments ...
- 4Read depth values while stencil testing(same texture) - Stack ...
In my opinion there should not be any problems, because i'm not reading the stencil buffer values...
- 5How to read stencil buffer in glsl? - OpenGL - Khronos Forums
I have two questions about using stencil buffer: (1) How can I read stencil buffer in glsl? (2) I...