View Full Version : Fixed Function Multitexturing (Warcraft 3 like)

04-09-2010, 06:53 AM
Hello OpenGL community,

first off, I'd like to say that I try to implement this W3 like multitexturing with OGRE. The reason for posting my issue here is that I didn't succeed in doing it and I still try to understand the reason. So I investigated Ogre and looked into its OpenGL Rendersystem. There is a part where they use multiple function calls of "glTexEnvi" with certain parameters. I am sure that these parameters are the key to my problem, so here we go:

Imagine a simple quad. This quad is using four uv texture coordinate sets. Four uv sets because it shall use four textures. Each texture contains alpha and colour information and I want to blend them in the following way:

newState = previousState * (1-A) + (polygonColour * currentTexture * A)

Where A is the alpha information (opacity) of the texture of the current state and I hope the other variables are self explanatory.

W3 texturing illustration:
http://img32.imageshack.us/img32/3321/illustration.th.png (http://img32.imageshack.us/img32/3321/illustration.png)

The reason why I am sure that this is possible is that Blizzard succeeded in implementing such a multitexturing approach in some way (the evidence (http://img153.imageshack.us/img153/7877/w3multitexturing.png)). They didn't use (programmable) shaders and the video cards the game supports got four texture units at their maximum.

So now my question is: Which parameters do I have to use for glTexEnvi to get these results? Or do I have to do something else too?


BTW: If you want to see the original thread of the OGRE forums, please look here: Ogre Multitexturing Problem (http://www.ogre3d.org/forums/viewtopic.php?f=2&t=56885)

04-09-2010, 12:38 PM
@moderatos: Is this an advanced topic? Should I (or you) move it to the "OpenGL coding: advanced" forum?