Sign in to follow this  
riruilo

Where can I find a tutorial about combiners and multitexturing?

Recommended Posts

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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
GLSL is part of GL 2.0
Cg is some outside library. Not sure why anyone would use it these days.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
"GLSL is probably not going anywhere"...

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

I think so.
Thanks a lot.

Share this post


Link to post
Share on other sites
@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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this