Where can I find a tutorial about combiners and multitexturing?

Started by
7 comments, last by kRogue 16 years, 11 months ago
Hi! That´s my question. Where can I find a tutorial about combiners and multitexturing? I can see a lot of code about but where a good tutorial about how to use this: glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, constColor); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT); glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_INTERPOLATE_EXT); glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_PREVIOUS_EXT); glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR); glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_TEXTURE); glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_ONE_MINUS_SRC_COLOR); glTexEnvf(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_CONSTANT_EXT); glTexEnvf(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_ALPHA); Thanks a lot!
I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time, like tears in rain. Time to die.
Advertisement
check nvidia's developer page. I would use GLSL if you can, combiners are dead.
Quote:Original post by MARS_999
check nvidia's developer page. I would use GLSL if you can, combiners are dead.

..and if you can't use GLSL, use Cg. It's not bad, actually.
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
Ok. Thanks a lot.

What do you recommend me, GLSL or Cg?

See you.
I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time, like tears in rain. Time to die.
GLSL is part of GL 2.0
Cg is some outside library. Not sure why anyone would use it these days.
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhLoadIdentityf2(matrix);
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhRotateAboutXf2(matrix, angleInRadians);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);
My vote is for GLSL. GLSL is probably not going anywhere, since it's GL's main shader language now that fragment/vertex programs are not updated anymore...
"GLSL is probably not going anywhere"...

Do you mean "Cg is probably not going anywhere"?

I think so.
Thanks a lot.

I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time, like tears in rain. Time to die.
@riruilo: I think MARS_999 means that GLSL will be a part of OpenGL now and in the future.

@V-man: Quite a few reasons to use Cg.
1) If you want to target hardware that doesn't support OpenGL 2.0,
2) If you're coding in graphics for the PS3,
3) If you want to use CgFX files (and SAS scripting),
4) If you want to easily share GPU programs between OpenGL and Direct3D

If you've got a card that supports OpenGL 2.0, use GLSL. Otherwise, choose Cg.
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
As to use Cg or not, it depends who you are talking to, bad parts of Cg:

1) mostly nVidia only, this is not exactly true, but the Cg stuff for non nVidia hardware is not well optimised and at best is just a wrapper.

2) you need to use a specific profile to get acces to the OpenGL state, and once you do that then your shader is OpenGL and Cg only.

good parts of Cg:
1) shaders will be the same code if you use D3D or OpenGL, but the majority of the code one writes iin not the shaders, so in my eyes this is not really a big deal, also converting Cg-->GLSL by hand is not very hard (and nVidia's Cg compiler can be made to output GLSL *I think* ) the API of Cg is different if you are using OpenGL or D3D anyways...

2) CgFX, though I never got into that...

3) lower end requirements, but only on nVidia hardware, but asking for a GeForce FX or ATI equivalent is not asking much nowaways.... and once you are asking for that, then GLSL is available on that hardware anyways.


to make a confession, when I started doing shaders, it was with Cg, but then I moved onto GLSL, and I ahve not used Cg for a very, very long time now.
Close this Gamedev account, I have outgrown Gamedev.

This topic is closed to new replies.

Advertisement