Libre-TrainSim icon indicating copy to clipboard operation
Libre-TrainSim copied to clipboard

Better Plants

Open Jean28518 opened this issue 4 years ago • 6 comments

Wee need better looking trees and bushes! With efficient LOD-System

Jean28518 avatar Sep 24 '21 21:09 Jean28518

For grass and bushes, some of these might be useful: https://opengameart.org/users/yughues Sadly no tree models, but he has textures for trees. All of his work is CC0 licensed.

For LOD system, I guess we could do put all nodes that should have an LOD in a group, then every second or so loop over all of them and select the LOD according to distance to the active Camera? This could be done on a background thread too.

DasCapschen avatar Sep 25 '21 13:09 DasCapschen

Nice idea with background thread! Thanks for material. Mhm, I am thinking about a LOD-Multimesh system:

  • root node with all Configuration Settings
    • multimesh for LOD 0
    • multimesh for LOD 1
    • multimesh for LOD 2

This LOD-Multimesh should cointain all same objects of the complete chunk. -> Later with landscape editor with brush for Trees, Grass & Co this could be useful for us

Then the multimesh could save positions itself, or get positions by the trackobjects at runtime. That should save diskspace.

Jean28518 avatar Sep 25 '21 13:09 Jean28518

Using multimeshes is a good idea. So I guess what you would do, instead of swapping out the LOD0 mesh with the LOD1 mesh, you would instead change the transform of the multimesh instances? That's quite clever. I think then it would be best to save all possible mesh locations in the TrackObject, and then assign them to the necessary LOD-Multimesh at runtime.

Though I guess we would still have to figure out the distance from the player for each of these transforms, so we can select the appropriate LOD. But I guess if that runs in a background thread, it shouldn't be much of a problem :)

DasCapschen avatar Sep 25 '21 13:09 DasCapschen

I suggest use this: https://www.youtube.com/watch?v=4YhwXGbbabg This should be much cheaper for PC, but looks awesome. How it works: It create photos in different angles. Then put this photos to created mesh. So draw calls much cheaper, but in different angles looks like real 3d model.

bodamat avatar Sep 27 '21 13:09 bodamat

Yes, this would be a good way to create LODs for further away trees. Good idea 👍🏻 :)

Also, in the LOD system, we should introduce an LOD bias (view distance) that can be changed from the settings, so users with weak hardware can lower the settings and get better fps by showing the lower quality LOD closer to the camera, or even skip LOD0.

DasCapschen avatar Sep 27 '21 19:09 DasCapschen

Just leaving this here... https://github.com/Zylann/godot_tree_generator_plugin :eyes:

DasCapschen avatar Nov 14 '21 15:11 DasCapschen