PDA

View Full Version : Terrain Texture Mapping?



GhostMonkey
04-14-2012, 07:46 AM
Hey, I've been using the tutorial on NeHe for making terrain but I'm having a hard time texturing it. So far, all I can get to work is texturing each individual quad with one texture but I want to have just one big texture or even different textures for different heights. For example higher terrain would be snow, but its a static terrain so one texture would also work. Any help would be great.

aqnuep
04-14-2012, 08:04 AM
Do you use fixed function or you use shaders?

The way how you should do it highly depends on what functionality you use.

Also, how do you assign your texture coordinates to the terrain grid currently?

BionicBytes
04-14-2012, 08:19 AM
The main problem with one large texture is that as the terrain gets larger the more stretched the texture becomes and looks aweful.
Even a terrain grid 1024 * 1024 is too large for a single texture to properly texture the terrain. What you need are tiled textures per tile and texture coordinates per tile and possibly a second set per terrain. That gives you the ability to perform either or both.

GhostMonkey
04-14-2012, 08:19 AM
Its a fixed function, currently I just assign 4 texture co-ords to every new quad that is made and bind a texture when the function is called.