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.
延伸文章資訊
- 1Chapter 14 - OpenGL Programming Guide
The stencil buffer is used to keep the fill color of each polygon from overwriting its outline. T...
- 2Read 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...
- 3Improving Shadows and Reflections via the Stencil Buffer
The OpenGL state is for stencil testing is summarized in Table 2. For completeness, OpenGL also s...
- 4OpenGL Programming/Stencil buffer - Wikibooks, open books ...
When you draw something with OpenGL, you see colors on the screen, but keep in mind that there ar...
- 5Depth & Stencil Testing
When depth testing is enabled: OpenGL tests depth value of a ... them accordingly, but not update...