| 306 |
306 |
GLES31.glStencilMask(0xff);
|
| 307 |
307 |
GLES31.glDepthMask(true);
|
| 308 |
308 |
GLES31.glColorMask(true,true,true,true);
|
| 309 |
|
GLES31.glClearColor(0.0f,0.0f,0.0f,0.0f);
|
|
309 |
GLES31.glClearColor(1.0f,1.0f,1.0f,0.0f);
|
| 310 |
310 |
GLES31.glClearDepthf(1.0f);
|
| 311 |
311 |
GLES31.glClearStencil(0);
|
| 312 |
312 |
|
| ... | ... | |
| 410 |
410 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
| 411 |
411 |
// Render all children, one by one. If there are no postprocessing effects, just render to THIS.
|
| 412 |
412 |
// Otherwise, render to a buffer and on each change of Postprocessing Bucket, apply the postprocessing
|
| 413 |
|
// to a whole buffer and merge it.
|
|
413 |
// to a whole buffer (lastQueue.postprocess) and merge it (this.blitWithDepth).
|
| 414 |
414 |
|
| 415 |
415 |
int renderChildren(long time, int numChildren, ArrayList<DistortedNode> children)
|
| 416 |
416 |
{
|
| ... | ... | |
| 442 |
442 |
|
| 443 |
443 |
numRenders += lastQueue.postprocess(mBuffer);
|
| 444 |
444 |
numRenders += blitWithDepth(time, mBuffer[quality]);
|
|
445 |
|
|
446 |
mBuffer[quality].setAsOutputAndClear(time);
|
| 445 |
447 |
}
|
| 446 |
448 |
|
| 447 |
449 |
internalQuality = currQueue.getInternalQuality();
|
| ... | ... | |
| 502 |
504 |
return (float)mHeight/mRealHeight;
|
| 503 |
505 |
}
|
| 504 |
506 |
|
|
507 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
508 |
/**
|
|
509 |
* Bind this Surface as a Framebuffer we can render to; always clear it's color bit.
|
|
510 |
*
|
|
511 |
* Useful for drawing to the postprocessing buffer, which must sometimes be cleared multiple times
|
|
512 |
* per frame.
|
|
513 |
*/
|
|
514 |
|
|
515 |
private void setAsOutputAndClear(long time)
|
|
516 |
{
|
|
517 |
GLES31.glBindFramebuffer(GLES31.GL_FRAMEBUFFER, mFBOH[0]);
|
|
518 |
|
|
519 |
mTime = time; // have to do this otherwise on the next setAsOutput() we would clear
|
|
520 |
DistortedRenderState.colorDepthStencilOn();
|
|
521 |
GLES31.glClearColor(mClearR, mClearG, mClearB, mClearA);
|
|
522 |
GLES31.glClear(GLES31.GL_COLOR_BUFFER_BIT);
|
|
523 |
DistortedRenderState.colorDepthStencilRestore();
|
|
524 |
}
|
|
525 |
|
| 505 |
526 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
| 506 |
527 |
// PUBLIC API
|
| 507 |
528 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
| ... | ... | |
| 603 |
624 |
GLES31.glClearStencil(mClearStencil);
|
| 604 |
625 |
GLES31.glClear(mClear);
|
| 605 |
626 |
DistortedRenderState.colorDepthStencilRestore();
|
| 606 |
|
|
|
627 |
/*
|
| 607 |
628 |
if( mSSBO[0]>=0 )
|
| 608 |
629 |
{
|
| 609 |
630 |
// yes, this DOES keep on working when 'value' overflows into negative territory.
|
| 610 |
631 |
int value = mIntBuffer.get(FRAME_DELAY*mSurfaceID+mLastIndex);
|
| 611 |
|
/*
|
|
632 |
|
| 612 |
633 |
if( value-mLastValue[mLastIndex]!=mLastDiff )
|
| 613 |
634 |
{
|
| 614 |
635 |
android.util.Log.d("surface", "id " + mSurfaceID +
|
| ... | ... | |
| 617 |
638 |
+ " avg: " + (mAvgSum/RUNNING_AVERAGE)
|
| 618 |
639 |
);
|
| 619 |
640 |
}
|
| 620 |
|
*/
|
|
641 |
|
| 621 |
642 |
mLastDiff = value-mLastValue[mLastIndex];
|
| 622 |
643 |
mLastValue[mLastIndex] = value;
|
| 623 |
644 |
|
| ... | ... | |
| 627 |
648 |
}
|
| 628 |
649 |
|
| 629 |
650 |
if( ++mLastIndex >= FRAME_DELAY ) mLastIndex=0;
|
|
651 |
*/
|
| 630 |
652 |
}
|
| 631 |
653 |
}
|
| 632 |
654 |
|
Fix for bug #28: looks of the borders of a blurred object depend on if the object is the first in the postprocessing bucket.