Revision 1d6d261e
Added by Leszek Koltunski almost 7 years ago
src/main/java/org/distorted/library/EffectQueuePostprocess.java | ||
---|---|---|
291 | 291 |
GLES30.glViewport(0, 0, (int)w1, (int)h1); |
292 | 292 |
mBlur1Program.useProgram(); |
293 | 293 |
buffer1.setAsInput(); |
294 |
buffer2.setAsOutput(time);
|
|
294 |
buffer2.setAsOutput(); |
|
295 | 295 |
|
296 | 296 |
GLES30.glUniform1fv( mWeights1H, radius+1, weightsCache,offset); |
297 | 297 |
GLES30.glUniform1i( mRadius1H, radius); |
... | ... | |
302 | 302 |
GLES30.glVertexAttribPointer(mBlur1Program.mAttribute[0], POS_DATA_SIZE, GLES30.GL_FLOAT, false, 0, mQuadPositions); |
303 | 303 |
GLES30.glVertexAttribPointer(mBlur1Program.mAttribute[1], TEX_DATA_SIZE, GLES30.GL_FLOAT, false, 0, mQuadTexture); |
304 | 304 |
|
305 |
DistortedRenderState.useStencilMark(); |
|
305 |
//DistortedRenderState.switchOffDepthWriting(); |
|
306 |
//DistortedRenderState.useStencilMark(); |
|
306 | 307 |
GLES30.glDrawArrays(GLES30.GL_TRIANGLE_STRIP, 0, 4); |
307 |
DistortedRenderState.unuseStencilMark(); |
|
308 |
//DistortedRenderState.unuseStencilMark(); |
|
309 |
//DistortedRenderState.restoreDepthWriting(); |
|
308 | 310 |
|
309 | 311 |
// vertical blur |
310 | 312 |
GLES30.glViewport(0, 0, (int)w2, (int)h2); |
... | ... | |
324 | 326 |
GLES30.glVertexAttribPointer(mBlur2Program.mAttribute[1], TEX_DATA_SIZE, GLES30.GL_FLOAT, false, 0, mQuadTexture); |
325 | 327 |
GLES30.glDrawArrays(GLES30.GL_TRIANGLE_STRIP, 0, 4); |
326 | 328 |
|
327 |
// after each postprocess, clear the STENCIL |
|
328 |
buffer2.setAsOutput(time); |
|
329 |
// after each postprocess, clear buffers |
|
329 | 330 |
GLES30.glStencilMask(0xff); |
331 |
GLES30.glDepthMask(true); |
|
332 |
GLES30.glColorMask(true,true,true,true); |
|
333 |
GLES30.glClearColor(0.0f,0.0f,0.0f,0.0f); |
|
334 |
GLES30.glClearDepthf(1.0f); |
|
330 | 335 |
GLES30.glClearStencil(0); |
331 |
GLES30.glClear(GLES30.GL_STENCIL_BUFFER_BIT); |
|
336 |
|
|
337 |
buffer1.setAsOutput(); |
|
338 |
GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT|GLES30.GL_DEPTH_BUFFER_BIT);//|GLES30.GL_STENCIL_BUFFER_BIT); |
|
339 |
buffer2.setAsOutput(); |
|
340 |
GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT); |
|
332 | 341 |
} |
333 | 342 |
|
334 | 343 |
return mNumEffects; |
Also available in: Unified diff
Move to a new way to detecting depth of postprocessing halos.
This switches off stenciling (hopefully temporarily!)