Revision 97020807
Added by Leszek Koltunski almost 6 years ago
src/main/java/org/distorted/library/main/DistortedOutputSurface.java | ||
---|---|---|
261 | 261 |
} |
262 | 262 |
} |
263 | 263 |
|
264 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
265 |
|
|
266 |
private int blitWithDepth(long currTime, DistortedOutputSurface buffer,int fbo) |
|
267 |
{ |
|
268 |
GLES31.glViewport(0, 0, mWidth, mHeight); |
|
269 |
setAsOutputFBO(currTime,fbo); |
|
270 |
GLES31.glActiveTexture(GLES31.GL_TEXTURE0); |
|
271 |
GLES31.glBindTexture(GLES31.GL_TEXTURE_2D, buffer.mColorH[2*fbo]); |
|
272 |
GLES31.glActiveTexture(GLES31.GL_TEXTURE1); |
|
273 |
GLES31.glBindTexture(GLES31.GL_TEXTURE_2D, buffer.mDepthStencilH[fbo]); |
|
274 |
|
|
275 |
GLES31.glDisable(GLES31.GL_STENCIL_TEST); |
|
276 |
GLES31.glStencilMask(0x00); |
|
277 |
|
|
278 |
DistortedEffects.blitDepthPriv(this, buffer.getWidthCorrection(), buffer.getHeightCorrection() ); |
|
279 |
GLES31.glActiveTexture(GLES31.GL_TEXTURE0); |
|
280 |
GLES31.glBindTexture(GLES31.GL_TEXTURE_2D, 0); |
|
281 |
GLES31.glActiveTexture(GLES31.GL_TEXTURE1); |
|
282 |
GLES31.glBindTexture(GLES31.GL_TEXTURE_2D, 0); |
|
283 |
|
|
284 |
// clear buffers |
|
285 |
GLES31.glStencilMask(0xff); |
|
286 |
GLES31.glDepthMask(true); |
|
287 |
GLES31.glColorMask(true,true,true,true); |
|
288 |
GLES31.glClearColor(0.0f,0.0f,0.0f,0.0f); |
|
289 |
GLES31.glClearDepthf(1.0f); |
|
290 |
GLES31.glClearStencil(0); |
|
291 |
|
|
292 |
buffer.setAsOutputFBO(fbo); |
|
293 |
GLES31.glFramebufferTexture2D(GLES31.GL_FRAMEBUFFER, GLES31.GL_COLOR_ATTACHMENT0, GLES31.GL_TEXTURE_2D, buffer.mColorH[2*fbo+1], 0); |
|
294 |
GLES31.glClear(GLES31.GL_COLOR_BUFFER_BIT|GLES31.GL_DEPTH_BUFFER_BIT|GLES31.GL_STENCIL_BUFFER_BIT); |
|
295 |
GLES31.glFramebufferTexture2D(GLES31.GL_FRAMEBUFFER, GLES31.GL_COLOR_ATTACHMENT0, GLES31.GL_TEXTURE_2D, buffer.mColorH[2*fbo ], 0); |
|
296 |
GLES31.glClear(GLES31.GL_COLOR_BUFFER_BIT); |
|
297 |
|
|
298 |
return 1; |
|
299 |
} |
|
300 |
|
|
264 | 301 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
265 | 302 |
|
266 | 303 |
private static void oitClear(DistortedOutputSurface buffer) |
Also available in: Unified diff
Start merging master and OIT.