Revision b3120b1b
Added by Leszek Koltunski almost 7 years ago
src/main/java/org/distorted/library/DistortedRenderState.java | ||
---|---|---|
166 | 166 |
if( sStencilTest!=1 ) |
167 | 167 |
{ |
168 | 168 |
sStencilTest = 1; |
169 |
//android.util.Log.d("State", "stencil test on"); |
|
169 | 170 |
GLES30.glEnable(GLES30.GL_STENCIL_TEST); |
170 | 171 |
} |
171 | 172 |
if( sStencilFuncFunc!=GLES30.GL_ALWAYS || sStencilFuncRef!=1 || sStencilFuncMask!=STENCIL_MASK ) |
... | ... | |
173 | 174 |
sStencilFuncFunc = GLES30.GL_ALWAYS; |
174 | 175 |
sStencilFuncRef = 1; |
175 | 176 |
sStencilFuncMask = STENCIL_MASK; |
177 |
//android.util.Log.d("State", "stencil func on"); |
|
176 | 178 |
GLES30.glStencilFunc(sStencilFuncFunc,sStencilFuncRef,sStencilFuncMask); |
177 | 179 |
} |
178 | 180 |
if( sStencilOpSfail!=GLES30.GL_KEEP || sStencilOpDpfail!=GLES30.GL_KEEP || sStencilOpDppass!=GLES30.GL_REPLACE ) |
... | ... | |
180 | 182 |
sStencilOpSfail = GLES30.GL_KEEP; |
181 | 183 |
sStencilOpDpfail= GLES30.GL_KEEP; |
182 | 184 |
sStencilOpDppass= GLES30.GL_REPLACE; |
185 |
//android.util.Log.d("State", "stencil op on"); |
|
183 | 186 |
GLES30.glStencilOp(sStencilOpSfail,sStencilOpDpfail,sStencilOpDppass); |
184 | 187 |
} |
185 | 188 |
if( sColorMaskR!=0 || sColorMaskG!=0 || sColorMaskB!=0 || sColorMaskA!=0 ) |
... | ... | |
188 | 191 |
sColorMaskG = 0; |
189 | 192 |
sColorMaskB = 0; |
190 | 193 |
sColorMaskA = 0; |
194 |
//android.util.Log.d("State", "switch off color writing"); |
|
191 | 195 |
GLES30.glColorMask(false,false,false,false); |
192 | 196 |
} |
193 | 197 |
if( sDepthMask!=0 ) |
194 | 198 |
{ |
195 | 199 |
sDepthMask = 0; |
200 |
//android.util.Log.d("State", "switch off depth writing"); |
|
196 | 201 |
GLES30.glDepthMask(false); |
197 | 202 |
} |
198 | 203 |
if( sStencilMask!= STENCIL_MASK ) |
199 | 204 |
{ |
200 | 205 |
sStencilMask = STENCIL_MASK; |
206 |
//android.util.Log.d("State", "stencil mask on"); |
|
201 | 207 |
GLES30.glStencilMask(sStencilMask); |
202 | 208 |
} |
203 | 209 |
} |
... | ... | |
234 | 240 |
|
235 | 241 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
236 | 242 |
|
237 |
static void restoreStencilMark()
|
|
243 |
static void unuseStencilMark()
|
|
238 | 244 |
{ |
239 | 245 |
if( rStencilTest!=sStencilTest ) |
240 | 246 |
{ |
Also available in: Unified diff
Progress with Stencil in Postprocessing (doesn't work still)