Jump to content
  • Advertisement
Sign in to follow this  
Kris2456

Terrain Textures

This topic is 4778 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i am making a terrain engine, but i am a bit confused how to get the textures to transition smoothly from one to another. what i mean is this: Anyone know how to make something like this? [Edited by - Kris2456 on April 25, 2005 11:18:42 AM]

Share this post


Link to post
Share on other sites
Advertisement
You can use 3D textures to make the different texture-layers blend nicely.

________
/ /
/ //
/_______/----> Using the terrains height as w texture-coordinate
/_______// you can extract an interpolated value from the texture.
/_______/

So all the smoothing is done on the GPU, automatically.

Tutorial (for OpenGL, but also explains the theory)

Share this post


Link to post
Share on other sites
Ill look into the 3D one. The problem is, is that i have about 4 textures, and i want the user to be able to set the height at which each texture is mapped. Im not sure if that would be possible with the splatting technique.

Share this post


Link to post
Share on other sites
Hmm, i want to use tiles, and not one big texture. Ive been doing some searching but i found shiatloads of stuff about "One Big Texture" methods, but barely any for tiles. Splatting could work for this, but i want my user to be able to change the height at which this happens.

I look at something about layers and farcry, but it was really complicated.

Share this post


Link to post
Share on other sites
Problem with 3D textures for terrain layers is that MIP mapping makes a mash out of them in the distance.

Instead, I'd use a texture unit per terrain texture, and one texture unit (or the vertex color) to blend between them. The shader looks something like:


uvtile = vPos.xz / TEXTURE_SCALE;
color = tex2d( rock, uvtile ) * vColor.xxxx +
tex2d( dirt, uvtile*1.1 ) * vColor.yyyy +
tex2d( grass, uvtile*1.3 ) * vColor.zzzz +
tex2d( flowers, uvtile*1.5 ) * vColor.wwww;
... do lighting here ...


You can also derive the texture coordinates (for uvtile) from actual texture coordinates in your mesh, if you don't want a flat, planar UV mapping.

Share this post


Link to post
Share on other sites
Sorry hplus i am not that great at using this stuff. Could you point me to a tut or even article. I dont know much about shaders, if you could help that would be great.

Share this post


Link to post
Share on other sites
Ok, i tried to add two textures normally. But this is what i get:
Free Image Hosting at www.ImageShack.us

I was wondering is there a way, to get these two textures to blend together, to get a smooth transition. I would rather not use some kind of image map, but if it is the onl way, then i wil try and use that. Thanks.

Share this post


Link to post
Share on other sites
A) Use more polygons.

B) To blend two textures, one will need to use multi-texturing, multi-pass rendering or multi-texturing with shaders.
3. The last is already presented to you by hplus. He uses a shader to do multi-texturing WITHOUT the need of multiple texture coördinates.
2. Multi-pass rendering is not a logical solution since it's not necessary for this simple effect, on todays hardware.
1. Multi-texturing without shaders will require you to provide multiple texture coördinates, or configure your graphics API that it uses a single pair for different textures. Please tell us what graphics API you're using so we can give you complete answers.

If this post doesn't make any sense to you, just tell me your graphics API. [bawling]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!