Rendering to frame buffer

Hi,

I’m trying to render to a frame buffer, and the shapes I’m drawing are circles that have a gradient fill from black to white (center to outer ring). I am using the following code to draw to the buffer. I then read the pixels from the buffer, and while my image shows the circles in the correct location, they are all completely transparent. The code is as follows:


int[] fb_a = new int[1];
IntBuffer fb = IntBuffer.wrap(fb_a);
gl.glGenFramebuffersEXT(1, fb);
gl.glBindFramebufferEXT(GL.GL_FRAMEBUFFER_EXT, fb_a[0]);
ifbo = fb_a[0];

int[] rbo_a = new int[1];
IntBuffer rbo = IntBuffer.wrap(rbo_a);
gl.glGenRenderbuffersEXT(1, rbo);
gl.glBindRenderbufferEXT(GL.GL_RENDERBUFFER_EXT, rbo_a[0]);

gl.glRenderbufferStorageEXT(GL.GL_RENDERBUFFER_EXT, GL.GL_RGBA, width, height);
gl.glFramebufferRenderbufferEXT(GL.GL_FRAMEBUFFER_EXT, GL.GL_COLOR_ATTACHMENT0_EXT, GL.GL_RENDERBUFFER_EXT, rbo_a[0]);

int status = gl.glCheckFramebufferStatusEXT(GL.GL_FRAMEBUFFER_EXT);
if (status != GL.GL_FRAMEBUFFER_COMPLETE_EXT) {
    System.out.println("error creating FBO");
}
gl.glClearColor(1,1,1,1);
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glViewport(0, 0, width, height);
int slices = 18;
gl.glEnable(GL.GL_BLEND);

// draw circles for each of the points
for each point {
        gl.glBegin(GL.GL_TRIANGLE_FAN);
	gl.glSetColor4d(0,0,0,1);
	gl.glVertex3d(center.x,center.y,center.z);
        gl.setColor4d(1,1,1,1);
        float incr = (float) (2 * Math.PI / slices);
        for (int i = 0; i <= slices; i++) {
            float angle = incr * i;
            Vec4 pt = computePointLocation(); // this just computes the point
            gl.glVertex3d(pt.x, pt.y, pt.z);
        }
        gl.glEnd();
}
gl.glBindFramebufferEXT(GL.GL_FRAMEBUFFER_EXT, 0);
gl.glBindRenderbufferEXT(GL.GL_RENDERBUFFER_EXT, 0);


Any help is appreciated here. Thanks.

Jeff

What happens when you disable glBlend?

Edit: I forgot to disable a shader I was using. Now the writing of the pixels to that buffer works perfectly, thanks!