Drawing to FBO produces odd "effect." Ideas???

Inside of my JOGL app I’m pulling frames from a QuickTime movie and rendering to a Framebuffer. When displayed, the images seem to be have the lighter pixels replaced with various colors bands. Links to before and after shots below. Anyone care to venture a guess as to what’s going on here? Or at least steer me towards some possible causes?


The code looks about like this:

gl0.glGenRenderbuffersEXT( 1, rb, 0 );
gl0.glGenFramebuffersEXT( 1, fb, 0 );

_framebuffer = fb[0];
_renderbuffer = rb[0];

gl0.glBindRenderbufferEXT( GL.GL_RENDERBUFFER_EXT, _renderbuffer );
gl0.glRenderbufferStorageEXT( GL.GL_RENDERBUFFER_EXT, GL.GL_RGBA, 1024, 1024 );
gl0.glBindFramebufferEXT( GL.GL_FRAMEBUFFER_EXT, _framebuffer );

ByteBuffer _buffer = _player.getFrame();
gl0.glDrawPixels( 1024, 1024, GL.GL_RGBA, GL.GL_BYTE, _buffer );

Check data types. It should be:

gl0.glDrawPixels( 1024, 1024, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, _buffer );

Which could explains why white turns black in the second picture.

And use Glubyte as _buffer type (or unsigned char)

Thanks dletozeun! That was the problem. Looking good now.