/** * Copy the contents of the depth/stencil attachment of the G-Buffer to the * current depth/stencil buffer. */ private void renderCopyDepthStencil( final R2GeometryBufferUsableType gbuffer, final AreaInclusiveUnsignedLType lbuffer_area) { final JCGLFramebufferUsableType gb_fb = gbuffer.primaryFramebuffer(); final JCGLFramebuffersType g_fb = this.g.getFramebuffers(); g_fb.framebufferReadBind(gb_fb); g_fb.framebufferBlit( gbuffer.area(), lbuffer_area, DEPTH_STENCIL, JCGLFramebufferBlitFilter.FRAMEBUFFER_BLIT_FILTER_NEAREST); g_fb.framebufferReadUnbind(); }
@Test public final void testFramebufferBlitSameFramebufferDefault() { final Interfaces i = this.getInterfaces("main"); final JCGLFramebuffersType g_fb = i.getFramebuffers(); final AreaL area = AreasL.create(0L, 0L, 640L, 480L); g_fb.framebufferDrawUnbind(); g_fb.framebufferReadUnbind(); this.expected.expect(JCGLExceptionFramebufferReadDrawSame.class); g_fb.framebufferBlit( area, area, EnumSet.of(JCGLFramebufferBlitBuffer.FRAMEBUFFER_BLIT_BUFFER_DEPTH), JCGLFramebufferBlitFilter.FRAMEBUFFER_BLIT_FILTER_LINEAR); }
@Test public final void testFramebufferBlitSameFramebufferDefault() { final Interfaces i = this.getInterfaces("main"); final JCGLFramebuffersType g_fb = i.getFramebuffers(); final AreaInclusiveUnsignedLType area = AreaInclusiveUnsignedL.of( new UnsignedRangeInclusiveL(0L, 639L), new UnsignedRangeInclusiveL(0L, 479L)); g_fb.framebufferDrawUnbind(); g_fb.framebufferReadUnbind(); this.expected.expect(JCGLExceptionFramebufferReadDrawSame.class); g_fb.framebufferBlit( area, area, EnumSet.of(JCGLFramebufferBlitBuffer.FRAMEBUFFER_BLIT_BUFFER_DEPTH), JCGLFramebufferBlitFilter.FRAMEBUFFER_BLIT_FILTER_LINEAR); }
g_fb.framebufferReadUnbind(); g_fb.framebufferReadBind(fb_read); g_fb.framebufferBlit(
g_fb.framebufferReadUnbind(); g_fb.framebufferReadBind(fb_read); g_fb.framebufferBlit(
g_fb.framebufferReadUnbind(); g_fb.framebufferDrawBind(fb_draw); g_fb.framebufferBlit(
g_fb.framebufferReadUnbind(); g_fb.framebufferDrawBind(fb_draw); g_fb.framebufferBlit(
Assert.assertFalse(g_fb.framebufferDrawIsBound(fb)); g_fb.framebufferReadUnbind(); Assert.assertEquals(Optional.empty(), g_fb.framebufferReadGetBound()); Assert.assertFalse(g_fb.framebufferReadAnyIsBound());
Assert.assertFalse(g_fb.framebufferDrawIsBound(fb)); g_fb.framebufferReadUnbind(); Assert.assertEquals(Optional.empty(), g_fb.framebufferReadGetBound()); Assert.assertFalse(g_fb.framebufferReadAnyIsBound());
R2ProjectionOrthographic.newFrustum(JCGLProjectionMatrices.newMatrices()); g_fb.framebufferReadUnbind(); g_fb.framebufferDrawUnbind();
R2ProjectionOrthographic.newFrustum(JCGLProjectionMatrices.newMatrices()); g_fb.framebufferReadUnbind(); g_fb.framebufferDrawUnbind();
area, R2GeometryBufferComponents.R2_GEOMETRY_BUFFER_FULL)); g_fb.framebufferReadUnbind(); g_fb.framebufferDrawUnbind();
area, R2GeometryBufferComponents.R2_GEOMETRY_BUFFER_FULL)); g_fb.framebufferReadUnbind(); g_fb.framebufferDrawUnbind(); g_fb.framebufferDrawBind(gbuffer.primaryFramebuffer());