Revision 9e999930
Added by Leszek Koltunski over 7 years ago
| src/main/java/org/distorted/library/main/DistortedEffects.java | ||
|---|---|---|
| 128 | 128 |
final InputStream blitVertStream = resources.openRawResource(R.raw.blit_vertex_shader); |
| 129 | 129 |
final InputStream blitFragStream = resources.openRawResource(R.raw.blit_fragment_shader); |
| 130 | 130 |
|
| 131 |
String blitVertHeader= (Distorted.GLSL_VERSION + "#define NUM_VERTEX 0\n" ); |
|
| 132 |
String blitFragHeader= (Distorted.GLSL_VERSION + "#define NUM_FRAGMENT 0\n"); |
|
| 133 |
|
|
| 134 | 131 |
try |
| 135 | 132 |
{
|
| 136 |
mBlitProgram = new DistortedProgram(blitVertStream,blitFragStream,blitVertHeader,blitFragHeader, Distorted.GLSL);
|
|
| 133 |
mBlitProgram = new DistortedProgram(blitVertStream,blitFragStream,Distorted.GLSL_VERSION,Distorted.GLSL_VERSION, Distorted.GLSL);
|
|
| 137 | 134 |
} |
| 138 | 135 |
catch(Exception e) |
| 139 | 136 |
{
|
| ... | ... | |
| 151 | 148 |
|
| 152 | 149 |
try |
| 153 | 150 |
{
|
| 154 |
mBlitDepthProgram = new DistortedProgram(blitDepthVertStream,blitDepthFragStream,blitVertHeader,blitFragHeader, Distorted.GLSL);
|
|
| 151 |
mBlitDepthProgram = new DistortedProgram(blitDepthVertStream,blitDepthFragStream,Distorted.GLSL_VERSION,Distorted.GLSL_VERSION, Distorted.GLSL);
|
|
| 155 | 152 |
} |
| 156 | 153 |
catch(Exception e) |
| 157 | 154 |
{
|
| src/main/java/org/distorted/library/main/DistortedOutputSurface.java | ||
|---|---|---|
| 354 | 354 |
|
| 355 | 355 |
numRenders += lastQueue.postprocess(mBuffer,fbo); |
| 356 | 356 |
numRenders += blitWithDepth(time, mBuffer[quality],fbo); |
| 357 |
mBuffer[quality].clearBuffer(time,fbo);
|
|
| 357 |
mBuffer[quality].clearBuffer(fbo); |
|
| 358 | 358 |
} |
| 359 | 359 |
|
| 360 | 360 |
internalQuality = currQueue.getInternalQuality(); |
| ... | ... | |
| 417 | 417 |
|
| 418 | 418 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
| 419 | 419 |
|
| 420 |
private void clearBuffer(long time,int fbo)
|
|
| 420 |
private void clearBuffer(int fbo) |
|
| 421 | 421 |
{
|
| 422 |
GLES31.glBindFramebuffer(GLES31.GL_FRAMEBUFFER, mFBOH[fbo]); |
|
| 423 |
|
|
| 424 |
mTime[fbo] = time; // have to do this otherwise on the next setAsOutput() we would clear |
|
| 425 | 422 |
DistortedRenderState.colorDepthStencilOn(); |
| 423 |
|
|
| 426 | 424 |
GLES31.glClearColor(mClearR, mClearG, mClearB, mClearA); |
| 425 |
GLES31.glClearDepthf(mClearDepth); |
|
| 426 |
GLES31.glClearStencil(mClearStencil); |
|
| 427 |
|
|
| 428 |
GLES31.glBindFramebuffer(GLES31.GL_FRAMEBUFFER, mFBOH[fbo]); |
|
| 429 |
GLES31.glFramebufferTexture2D(GLES31.GL_FRAMEBUFFER, GLES31.GL_COLOR_ATTACHMENT0, GLES31.GL_TEXTURE_2D, mColorH[2*fbo+1], 0); |
|
| 430 |
GLES31.glClear(GLES31.GL_COLOR_BUFFER_BIT|GLES31.GL_DEPTH_BUFFER_BIT|GLES31.GL_STENCIL_BUFFER_BIT); |
|
| 431 |
GLES31.glFramebufferTexture2D(GLES31.GL_FRAMEBUFFER, GLES31.GL_COLOR_ATTACHMENT0, GLES31.GL_TEXTURE_2D, mColorH[2*fbo ], 0); |
|
| 427 | 432 |
GLES31.glClear(GLES31.GL_COLOR_BUFFER_BIT); |
| 433 |
|
|
| 428 | 434 |
DistortedRenderState.colorDepthStencilRestore(); |
| 429 | 435 |
} |
| 430 | 436 |
|
Also available in: Unified diff
Start merging master and OIT.