I am writing renderer that use NV_fragment_program. but INVALID_OPERATION is occured when binding texture to unit GL_TEXTURE4_ARB. GL_MAX_TEXTURE_COORDS_NV is 8, GL_MAX_TEXTURE_IMAGE_UNITS_NV is 16,
GL_MAX_TEXTURE_UNITS_ARB is 4.
how can’t it bind textures anymore?
I have a GeforceFX 5900.
any reply will help me.
You should have no problem binding textures to units 0-15 with the geforcefx. Maybe the error you are receiving is not from the bind call? You do have a valid context, don’t you?
First off, the good thing about using fragment programs is that ALL texture units are enabled by default when(I think) you have a valid fragment program bound and GL_FRAGMENT_PROGRAM_NV is enabled.
Second, you are trying to enable a texture unit that is not available if you want use the fixed-funtion pipeline(GeforceFX has a 4 unit limit for fixed function functionality).
So basically ignore the error. Does the fragment program run as it should when sampling textures bound to unit 4-15?
As roffe said, fragment programs don’t require you to enable texture targets. That’s only required for “legacy” stuff, such as ARB_texture_env_combine. They apparently don’t want you to use more than four texture units for this. GL_MAX_TEXTURE_UNITS_ARB is four. Go figure
I’m pretty confident that if you just remove the glEnable(GL_TEXTURE_2D) calls, everything will be fine (and there will be no GL errors).