PDA

View Full Version : glTexGen with multitexturing



yanf
04-23-2003, 05:29 AM
Hi,
Does anybody know how I can generate texture coordinates using glTexGen in multitexturing mode? If it's not possible, is there any other command for coordinates generation, which I can use with multitexturing?

Thanks in advance

sanjo
04-23-2003, 05:37 AM
you just have to call glActiveTexture(GL_TEXTUREx) before calling texgen.

yanf
04-23-2003, 05:43 AM
Thanks for your answer, but I did it, but I can't see the second texture. Any other idea?

cass
04-23-2003, 06:11 AM
You might want to post your setup code (or a condensed form of it). You're probably doing something wrong, but it's difficult to just speculate on it.

Some possibilities:
-not using glActiveTexture
-not enabling texgen on both units
-not enabling texturing on both units

Good strategy: divide and conquer. You say you don't see the second texture. This sounds like a texturing problem, not a texgen one. First get the *texturing* to work on both units, then get the texgen working. Use an all black texture on the 2nd unit with modulate texenv or something to test this.

Thanks -
Cass

deadalive
04-23-2003, 09:16 AM
Quick question:
how do I check if glActiveTexture is supported? I noticed it doesn't come up in the string list (with my GF3) and I'm confident it is there.
Is it part of another extention?

vincoof
04-23-2003, 10:02 AM
glActiveTexture is supported if the OpenGL version is higher or equal to 1.3 (check it with glGetString(GL_VERSION)).
If OpenGL1.3 is not supported, you still can look at the equivalent function glActiveTextureARB which supported if "GL_ARB_multitexture" is part of the extensions string returned by glGetString(GL_EXTENSIONS).

About texgen, it is local to the texture unit just like texenv. That is, you can setup some texgen for the first unit and some other texgen for the second unit. You can as well enable or disable texgen for the first and second texture units independently.

[This message has been edited by vincoof (edited 04-23-2003).]