Multitexturing->Mix two textures

ok thank you but I think that I don’t have GL_ARB_texture_env_combine extension on my geforce4 MMX 440 ! according to delphi3D hardware registry…I will verify but I am almost sure…
So is there another mean to do the mix or I have to change my graphic card? :frowning:

you surely have it, else you hadn’t gotten so far…
there is also an EXT_ version, which is really old.

I have not GL_ARB_texture_env_combine on my graphic card but I have GL_NV_texture_env_combine4 ( I did see it) so I can keep my graphic card!
But what is the equivalent with ATI graphic cards?

thank you.

That graphics card supports env combine reporting both ARB and EXT strings (the right thing to do for compatability).

http://delphi3d.net/hardware/viewreport.php?report=943

More speed less haste, you need to slow down be a heck of a lot more careful before disagreeing with people who’re trying to help you.

This has dragged on for weeks and now this.

You may want to check the gl release version incase combiners are in the core (this advice is platform dependent since the Windows ABI is locked in the past and technically should report all this stuff, other platforms can spin the major rev and drop the string [although it can cause issues exactly like this one so I’m not sure if they do]). Since you ran glinfo2 I suspect you’re on windows and therefore you’re just not looking carefully enough.

Update your drivers, and if you still think it doesn’t support combiners then take up bowling instead.

Thank you! sorry I am confused but I made a big mistake when I said that I have not GL_ARB_texture_env_combine extension! In fact I wanted to say that I have not GL_ARB_texture_env_crossbar ! But I have the equivalent with GL_NV_texture_env_combine4…
That’s why I would like to know what is the equivalent on ATI graphic cards when GL_ARB_texture_env_combine extension is not there…

I thought that I can’t set more than one texture ( with GL_TEXTURE ) on the same unit…so I don’t understand how I could set the grass and soil textures as source0 and 1 on the first unit…
And why I have to set the operand to alpha for the ramp? And with this operand alpha I take the color of ramp with GL_SRC_COLOR? In short, this passage is not clear…

Yes my OS in windows and now I am at home and I am sure that I have not crossbar extension.

thank you

It should probably report crossbar, you’ll find it works, heck you’re already feeding multile textures into a single unit.

Crossbar is trivial from an API point of view and it is working for you. It’s the ability to specify other texture taps into a texenv, and yes NV combine4 does add this.

ok but I am sure! I don’t have crossbar and I am only trying to set multiple texture in the same texture unit and it doesn’t work because I don’t know the good way to do this form the beginnig of this thread…
Otherwise have you got some piece of code that could give me some examples in order to I know how I have to use this extension…

for example if I can use two textures in the same unit I could modulate two textures in this way (without lighting):

glActiveTextureARB(GL_TEXTURE0);
glEnable(GL_TEXTURE_2D);
glTexEnvi (GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_COMBINE4_NV);
//RGB combiner setup
glTexEnvi (GL_TEXTURE_ENV,GL_COMBINE_RGB,GL_MODULATE);

glBindTexture(GL_TEXTURE_2D,nom[0]);
glTexEnvi (GL_TEXTURE_ENV,GL_SOURCE0_RGB,GL_TEXTURE);
glTexEnvi (GL_TEXTURE_ENV,GL_OPERAND0_RGB,GL_SRC_COLOR);
glBindTexture(GL_TEXTURE_2D,nom[1]);
glTexEnvi (GL_TEXTURE_ENV,GL_SOURCE1_RGB,GL_TEXTURE);
glTexEnvi (GL_TEXTURE_ENV,GL_OPERAND1_RGB,GL_SRC_COLOR);

But i see only the second texture ( nom[1] ) on the terrain…

bloody hell, you cant bind 2 textures to the same unit… as frequently stated

crossbar/combine4 allow you to code the combiner of the texunit in a fashion you can access from other bound texunits. that’s all…

stop guessing around, and start reading the spec + experimenting on your own. it’s pure a + b = c math going on in the texunit combiners… make sure you set ALL operands/sources that are needed for the function.

you dont need to use combine4, just regular combiners will do.
the combine4 extensions just also allows to use GL_TEXTUREn_ARB as sources in regular combine, and has that special combine4 mode,which you dont need.

  
// texunit 0
vidSelectTexture(GL_TEXTURE0_ARB);
// bind whatever texture here
vidBindTexture(blubb);
// we do lerp(tex0,tex1,vertex.alpha)
vidTexEnvf	(  GL_COMBINE );			
vidComb_COMB_RGB	( GL_INTERPOLATE );	
vidComb_SRC_RGB		(0 , GL_TEXTURE1_ARB );
vidComb_OP_RGB		(0 , GL_SRC_COLOR );
vidComb_SRC_RGB		(1 , GL_TEXTURE);	
vidComb_OP_RGB		(1 , GL_SRC_COLOR );
vidComb_SRC_RGB		(2 , GL_PRIMARY_COLOR );	
vidComb_OP_RGB		(2 , GL_SRC_ALPHA );		


// texunit 1
vidSelectTexture(GL_TEXTURE1_ARB);
// bind the other texture here
vidBindTexture(blah);
// the combiner is set to just modulate with vertex.color as that contains the lighting
// we do modulate(previous,vertex.color)
vidTexEnvf	(  GL_COMBINE );				
vidComb_COMB_RGB	(GL_MODULATE );			
vidComb_SRC_RGB		(0 , GL_PREVIOUS );		
vidComb_OP_RGB		(0, GL_SRC_COLOR);
vidComb_SRC_RGB		(1 , GL_PRIMARY_COLOR );
vidComb_OP_RGB		(1, GL_SRC_COLOR);

// the total thing
// lerp(tex0,tex1,vertex.alpha)*(vertex.color)

dletozeun,

the information you need has already been presented very clearly in this thread, you need to read it carefully and apply the techniques presented.

If you want advice on multitexture basics I suggest you start another thread in the beginners forum, I’m closing this thread.

Please don’t be discouraged, you’re close and already have a pretty decent screenshot. You need to slightly modify that code to use different units as explained earlier.

P.S. don’t get distracted by the vid*() code crazybutcher just posted, dunno why he did that it’s probably some framework/wrapper he’s used to using, it isn’t OpenGL, but it’s clearly similar in structure. Read his code and deduce what the equivalent OpenGL texture environment call parameters should be, it’s pretty easy.