Terrain with own texture per tile

If you would like to have a terrain where each tile has got an own texture, then I suppose you have to use an own Shape3D for each tile?
So it’s different to Xith’s Terrain demo (using Xith’s terrain package), which isn’t textured, and Mike’s addition to this demo to use one texture for all tiles…?

So in case you use a bunch of Shape3Ds then: is there anything to take care of compared to normal loaded 3d models having Shape3Ds…?
For example: how many of these tile Shape3Ds do you put in one (Transform) Group? All of them, or a “screen full” of them? :slight_smile:

You really wouldn’t want to do it as simplistic as that. You’ll get quite a speed penanlty.

You need to use an algorithm that groups tiles that have the same texture and are in a defined proximity to each other into one Shape3D and then segment your terrain into localised areas within TransformGroups and/or BranchGroups.

Kev

You can also make a texture which spans several tiles, and use image manipulation to create the big texture from all of the tile textures. Then use one Shape3D to represent several contiguous tiles, as KevGlass suggests.

You will get a speed increase, but there will be some memory penalty. Also, this approach works best if you can combine the images at compile or load time, and not at run time.

This also gives you the option of doing some additional image tweaking to create “transitions” between the tiles so that the boundaries are not as obvious.

The reason I’m asking is the following: the terrain will change its “material nature” at run-time. With material I don’t mean Xith material, but terrain material for each tile, for example gras, rock, sump, etc. With run-time I mean it changes because of user-input or weather simulation or such. So time-consuming scans to group similar tiles will hurt.

Say the terrain matrix will hold nodes which specify the material for four corners of four tiles being around the node. Since a sharp cut from gras to sump for example won’t look nice, I’ll have to use some kind of multi-texturing to blend the different materials. (I’m not sure how exactly to do this but let’s see.)

Grouping the tiles with same texture and multi-texture surely is a good idea.
Still I think I’ll end with many Shape3Ds which have non-groupable textures.