Тёмный

Procedurally Populating a Large Terrain with 100.000 Trees | Advanced Computer Graphics | 

Code Jar
Подписаться 348
Просмотров 1,3 тыс.
50% 1

I have created a set of algorithms to populate my large-scale smooth voxel terrain in Godot using C#. I define two types of objects, namely features (trees & rocks) and details (grass & flowers), with two distinct methods of generation and rendering.
I also define biomes using noise, which helps add visual variety.
Useful Links:
- Technical Blogpost: jorisar.github...
- Godot: godotengine.org/
- Music (by me): / codejar

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 23   
@chriszymurgist
@chriszymurgist День назад
Great video. At 1:45 you describe sampling the terrain normal to place decorations parallel with the normal, however plants orient themselves to gravity and point up, not sideways. Your features will appear more natural if they point towards world up, not the surface normal.
@Code_Jar
@Code_Jar День назад
While you are correct, aligning with the normal can provide some desired stylized results. I think smaller objects (grass, bushes) look better when aligned with the terrain normal. In my implementation I added a boolean to toggle aligning a particular feature with either the terrain normal or world up. For large objects, such as the tall pine trees, aligning them perfectly vertical looks more natural indeed!
@delphicdescant
@delphicdescant 12 часов назад
@@Code_Jar Imo it's not just the tall pine trees, but *all* the trees, which need to be pointing upward to look normal.
@Code_Jar
@Code_Jar 10 часов назад
@@delphicdescant Fair! I also use the normal to ensure trees don't grow on parts of the terrain that are too steep.
@Qewbicle
@Qewbicle 8 часов назад
I care about exact detail positions. I tried several tools in unity having to do with indirect rendering. It drove me crazy if a moved or rotated, that things were not in the same position. I put effort into my density and seed, placement logic, to curate the "margin" spaces. I wanted a good look, so it doesn't distract. A curated ambience. Some tools had little interference, but conflicted in other ways, others completely changed my curation. Even though I could render and cull by offloading to GPU, limit range, number of instances, optimized meshes and materials. I could not continuously replicate the aesthetics, because it became GPU bottleneck, rather than a mix of CPU and gpu using GPU instanceing. The solution was finding a balance with aestheticlly pleasing and minimal. Alternate ways to mimic a nice ambience. Less trees, less grass, baked lighting, some dynamic lighting, juice.
@Code_Jar
@Code_Jar 2 часа назад
Its certainly a hard problem! I love computer graphics as it combines almost all interesting parts of computer science (math, algorithms, data and parallel processing). I did not cover this, but I kind of do keep detail positions! I use a deterministic pseudorandom number function seeded with vectors that remains constant, such as vertex positions of the triangle we are currently placing features on. Moreover, I use noise based 2d masks sampled using a global-position to remove details at points where the value is under a threshold. These methods actually make it consistent enough for my needs, without having to store upwards of millions of grass positions. Also, I want to look into more GPU processing at some point, but I run nearly everything on the CPU currently as the overhead caused by memory transfer between CPU & GPU became too large. GPU collisions among other things are out of the scope of my project, which is why I rely on having mostly everything in regular RAM.
@Craiy
@Craiy 2 дня назад
Lets goooo
@adamasteway4828
@adamasteway4828 2 дня назад
this is impressive
@Code_Jar
@Code_Jar 2 дня назад
thank you :D
@adamasteway4828
@adamasteway4828 2 дня назад
@@Code_Jar i wish i could do this in unity 😞😞
@Code_Jar
@Code_Jar 2 дня назад
You should be able to! Unity is very powerful in its own right, and it might be easier to write high performance code thanks to the Entity Component System for instance. I aim to be as engine/tool agnostic with my techniques. For instance, nothing I covered in this video is exclusive to Godot.
@adamasteway4828
@adamasteway4828 2 дня назад
@@Code_Jar ok
@myToasterDied
@myToasterDied 2 дня назад
wow
@paddy-whaddy
@paddy-whaddy 16 часов назад
woah :3
@M.N.9
@M.N.9 18 часов назад
Unreal Engine 4: Trees Unreal Engine 5: Forests
@Code_Jar
@Code_Jar 10 часов назад
@@M.N.9 and this was made in godot 🤯
@M.N.9
@M.N.9 7 часов назад
@@Code_Jar!!!
@ethanhermsey
@ethanhermsey 21 час назад
Nice dutch accent! (Very subtle though). Trees don't grow along the normal of the surface, they grow towards the sun, up. With a bit of variety :p Looking forward to see updates on this. It looks very nice, optimized and I like your approach :)
@Code_Jar
@Code_Jar 20 часов назад
Thanks ;) Yeah true! I like aligning along the normal for smaller things like bushes and grass. More importantly, I use the normal to ensure that trees aren't placed on steep areas, I should've mentioned that!
@viniciusschadeck4992
@viniciusschadeck4992 18 часов назад
I not understand properly how you put trees down, i'am making a game as well, but 2D one, and are struggling to make a nice looking florest like ambient, and i not understand your way to explain how you make it, but i need to study more and solve my question LOL. Godot rocks!
@Code_Jar
@Code_Jar 10 часов назад
@viniciusschadeck4992 the core idea is the poisson disk sampling in a horizontal plane, then raycasting/raymarching from those positions down to get a position on the ground. Additionally, I use noise masks to visually group objects, as points are deleted where values in the mask are under a threshold.
@viniciusschadeck4992
@viniciusschadeck4992 9 часов назад
@@Code_Jar understood now, the key point is this poisson dis sampling, the rest is pure logic, because if you get a sky point and shot a raycast downwards it will eventually hits the ground... but this poisson disk sample are the stuff i have to learn better and implement on my code, i already did generate islands and path using seed and some code, but for trees and rocks i need other type of code, i guess is this one, because making any object placement with perlin or simplex noise are really odd, at least the way i tried LOL
Далее
OpenAI’s New ChatGPT: 7 Incredible Capabilities!
6:27
Я ИДЕАЛЬНО ПОЮ
00:31
Просмотров 362 тыс.
I Made a Procedural Map Maker in Blender
8:00
Cone Marching in less than 5 minutes
3:58
Просмотров 1,6 тыс.