View Full Version : TexGen + TexCoordPointer

06-08-2002, 11:55 PM
I was doing some tests, and since the model (drawn with glDrawElements) appeared all black, I decided to try glTexGen with sphere_map to see if the texture was loaded OK and the texture ID was valid too.

It crashed because I had

When I disable that, the texture appears fine. Am I crazy, or is texture coordinates supplied by client suppose to be ignored, when TexGen is enabled (for S and T)


06-09-2002, 01:47 AM
Well I'd say you found a bug, but I'm no spec monkey.

I expect your conclusions are correct, but the worst thing that should happen even if you are wrong is a gl error gets generated.

[This message has been edited by dorbie (edited 06-09-2002).]

06-09-2002, 06:22 AM
I suspect the crash is because you have your tex coord pointer pointing to an invalid memory block. Of course, one would assume that with texgen enabled the driver wouldnt even bother trying to look at the tex coord array, but thats beyond the point. Once you go and do something silly, there is no point in blaming the driver for doing something silly too.

06-09-2002, 07:37 AM
Good point, I assumed valid data.

06-09-2002, 08:04 AM
The vertex data pusher (client state, if you will) doesn't know much about texture coordinate generation, which is server side.

Thus, enabling texture coordinate arrays will still send texture coordinates to the card, no matter whether texgen is on or not. Seems quite natural (according to the spec) to me.

Enabling texture coordinate arrays without a valid array established is also likely to crash; that seems natural too :-)

06-09-2002, 08:09 AM
FYI, the same thing happens with an invalid texcoord pointer and an enabled texcoord array client state on a disabled texture unit. Just make sure you always disable the arrays not explicitly used.

06-09-2002, 08:47 PM
OK, I guess disabling is essential. Either that or you must suply a valid pointer.

Thanks guys,