()
| 3782 | } |
| 3783 | |
| 3784 | private static void setupFrameBuffer() |
| 3785 | { |
| 3786 | if (dfb != 0) |
| 3787 | { |
| 3788 | EXTFramebufferObject.glDeleteFramebuffersEXT(dfb); |
| 3789 | GlStateManager.deleteTextures(dfbDepthTextures); |
| 3790 | GlStateManager.deleteTextures(dfbColorTextures); |
| 3791 | } |
| 3792 | |
| 3793 | dfb = EXTFramebufferObject.glGenFramebuffersEXT(); |
| 3794 | GL11.glGenTextures((IntBuffer)dfbDepthTextures.clear().limit(usedDepthBuffers)); |
| 3795 | GL11.glGenTextures((IntBuffer)dfbColorTextures.clear().limit(16)); |
| 3796 | dfbDepthTextures.position(0); |
| 3797 | dfbColorTextures.position(0); |
| 3798 | EXTFramebufferObject.glBindFramebufferEXT(36160, dfb); |
| 3799 | GL20.glDrawBuffers(0); |
| 3800 | GL11.glReadBuffer(0); |
| 3801 | |
| 3802 | for (int i = 0; i < usedDepthBuffers; ++i) |
| 3803 | { |
| 3804 | GlStateManager.bindTexture(dfbDepthTextures.get(i)); |
| 3805 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE); |
| 3806 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE); |
| 3807 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); |
| 3808 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); |
| 3809 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL14.GL_DEPTH_TEXTURE_MODE, GL11.GL_LUMINANCE); |
| 3810 | GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL11.GL_DEPTH_COMPONENT, renderWidth, renderHeight, 0, GL11.GL_DEPTH_COMPONENT, GL11.GL_FLOAT, (FloatBuffer)((FloatBuffer)null)); |
| 3811 | } |
| 3812 | |
| 3813 | EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, dfbDepthTextures.get(0), 0); |
| 3814 | GL20.glDrawBuffers(dfbDrawBuffers); |
| 3815 | GL11.glReadBuffer(0); |
| 3816 | checkGLError("FT d"); |
| 3817 | |
| 3818 | for (int k = 0; k < usedColorBuffers; ++k) |
| 3819 | { |
| 3820 | GlStateManager.bindTexture(dfbColorTexturesFlip.getA(k)); |
| 3821 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE); |
| 3822 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE); |
| 3823 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); |
| 3824 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); |
| 3825 | GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, gbuffersFormat[k], renderWidth, renderHeight, 0, getPixelFormat(gbuffersFormat[k]), GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (ByteBuffer)((ByteBuffer)null)); |
| 3826 | EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36064 + k, 3553, dfbColorTexturesFlip.getA(k), 0); |
| 3827 | checkGLError("FT c"); |
| 3828 | } |
| 3829 | |
| 3830 | for (int l = 0; l < usedColorBuffers; ++l) |
| 3831 | { |
| 3832 | GlStateManager.bindTexture(dfbColorTexturesFlip.getB(l)); |
| 3833 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, GL12.GL_CLAMP_TO_EDGE); |
| 3834 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, GL12.GL_CLAMP_TO_EDGE); |
| 3835 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); |
| 3836 | GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); |
| 3837 | GL11.glTexImage2D(GL11.GL_TEXTURE_2D, 0, gbuffersFormat[l], renderWidth, renderHeight, 0, getPixelFormat(gbuffersFormat[l]), GL12.GL_UNSIGNED_INT_8_8_8_8_REV, (ByteBuffer)((ByteBuffer)null)); |
| 3838 | checkGLError("FT ca"); |
| 3839 | } |
| 3840 | |
| 3841 | int i1 = EXTFramebufferObject.glCheckFramebufferStatusEXT(36160); |
no test coverage detected