Revision 23eecbd9
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/library/DistortedRenderState.java | ||
---|---|---|
30 | 30 |
*/ |
31 | 31 |
class DistortedRenderState |
32 | 32 |
{ |
33 |
// TODO: figure this out dynamically; this assumes 8 bit stencil buffer. |
|
34 |
private static final int STENCIL_MASK = (1<<8)-1; |
|
35 |
|
|
33 | 36 |
private static int sColorMaskR, sColorMaskG, sColorMaskB, sColorMaskA; // |
34 | 37 |
private static int sDepthMask; // |
35 | 38 |
private static int sStencilMask; // |
... | ... | |
72 | 75 |
mBlendDst = GLES30.GL_ONE_MINUS_SRC_ALPHA; |
73 | 76 |
|
74 | 77 |
mStencilTest = 0; |
75 |
mStencilMask = 0x11111111;
|
|
78 |
mStencilMask = STENCIL_MASK;
|
|
76 | 79 |
mStencilFuncFunc = GLES30.GL_NEVER; |
77 | 80 |
mStencilFuncRef = 0; |
78 |
mStencilFuncMask = 0x11111111;
|
|
81 |
mStencilFuncMask = STENCIL_MASK;
|
|
79 | 82 |
mStencilOpSfail = GLES30.GL_KEEP; |
80 | 83 |
mStencilOpDpfail = GLES30.GL_KEEP; |
81 | 84 |
mStencilOpDppass = GLES30.GL_KEEP; |
... | ... | |
113 | 116 |
|
114 | 117 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
115 | 118 |
|
116 |
static void colorDepthOn() |
|
119 |
static void colorDepthStencilOn()
|
|
117 | 120 |
{ |
118 | 121 |
if( sColorMaskR!=1 || sColorMaskG!=1 || sColorMaskB!=1 || sColorMaskA!=1 ) |
119 | 122 |
{ |
... | ... | |
128 | 131 |
sDepthMask = 1; |
129 | 132 |
GLES30.glDepthMask(true); |
130 | 133 |
} |
134 |
if( sStencilMask!= STENCIL_MASK ) |
|
135 |
{ |
|
136 |
sStencilMask = STENCIL_MASK; |
|
137 |
GLES30.glStencilMask(sStencilMask); |
|
138 |
} |
|
131 | 139 |
} |
132 | 140 |
|
133 | 141 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Progress with Stencil app. Rendering through an intermediate FBO still doesn't quite work.