Advertisement

Terrain without tilesets?

Started by January 26, 2002 03:51 PM
11 comments, last by Eber Kain 23 years ago
Ive had some ideas on how i could render terrain without makeing tilesets for the various textures, has anyone already done something like this, and if so where might i look? When he''s best, he''s little worst than a man, When he''s worst, he''s little better than a beast.
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
Yes...

The best way to do that (I think) is using heightmaps... they give you a really detailed terrain without using too much power and they do not require hours of mapmaking, a greyscale image is enough...

Check the tutorial about it on http://nehe.gamedev.net

Once you''ve mastered it it shouldn''t be too hard to add textures and use dynamic vertex coloring for better effects...
Advertisement
A height map is just used for createing the actuall geometry of the terrain, I suppose you could use it as a texture also, but it would be pitifully low res.

Im talking more about the actuall textures, like if you want to make a map that has a sandy part, and a grass part, then you have to make transition tiles for the textures to meld the 2 togather.

My idea will let me do this without those transition tiles, and I was curious if anyone had already done this.

When he''s best, he''s little worst than a man,
When he''s worst, he''s little better than a beast.
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
Why dont you tell us what your idea is?

mine was to use a mask to blend 2 tiles together for example water and sand, you create a mask simulating the borderline, and then cut out the black part of the mask from the water tile and the white from the sand, then you put the chuncks together like a puzzle, and voila! you have your transition.



Edited by - kwizatz on January 27, 2002 4:25:12 PM
My thought was to render multiple polys per tile of ground with blending, and setting the alpha values of the polys vertices to match a smooth blend.

Example :
assume 3 tiles, left is sand, right is grass, and middle is transition.

the sides would be drawn normally, but the center would be drawn twice.

once with the sand texture bound, full alpha values on the left, polys, and zero on the right.

and again with the grass texture bound, full alpha on the right zero on the left.

When he''s best, he''s little worst than a man,
When he''s worst, he''s little better than a beast.
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
ok, I am just starting to get into 3d, so I might be wrong.

you will be using more triangles than you actually need, (1 quad = 4 vertices, 3 quads = 12 vertices), remember you have to keep your triangle count as low as you can.

alpha blending the 3 textures in memory before asigning them to a quad might work better in my opinion, so you stay at 1 quad per tile and preprocessing the 3 textures, helps you cos you dont have to repeat the process for the other identical transitions.

just my $0.2

Advertisement
just my 0.2€

to kwitatz: your technique needs to pre-compute the texture. if eber kain only has to draw this blended texture for a few polygons, he would lose lots of memory for minimal speed increase (and maybe loss of performance if texture is too high).

to eber kain: your technique needs to draw the same polygon twice. You have to take care of the overlapping parts, so that the depth buffer doesn''t flicker. You''ll need either to have cookie-cutter textures (alpha is either full or empty, never 50%) or you''ll need to use techniques like polygon offsetting. Polygon offsetting is quite embarrassing because you may need it for other purposes on your tiles (decals, for example) and it is a mess to combine polygon offsets.

That was just my £0.2
useing the alpha values on the vertices as i said works, I had a working test version a few weeks ago, and it didnt have and zbuffer problems. Its just the right blending mode and i think i had gldepthmask disabled.

I know that it may have some slowdown redrawing the same polys, but I think its an acceptable problem for the benifit, and with the new wave of video cards i think we can spare the polys.

When he''s best, he''s little worst than a man,
When he''s worst, he''s little better than a beast.
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
You don''t have to use multiple passes over same tile. Just use multitexturing.

There are more worlds than the one that you hold in your hand...
You should never let your fears become the boundaries of your dreams.
> Its just the right blending mode and i think i had gldepthmask disabled.

So, your polygon do not write in the depth buffer.
If some polygons have to be drawn behind those "super-blended" polygons, depth testing will pass and you''ll see through...
not such a good feature, unless you are sure that those "super-blended" polygons are drawn at last.
Well, even in that case it''s not such a good idea if you can have multiple "super-blended" polygons...
Sorry for minding you depth testing algorithm, but I just think you might take a look at polygon offsetting.
I think that other ppl here agree with me.

> You don''t have to use multiple passes over same tile. Just use multitexturing.
Yes that''s a very good idea.
Texture units have to be used wisely in that case, but if there''s no lightmap and no bump, then that''s definately the solution I would suggest.

This topic is closed to new replies.

Advertisement