Time to make my TerrainGrid

Thanks to the amazing work on TerrainGrid lately I am really keen to start work on my game world while I have holidays…

One thing I am not sure of though is how to make the terrain meet the ocean and sky seamlessly at the edges.



What I am thinking is, I would need the tile near the ocean to have a beach, with the land sliding down below sea level, and then at the edges of the map the land should be so far below the sea that it can’t be seen… then I need further terrain tiles in the terrain grid which just have a low ocean floor so appear as entirely sea. Does that sound the right way of doing it?



Is it possible to “reuse” tiles in the grid so that I can have one ocean tile that is used multiple times?



Even better, is it possible to say have a 100x100 grid and there is a 10x10 area with island 1, another 10x10 area with island 2 inside it… all other tiles will be the “same” water tile repeated?



Also, do you have any tips/ideas how to do “distance fog” and fading in the distance? The current jme fog effect seems to be more for making the whole scene foggy rather than just distant objects, although maybe its just a settings tweak?

@monkeychops said:
What I am thinking is, I would need the tile near the ocean to have a beach, with the land sliding down below sea level, and then at the edges of the map the land should be so far below the sea that it can't be seen... then I need further terrain tiles in the terrain grid which just have a low ocean floor so appear as entirely sea. Does that sound the right way of doing it?

Just have continuous terrain, and where there should be water, lower it down below sea level. (usually Y=0) The post water filter will hide deep ocean floor automatically for you.

@monkeychops said:
Is it possible to "reuse" tiles in the grid so that I can have one ocean tile that is used multiple times?

Even better, is it possible to say have a 100x100 grid and there is a 10x10 area with island 1, another 10x10 area with island 2 inside it... all other tiles will be the "same" water tile repeated?

Water isn't a tile. it is a post filter on the scene. It does this without a specific water geometry placed in the scene. So just have your terrain as you normally would and apply the post water filter to it, even for a 100x100 grid.

@monkeychops said:
Also, do you have any tips/ideas how to do "distance fog" and fading in the distance? The current jme fog effect seems to be more for making the whole scene foggy rather than just distant objects, although maybe its just a settings tweak?

There's some tricks to fog, and with skyboxes. I can't remember the ideal solution off the top of my head, but it has come up in the forums several times before so a search might reveal something.

Thanks @Sploreg :slight_smile:

Is it possible to scale the terraingrid tiles? I found scaling the single terrain tiles 10x wider allowed bigger terrain and better performance without any noticable loss in quality… but scaling terraingrid tiles doesn’t seem to do anything…



Also, how do we make it load further ahead? Right now it doesnt seem to draw the tile until we’re almost on top of it…

terrain.setLocalScale(8f, 1f, 8f);

Just like you would any other spatial.



You can only load 4 of the root tiles at once. To increase the view distance you need to modify the terrain scale, or make the tile sizes larger. But there can only be the 4.

Weird, I’d tried that, but I tried again and it works! That’s really cool… by making the tiles much bigger its far less obvious when they pop in and out.



Only problem I have now is editing… first because the editor doesn’t support the grid yet, but also when editing a single tile the editor doesn’t seem to like huge tiles either because the far clipping on the camera won’t show the terrain.

Is there any reason why the editor doesn’t create the tiles scaled 10x bigger in the first place? The default size seems too tiny for any practical game use and is more detailed than it needs to be - stretching it 10x bigger works for me. As you said, setting the alpha mapping still allows a detailed texture and it looks perfectly smooth enough…

Everyone’s game is different so the terrain is set at a default size. To change the scale just select the root TerrainQuad and change the scale on the right hand panel where all the other Spatial settings are.

Thanks @Sploreq :slight_smile:

I have a really nice sized terrain now using the demo tiles, but I’m having trouble making my own…

The terraingrid doesnt seem to like it if I create a j3o scene and add a terrain to it… do the terrain sections need to be made differently to just a normal scene or am I doing something wrong again? :slight_smile:

Also, if I scale the tile up in the editor as you say, it does work, but then the far clip of the camera in the editor seems to cut off much of the terrain I am editing and as expected the terraforming tools are too weak to do much… would be good if they scaled too?

Terrain grid doesn’t care what else is in the scene. Just like all scene graph objects. The TerrainGrid examples show you how you can create terrain from heightmaps or using noise routines.



The tools do scale. Use the radius slider. Of course if your terrain is gigantic, the tool won’t cover the whole terrain. But it would not be of much use if it did then anyways. The current terraforming tools will do most of what you need, you just need to use them a bit. There is no “make terrain beautiful” button, it takes time and detail.