The error code is 1280, but the string returned by glewGetErrorString returns "Unknown Error".
The error code is 1280, but the string returned by glewGetErrorString returns "Unknown Error".
Try using DrawBuffers enum value instead of 0?
Well I take back the error. That 1280 was being caused by my call to glDisable(GL_CLAMP_FRAGMENT_COLOR), b/c I thought that's how it was suppose to be called.
I commented it out and now no errors are reported. Yet my texture remains black.
But I did try what you said with using DrawBuffers, but a 1281 error is reported immediately after. I've tried the following:
glBindFragDataLocation(program, GL_DRAW_BUFFER, "myIntOutput");
glBindFragDataLocation(program, GL_DRAW_BUFFER0, "myIntOutput");
Well I changed my texture format from GL_ALPHAUI32_EXT to GL_RGBAUI32_EXT and my texture is filled with the correct integer RGBA values. But I really need this to work for a single channel texture.
Any suggestions? And thanks to everybody for all your help so far.
Well I discovered using GL_LUMINANCE32UI_EXT instead of GL_ALPHA32UI_EXT worked. Thanks again for everybody's help!
Maybe R32UI is better than LUMINANCE32UI for forward compatibility.
It is deprecated only in forward compatbile context. In full 3.0 context you can use whatever you want - even fixed functionality rendering.Originally Posted by Jan
0 ir valid argument for colorNumber for glBindFragDataLocation function. It means it will write to 0 attachment of FBO. If it would expect enum there then function signature would include GLenum type, not uint.
Hang on... for integer textures you need to change your texture parameters according to the spec EXT_TEXTURE_INTEGER
void TexParameterIivEXT( enum target, enum pname, int *params );
void TexParameterIuivEXT( enum target, enum pname, uint *params );
You are setting up the textures with plain old normalised glTexParameteri.
Secondly, what makes you think EXT_FBO actually supports integer textures. I have checked ARB_FBO and that definately does..but reading the EXT_Integer_Texture I'm not so sure that it applies to EXT_FBO.
TexParameterIivEXT and TexParameterIuivEXT are needed only for GL_TEXTURE_BORDER_COLOR pname to specify color with integer values.
I encountered the same problem in my program, the difference is that I used cg shader:
glTexImage1D(GL_TEXTURE_1D, 0, GL_ALPHA8UI_EXT,8, 0, GL_ALPHA_INTEGER_EXT, GL_UNSIGNED_BYTE, sBitflag);
param = cgGetNamedParameter(program, par);
cgGLSetTextureParameter(param, tex);
cgGLEnableTextureParameter(param);
how to solve this problem?