PDA

View Full Version : ARB multitexturing problem



TiPiaX
02-26-2002, 06:10 AM
hi, i code a 3D engine with lightmaps, so i render them with multitexturing using the ARB extension. But i use simple texturing with our old opengl api too for the models.
The programms run fine with a Kyro2 but it seems but on some cards the the simple texturing give just a single black texture.

Maybe it exists a function to desactive ARB or something like that. Can you help me ?

thx
TiPiaX

zeckensack
02-26-2002, 06:17 AM
Have you properly disabled the higher texture units when rendering single textured?

Something like this:

glActiveTextureARB(GL_TEXTURE1_ARB);
glDisable(GL_TEXTURE_2D);

If you don't (maybe you just bind 0 as active texture on the higher units), according to the spec, texture mapping will NOT work. In this case, the Kyro drivers are wrong and you shouldn't rely on their behaviour.

TiPiaX
02-26-2002, 06:19 AM
hey you are right i didn't do that. But i don't understand what you said. The problem is the gldisable(GL_TEXTURE_2D) or the number of the unit ?

In fact for the simple texturing i just use a bindtexture without caring about the ARB..
Is it not correct ?

[This message has been edited by TiPiaX (edited 02-26-2002).]

zeckensack
02-26-2002, 06:53 AM
The problem is that there's no call in the form of

glDisable(GL_TEXTURE_2D,GL_TEXTURE1_ARB);

so you have to explicitly switch to the texture unit to be disabled

glActiveTextureARB(GL_TEXTURE1_ARB);

and then disable texturing on it

glDisable(GL_TEXTURE_2D);

if you are using more than two texture units, make sure you disable the rest as well.

"In fact for the simple texturing i just use a bindtexture without caring about the ARB..
Is it not correct ?"

Don't forget to select texture unit 0 before binding your single texturing ... err ... texture to it.

If you don't do this the texture will be bound to the last texture unit selected with glActiveTextureARB(...).
That would only work if you set your texture environment to GL_REPLACE and this may/may not be faster than disabling texture units. However, you must make sure you do that, otherwise it will break on 'correct' OpenGL implementations.