@Override
 public void render() {
   GL2GL3 gl = GLContext.getCurrentGL().getGL2GL3();
   gl.glEnable(gl.GL_BLEND);
   gl.glBlendFunc(gl.GL_SRC_ALPHA, gl.GL_ONE_MINUS_SRC_ALPHA);
   super.render();
   gl.glDisable(gl.GL_BLEND);
 }
Пример #2
0
  public void attachDepthRBO(GL2GL3 gl, int width, int height) {
    int[] id = new int[1];
    gl.glGenRenderbuffers(1, id, 0);
    rboid = id[0];
    gl.glBindRenderbuffer(GL2.GL_RENDERBUFFER, rboid);
    gl.glRenderbufferStorage(GL2.GL_RENDERBUFFER, GL2.GL_DEPTH_COMPONENT, width, height);
    gl.glBindRenderbuffer(GL2.GL_RENDERBUFFER, 0);

    gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, fboid);
    gl.glFramebufferRenderbuffer(
        GL2.GL_FRAMEBUFFER, GL2.GL_DEPTH_ATTACHMENT, GL2.GL_RENDERBUFFER, rboid);
    gl.glEnable(GL2.GL_DEPTH_TEST);
    gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, 0);
  }
Пример #3
0
 public void attachDepth(GL2GL3 gl, TextureBase tex) {
   gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, fboid);
   gl.glFramebufferTextureARB(GL2.GL_FRAMEBUFFER, GL2.GL_DEPTH_ATTACHMENT, tex.getTexID(), 0);
   gl.glEnable(GL2.GL_DEPTH_TEST);
 }