Advertisement

simple? multitexture question

Started by June 27, 2003 07:14 PM
1 comment, last by InfestedFurby 21 years, 8 months ago
On a card with only 2 texture units (gf2), is it possible to multitexture more than 2 textures onto a polygon? I''m not sure if the number of texture units determines the total possible textures on a polygon or only the speed at which they are rendered. My program works fine when I multitexture on 2 textures, but when I try to add a third one it only renders the first and the 3rd texture, not the middle one. Here is my multitexture init code: glActiveTextureARB(GL_TEXTURE0_ARB); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D,blatexture); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glActiveTextureARB(GL_TEXTURE1_ARB); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, blatexture2); glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_COMBINE_EXT); glTexEnvi(GL_TEXTURE_ENV,GL_COMBINE_RGB_EXT,GL_INTERPOLATE_EXT); glTexEnvi(GL_TEXTURE_ENV,GL_COMBINE_ALPHA_EXT,GL_ADD); glTexEnvi(GL_TEXTURE_ENV,GL_SOURCE2_RGB_EXT,GL_TEXTURE); glTexEnvi(GL_TEXTURE_ENV,GL_OPERAND2_RGB_EXT,GL_SRC_ALPHA); glActiveTextureARB(GL_TEXTURE2_ARB); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, blatexture3); glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_COMBINE_EXT); glTexEnvi(GL_TEXTURE_ENV,GL_COMBINE_RGB_EXT,GL_INTERPOLATE_EXT); glTexEnvi(GL_TEXTURE_ENV,GL_COMBINE_ALPHA_EXT,GL_ADD); glTexEnvi(GL_TEXTURE_ENV,GL_SOURCE2_RGB_EXT,GL_TEXTURE); glTexEnvi(GL_TEXTURE_ENV,GL_OPERAND2_RGB_EXT,GL_SRC_ALPHA); any ideas?
Infested Furbyinfestedfurby@hotmail.cominfestedfurby.cjb.net
if you card only has 2 texture units than it can only render 2 textures at a time, as soon as you try to turn on a 3rd it wont work properly (as to what it does depends on the drivers i guess, in some cases like your it will render 1 & 3, in another it might crash or throw an error)

If you want to blend more than 2 textures together then you''ll need to do multipass rendering, render the first 2 textures then setup the blending, disable the second texture unit and bind the 3rd texture to the first texture unit and rerender that object.
Advertisement
thanks
Infested Furbyinfestedfurby@hotmail.cominfestedfurby.cjb.net

This topic is closed to new replies.

Advertisement