iDevGames Forums
3D Landcape multi-texturing approach - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: 3D Landcape multi-texturing approach (/thread-9946.html)



3D Landcape multi-texturing approach - wonza - Mar 21, 2012 11:25 AM

Hi,

It's been a while since I've posted here, had a busy couple of years Smile but I'm wanting to get back into making a game.

I'm wanting to create a 3D landscape. So far I've created a heightmap and generated a mesh with normals and got a basic texture. I really need to make it look nicer though, and I think I need to do multitexturing but I need to know what the best approach would be.

For example, do I break down the landscape into smaller tiles and apply a different texture to each area? Or just overlay several large textures to the whole landscape and blend them together. Or apply single textures to different areas, eg, rock areas, snow, sand etc. I'm really not sure on the best approach.

Any help is greatly appreciated! Smile


RE: 3D Landcape multi-texturing approach - wonza - Apr 17, 2012 09:26 AM

I've spent a fair amount of time trying to figure this out and so far I think I have come up with a decent solution. What I did was to pass in to the shader 7 textures of different landscape types. Then I passed in an 8th texture which contains a sort of lookup as to which texture to show. This 8th texture is generated at runtime and the green channel dictates which of the 7 textures to use at the matching coords, the blue channel I'm using as the alpha at each point.

One of my 7 textures I'm using as a 'base' texture, and I'm mixing between the others based on the alpha channel.

Hope this makes sense, and I'm happy to show any code / screenshots if requested.

Thanks Smile