Warcraft 3 landscape texturing....


well, may be someone has an idea about this :
i’m sure you’ve already seen some warcraft 3 pictures . How the hell the texture is performed ?? huge textures ?? small textures blended with alpha tiles set ?? multitexturing (sure :slight_smile: )?? something else ??

How would you handle this kind of landscape texturing ??

I don’t know, but on the site you pointed out, I read:

“WarCraft III will be compatible with Direct3D and Glide 3D APIs. Direct 3D was chosen over OpenGL for superior features of hardware transformation and lighting skinned models.”


So they don’t use OpenGL… That being said, I am sure some people here will have ideas on how to reproduce the effect you describe !



OpenGL or Direct3D, the way to go is still the same. I have no clue what so ever what they do, but to get similar effects, you can use multitexturing with greyscale masks, along with multipass rendering. It’s not that difficult once you understand. Detail textures is/can be used to get the effect of very high-resolution textures when you are close to the specific geometry being textured.

I have some code at home that does multipass rendering, with multitexturing using the textures along with a greyscale mask. Tell me if you want some code. Just some pieces ready to cut-n-paste, no working program source. And no detail textruing.

from Bobyou can use multitexturing with greyscale masks, along with multipass rendering

Yeah, it’s seems to be the obvious thing to do…
Lately i was implementing my multitex code. I was thinking that each texture level had his own blending and i finally understood that it was not the case :frowning: (or may be i did something wrong…) So multipass seems to be the right thing to do, but this may cost a lot for landscape rendering…

First time I did this in my landscape engine, I drew the whole landscape (well, only the visible stuff) twice, once for each texture (I had two textures along with a greyscale mask). And I was amazed that the performace hit was as small as it really was when drawing the landscape twice instead of only one time. I was expecting nearly halved framerate. Now I don’t remember the numbers, but it wasn’t as much as 50% (on a TNT by the way).

I improved this by making simple checks to make sure I’m not drawing loads of areas twice, when only one texture is visible.

If you got some sort of height-based, or similar, method to determine what textures to draw, you can check the primitives height, and then only draw the textures that is visible on the given height.

If using height-based, or anything else, you can make it so that any given primitive in the landscape is never affected by more than two textures. Then you can easily setup a blending function to perform C=(T1G)+(T2(1-G)), and then draw the primitive. C is the resulting texture color, T1 and T2 is your two textures, and G is the greyscale mask. G can be a 1D textur if you like.

Anyways, just a few tips. This is at least how I managed to perform multipass multitexturing without much performance hit compared to one repeated texture and one pass.

[This message has been edited by Bob (edited 01-08-2001).]

I’m still laughing about your:
It’s not difficult once you understand.

Bob, that remembers me of some teachers… Well, don’t get me serious today, sorry.

Hehe, no worries, I know it sounds silly.

But in this case, I think it’s somewhat true. I have experienced cases where the it’s-not-difficult-once-you-understand-thinge doesn’t apply, and then I’m talking about those nasty Laplace-transformations in the wonderful world of mathematics. I understand them, but I find them IN NO WAY easy to use.

Never mind, just talking some bullsh*t again.

Originally posted by Bob:
[b]those nasty Laplace-[b]

That’s a good example !
I also have Topology (in the mathematical sense) of functions… Hard to understand… Even harder once you understood…



looks pretty simular to what im doing
(though mines better cause “opengl was chosen over d3d for superior features of hardware transformation and lighting skinned models”
heres my site http://members.nbci.com/myBollux
check out the combine extensions demo’s also gotterdammerung is what im working on at the moment. though ive gotta say those screenshots are a bit dated now.

What the hell are you talking about? Laplace?

Originally posted by Bob:
and G is the greyscale mask. G can be a 1D textur if you like.

Bob, can you make it more specific?
Can I set an arbitrary G, without RGBA texture ?
and how can G be 1D texture, while blending two 2D texures?

Is there any way to do this without the extension?

Also I’m not completly understanding how to do this…

Do you render say a grass texture… then render a rock texture on top of the grass with the alpha blending??


Michael: Laplace is about university level mathematics. It was meant as an off topic joke Anyways, you use it to solve differential equations (if thats what they are called in english), those types of equations that are impossible to solve with “pre-university maths”. You transform the equation into simple arithmetics, solve it, and then transform it back. It might sound simple, but the transformation is a pain.

haigu: G is it’s own texture, independent of the two other landscape textures you want to blend. And the two textures CAN contain an alpha channel, but you don’t use it, so generally they are both of RGB format. G can, depending on blend function, be either GL_ALPHA, or GL_LUMINANCE (GL_INTENSITY might work aswell, never tried it though).
And because it is an independend texture, it can be a 1D texture. If you only draw G (as a 1D map) onto the landscape and using a height based ground detail (grass at lower levels, and rocks at higher levels), you can simply map the terrains altitude to the texture coordinate (normalized of course). Sorry abouth this “loose” explanation, but lets just say, for get 1D, and stick to 2D maps.

Mongoose: You can do it without extensions, but it’s not as simple as with IMO. You can solve it with alpha channels and stuff.

To all: Recieved a mail from someone who read this thread, and wanted a piece of code to do this blending. I will write a small tutorial, or just a brief explanation rather, along with some code. Will post a link to the page later, when I have written and uploaded it.

Ok, back now.

A brief explanation can be found at http://www.du.se/~e98msv/opengl/blend.html

I appreciate feedback of any kind, positive and negative. My e-mail adress can be found in my profile page (the small icon with the ‘?’ in it above my post).

Hey, thanx Bob.
Could you give me an example of such type of equations?

Of course there is always a difference between understanding something or being creative.


We work in the digital domain. Z transform
all the way! None of this Laplace sh!t.

An example, huh? Ok, hope this will do. It’s a pretty easy one transform-wise. If you know how to sole it w/o transforms, go ahead, and compare the results.

y is the equation to solve
t is time (because we are talking about physical signals in time)
Y is the same equation, but represented in Laplace-space
s is “time” in Laplace-space

P.S. Blame MS Equation editor for inserting spaces everywhere.

P.P.S. Can’t say Z-transform is that much easier

Thanks Bob! Gonna read it in a bit.

Whoa… I just wanted to keep this thread going!!

I need more info on it!