# “Render” unsigned integer values to texture without clamping to [0,1]

I am trying to render to an unsigned integer texture, with a blending function enable, so that in the end, the value in each texel will be the number of objects rendered on the texel. So I assume I cannot use normalized integers.

For example, if I have a 2x2 texture, and I render [ (0,0) (0,0) (0,1) (1,0) ], the texture result should be, [ 2 1 ; 1 0 ].

I am trying to set up the frameBuffer, but the call to glTexImage2D, causes the GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT when I use the formats I assume I need.

// this works
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 1024, 768, 0, GL_RGB, GL_UNSIGNED_INT, 0);

// this causes GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT
glTexImage2D(GL_TEXTURE_2D,
0,
GL_RGB32UI,
width,
height,
0,
GL_RGB_INTEGER,
GL_UNSIGNED_INT,
0 );


Is what I want to do even possible? If so, which settings do I need to use to accomplish this?