Skip to main content
GameDev.net gamedev.net
🔒 Locked

Smooth Landscape Textures

Started by michiwalter Sep 5, 2000 at 3:09 AM 8 replies 1.1k views
Original Post
michiwalter
michiwalter
Hello Guys, I''ve the following problem: I programmed a landscape renderer based on D3D and a heightmap. Each Landscape Tile has a different texture. Now I want a smooth "going" from for example a grass texture to a stone texture (like water->dust in age of empires II). Can you tell me how to do that? Thanks, Michael Walter
michiwalter
michiwalter
Thank you very much.

But how can I set the alpha value to the maximum at the top and to the minimum at the bottom?

By calling SetRenderState()?

I only know to set the alpha value for the entire blit.

Bye,
Michi
Kallen McInerney
Kallen McInerney
Why not use texture synthesis and do all the hard work beforehand? Then you don''t have to waste band width on multi-texturing or multi-pass. http://ddg.sourceforge.net has a class called ddgEco that will synthesize many textures into one parametricly. It takes a heightmap, textures and elevations limits as input then spits out a brand new texture. So far its based on elevation\slope but with some tweaks you can get it to mix textures at the same elevation. I have a sneaky feeling it does this anyway if you use the randomize flag.

Hope this helps.

Kallen
Knarkles
Knarkles
Or, you could draw the "transition tiles" by hand, if you want to have some variation.

-Jussi
Eric
Eric
For my terrain, I am basically doing what Anon suggests. To achieve the fade he describes, you have to set the alpha value of each vertex''s diffuse color component. Then, you set the texture-stage state alpha-op to "select arg2" (assuming your arg2 is the diffuse).

Two other things: I think Anon is mistaken -- you should first render texture A with 100% alpha across the entire face, then render texture B with a fade from 100% to 0%. Also, I used multi-pass instead of multi-texture; it''s supported better, and there are relatively few polys in my terrain that need to be rendered like this, so the speed loss is minor.
zedzeek
zedzeek
ive been trying to do this for a while and unfortunatly havent been able to,
2 textures.
A == grass , B == rock , blend the two together based on a third greyscale texture that serves as a blending amount modifier, eg like alpha. ive tried various methods of multitexturinbg getting quite close but not perfect. anyone got any answers?

btw the problem with prerendering everything first, is it''ll need a heap of texture memory though of course it''ll be way quicker to render.
Kallen McInerney
Kallen McInerney
>btw the problem with prerendering everything first, is it''ll >need a heap of texture memory though of course it''ll be way >quicker to render.

Well with a little more work you can break a large patches into small tiles and do paging of textures. This way your only loading the unique textures you need. If you go for one large height map with an accompanying large texture then yeh your gonna have problems as its wasteful.



Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.