How to read stencil buffer in glsl? - OpenGL - Khronos Forums

文章推薦指數: 80 %
投票人數:10人

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.



請為這篇文章評分?