Depends which terrain you have in mind. If you refering to Terrain included in Xith3d then I cannot help you I guess only Dave would have something to say about that since he is author of it. But I can tell you how I did it in my app. I do use similar (even though) simplified hack at it. I use qudtree as well to get geometry, then I copythat geometry into smaller patches(tiles) and only then I start applaying textures. Each tile ends up being one shape3d object. Example you saw here put everything into one shape3d object and I assume that is just done to create demo - i dont see any way how one could do good looking texturing but placing one huge texture on the top of it. Unless texture - or subpart is recreated every frame. That is just wild guess, maybe there is a intelligent way of doing that. Basically I am saying you most likely will have to twist demo a bit to get to point where you can start thinking of putting textures on it.

I'm really looking to just place textures on the whole thing or better still have three different textures depending on the height, a bit like the results of terrain generators mojo created in his jME 0.1 that allowed you to do this.

The Terrain system is a terrain geometry system. The demo just demonstrates how to use that in the simplest possible scheme.

The way Magicosm uses this is as follows:

We create a logical quadtree which has as its smallest quad 100x100, which each subsequent level being doubled. We have a table which describes the minimum distance from a sphere surrounding the user that any particular level can be visible.

We preprocess a set of blending masks 64x64 for each level 0 quad and calculate, using those masks merged texture maps for the other levels. The level 0 masks and the level 1+ textures are stored in a file.

Every 10 meters of movement in the world we step through the quads and see if any quads need to be added or removed. This builds a transaction which adds or removes QuadNodes. A quad node is a branchgroup that has either a single shape + texture + detail, or a level 0 shape, which is an ordered group of SplatShapes. Splat shapes use COMBINE mode to combine the mask and the texture and then merge it with the underlying texture. There can be any number of splat shapes on one tile.

Each quad node needs geometry, but the geometry is being stored in a Terrain node and updated frequently. What we do is when we call Terrain.render we pass it a callback. This callback is called with chunks of geometry. We sort this geometry into buckets and assign them to the appropriate QuadNode. If a triangle spans two QuadNodes we split the triangle using a triangle splitter. Thus each quad node has access to its geometry all the time and can still texture its piece itself.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org