spimort / TerraBrush

MIT License
698 stars 27 forks source link

Floating objects #67

Closed HungryCatGames closed 3 months ago

HungryCatGames commented 6 months ago

Added a scene as an object (scene is a tree, trunk, leaves, shader for movement, etc). Brushed on a bunch of objects and pretty much instant forest which looks great from a distance. Up close and many trees are floating anywhere from partially grounded to up to a foot or two off the ground. Either the algorithm for placement needs tweaking or the ability to tweak individual object placement.

spimort commented 6 months ago

@HungryCatGames Sounds good, I'll check what can be done for this!

spimort commented 6 months ago

Hey @HungryCatGames , I tried to reproduce it on my side but I had a hard time, all my objects were touching the ground. Would you be able to provide a simple project that show this situation?

Feel free to replace any assets with simple mesh instance if you cannot share yours, as long as I can reproduce the situation.

Also, can you confirm that all of your objects were starting at the position 0, 0, 0? I place objects from the 0 point.

HungryCatGames commented 6 months ago

On relatively level ground the trees are rooted just fine. It's on modest to steep slopes that they become very visibly not rooted. Floating, in some cases, many "feet" off the ground, yet others seem to be rooted just fine. Too big to attach, here is a link to it. https://youtu.be/mbxrEr_01cE

spimort commented 5 months ago

Hey @HungryCatGames ! Sorry for the delay, I've been pretty busy.

Calculating the exact height of the terrain for the object is pretty hard because we are not in the shader at this point.

I was thinking tho, can't you just make your trees go a little bit on the ground in the packed scenes so you never have floating trees?

spimort commented 3 months ago

I'll close the issue for now, feel free to Reopen it if you think it's still relevant 🙂