Terrain detail placement and LOD system

Hello all. I have started looking into what is available in JME for terrain details (placing trees, shrubs, grasses, rocks/boulders etc) and I have not found what I was hoping for. Is there anything already in the engine or community project for this?

If not, I will likely be creating my own system for placing these details with a brush type interface, or generating them based on criteria (such as terrain height, slope, heat map, terrain stamp, etc etc). I think I would also need to develop a system to for LOD which I see is already available for terrain and model assets. Does the current LOD system support billboards (Textured quads)? I am wondering if this is something the community would find useful, or if I am completely missing something that is already available?

I’ve written some that do this:

Position Plotters: https://jmonkeystore.com/39b754f7-b919-4996-9cd8-e1a9db9e05d7
Procedual world demo: https://jmonkeystore.com/994b4082-8191-4622-9c44-ffc49c31a67d

1 Like

Well, i seen there are “Grass Libs”/“plotter libs”. But each of them is “unique” solution.

Myself i created own way to place “grass” based on texture in terrain, and split for geometry chunks/etc. (well it took days, but can do everrything ;))

I based it on GrassArea library solution as i remember.

(old video, now it looks much better)

But there are other libs like the one Jayfella created.

Each of libs have advantage and disadvantage, so depends what you need.

About Trees/Big Rocks/Bushes i think you should use ECS(for example JME Zay-ES lib) that would allow interactions.

If not, I will likely be creating my own system for placing these details with a brush type interface, or generating them based on criteria (such as terrain height, slope, heat map, terrain stamp, etc etc).

You can, same as i did myself. Just need time and some knowledge. I never thought about “slope” making something, i only use it to “little slope grass” but anyway grass should always look “up” and be affected by just wind.

As i understand you would like have lib so user decide:

  • since what terrain height grass/trees/flowers/etc exist
  • slope angle where should be no tress/etc.
  • heat map -? idk - you mean type of trees in areas?
  • terrain stamp - i dont know what you want use it for?

But you will not find ALL of this in one library that exist, at least i dont know any.

But again, you can use ready solutions and extend to have own criteria apply in it.

I can also tell you that “creating seamless grass” looks nice, this idea was suggested me on Discord and i apply it and look it looks nice(no much visible seam between grass bottom and terrain). I just copy terrain color into bottom of grass, you might be interested to do it as well, here video:

Also about Terrain itself, Thanks to Riccardo, there is Parallax version. If you will not find on JME Store(because i belive someone put it there), then here was shader i initially prepared for PBRTerrain shader.

1 Like

Thanks @jayfella! Plotter looks like a good start!

@oxplay2 Your videos look pretty good. I agree, it seems like there are a lot of different libraries out there, so it is a matter of either stringing together what I need from existing projects, or creating something new. I would like to be able to load/save whatever gets generated by my tool so that is another part of it.

I have done this in some other projects in Unity, but always end up with something too specific for the actual implementation. You are correct that I would need collisions on trees and rocks, so this is another consideration.

For heat map, it would be something like specifying rules like density of placement, what gets placed/not placed. Heat map would be more for density than anything else.

Stamp idea would we for maps that have areas where there is defined structure, like a clear cut wooded area, like what happens in land development. A good example would be an apocalyptic city scape where remnants of parks and wooded areas were once controlled. I would need finer grain control of where things get placed and a stamp would work better for that case.

Anyway, all this gives me a lot to think about :grinning:

1 Like

I would like to be able to load/save whatever gets generated by my tool so that is another part of it.

Objects like trees i have in ECS, so i just Save “entites” into file.
About terrain grass i save “painted texture on terrain”

You are correct that I would need collisions on trees and rocks, so this is another consideration.

I dont mean it, you can have collisions without ECS too.

mostly mean “chop tree ECS action component”.

For heat map, it would be something like specifying rules like density of placement, what gets placed/not placed. Heat map would be more for density than anything else.

Good idea,

will just tell you how i have this done, i have:
density/height of grass depends "how much texture is painted there(0-255)"

but heat map is more universal, so you are right.

Stamp idea would we for maps that have areas where there is defined structure, like a clear cut wooded area, like what happens in land development. A good example would be an apocalyptic city scape where remnants of parks and wooded areas were once controlled. I would need finer grain control of where things get placed and a stamp would work better for that case.

Im not sure if i understand correctly, but you just mean Biomes, like city biome, forest biome, jungle bione, desert bione, etc? where some elements like “cactus” randomly appear?

For example in desert, tree would be “palm” instead default tree, or like you said in clear cut wooded area, will be cut trees(replacing default trees)

Then it is good idea, i have same idea, but i want solve it using ECS, not plotter/placement grass system. Most of things should be in ECS if you want to create bigger project.

So its just my opinion but about Stamp idea you should just use it in ECS(Entity Component System).

Not biomes exactly, but areas where things spawn (or don’t spawn) more predictably. When I say clear cut, I mean a patch of woods that is next to a field. This is seen in farming areas. Stamps can be used to place any predictable set of objects. (for example, in the apocalyptic city example, burned out buildings or patches of cement in a grid, rusted out cars on the part that is road, trees/grass on the part that is between road and buildings). It is similar to splat, but not based on height or heat, but predefined rules. In my other attempt to build something like this, each rule would run and add objects to the would, but would need to observe the rules of each pass as the map is generated.

It is probably hard to see in this pic, but here is a screenshot of diox (the game I am redeveloping in JME from unity). Here I generate parts of a city and other objects from a stamp. (They are all underwater but you can see the tops of a couple buildings :slight_smile:

ok, i think i got what you mean :slight_smile:

hmm, for me it looks more like just “generate random map based on predefined criterias” rather than “generate detail based on predefined criterias”.

While topic is “terrain detail”, so first i thought its just about detail.

burned out buildings are not “detail” for me :innocent:

But now i think i know what you want to achieve.

Screenshot you provided looks nice for an alpha.

Yeah, it is a fine line. In my game there will be a large amount of debris scattered about the landscape, such as concrete and brick walls, old vehicles, etc. While they are not part of landscape in the traditional sense, they are part of the feel of the landscape, and the goal is to make plants and trees appear as though they’ve grown around these feature in a believable way. For diox, it really all ties together, and also a good LOD system will be crucial.

You might alsowant to check out parts of simarboreal, at least on a conceptual level. It runs the gamut from highly detailed mesh, to cluster of primitives, to billboards depending on the distance from the camera.

1 Like

I think they’re called impostors when used in a LOD system. You might yield more results using that keyword.

I started working on a terrain editor/generator but I hit a snag trying to use the MeshPlotter example. Terrains have Triangle strip vertices but looks like Triange strip is not supported in position plotters? Is there a work around or will I need to recreated the vertices as triangles?