View Full Version : warcraft 3/multitexturing quesiton

09-15-2002, 04:11 PM
in the warcraft 3 engine, the terrain is broken up into tiles. these tiles are square and are textured. here is where the question comes in. in the game's map editor, it is possible for one tile to have FOUR different textures...for example, one corner is grass, one corner rock, one corner dirt, one corner dark grass. usually the "base" texture is dirt, and the grass/rock textures are textures with alpha channels. my first thought was that this was done via multitexturing...but with four textures on one tile, this would not be viable for older video cards. so my question is, how is the texturing done in warcraft 3?

09-15-2002, 04:39 PM
There are two basic ways:

1) multi-pass
2) generate unique textures per tile

For help on 1), look up glEnable(GL_BLEND) and glBlendFunc(...).

Multi-passing is a time-honored tradition. I think even Quake 1 did it...

09-15-2002, 07:05 PM
this is also possible with multitexture though of course earlier cards will handle less textures at a time

forgot to add u will need to use a more powerfuil texture combining method eg tex_combine_arb (

[This message has been edited by zed (edited 09-15-2002).]

09-15-2002, 10:23 PM
You could store all the possible graphic quads in a single texture, and use sub-part of it as the texture for your quads. You would end up with more vertexes, but only one pass. Should be faster.

09-16-2002, 02:14 AM
It's very interesting all your opinion, but I would like to know what exactly means "MultiPass".
That means the tile is drawn with the 1st texture, then a second processing drawn again the 2nd texture with blending?? etc...?
The tile is computed several time per frame?

I would like to know what is the "MultiPass" process.
Thx http://www.opengl.org/discussion_boards/ubb/biggrin.gif

09-16-2002, 03:29 AM
I don't think there's any multipass going on, I think they just use unique tile textures just like in the good old 2d days. Since there only are a limited number of transition patterns available I really don't see the point in using multi pass. If you want high detail texture transitions on hardware with few tex units, use splatting.

09-16-2002, 03:46 AM
Each time you render your scene, or even part of the scene, this is a pass. So like for example, lets say you want to apply a lightmap to a surface that has some texture. Well first you draw the surface with its base texture, beit bricks, rocks, whatever, and then you enable blending, set the blending mode and render the surface AGAIN with the lightmap set as the active texture. Now this operation was _two_ passes. Of course before the second pass you will have needed to enable the correct blending mode which is to multiply the second pass with whats already in the framebuffer (stuff from the first pass). I dont have my RedBook with me but I _think_ the blending mode for this would be GL_DST_COLOR, GL_ZERO. I hope that helps in understanding what multipass rendering means. It can sometimes get pretty tricky getting it to work correctly if you havn't been doing it for a while. I still have trouble sometimes. http://www.opengl.org/discussion_boards/ubb/biggrin.gif


[This message has been edited by SirKnight (edited 09-16-2002).]

09-16-2002, 08:15 PM
harsman: Splatting is a multi-pass technique. In fact, pretty extremely multi-pass.

zed: Agreed that you should combine as many passes as possible into texture stages, and thus only need ceil( N/M ) actual passes where N == total layers, and M == available texture units.

antorian: Anytime you glEnable( GL_BLEND ) and draw "the same" geometry again, you're doing multi-pass rendering.

09-17-2002, 02:05 AM
Jwatte, I know splatting is multipass (depending on the amount of texunits and groundtextures you have of course). It was just a suggestion for a good way to get nice terrain texturing. I don't think Warcraft III uses splatting, I think it uses unique tile textures with pre defined transition patterns. However, if you don't want that and want higher quality, I think splatting is a reasonable muli pass approach.

09-17-2002, 02:12 AM
Thanks all http://www.opengl.org/discussion_boards/ubb/smile.gif

Just another point:
When you're doing multi-pass rendering with tiles, must you compute vertices for each pass or only for the first (if the land doesn't move)??
Are the Draw List useful for that?

ThX http://www.opengl.org/discussion_boards/ubb/biggrin.gif

09-17-2002, 02:28 AM
If you are drawing the same geometry again, there shouldn't be any need for *you* to recompute a vertex yourself (if you've stored them
somewhere, of course).
However, the graphics card might have to go through transformation and lighting.
You could use the compiled vertex arrays extension which might help out there as the graphics card can see you aren't changing the geometry each time.
Only use display lists if you want zero flexibility with whatever you are drawing - i.e. you know you'll always draw it that way all the time.
Of course, that could be useful if you put each tile in a single display list and called the list for each individual tile, but since you'd only be pushing a few vertices around it might be quite inefficient in those terms.