Still a few "details" to fix šŸ˜…

#GameDev #Godot

I hesitated posting this video because of the low framerate. Hope nobody will believe this has to do with Godot.

The main problem here, by far, is that the tree mesh I've found models each leave with multiple triangles (which is fine for some use cases, but not adapted for this). There are 170000 triangles per tree.

Once I manage to reduce the triangle count it should run at 60fps. And hopefully I will also be able to increase the tree density (and add variations and bushes etc.)

I wonder is there are good free (preferably open source) tools to generate trees.

I've quickly looked at https://www.eztree.dev/ which is really cool, but I think even with different material styles it's a bit too "cartoon" in the shape as well for what I have in mind.

EZ-Tree | Procedural Tree Generator

EZ-Tree is a procedural tree generator that allows you to create realistic 3D tree models with ease.

I think it would be better with a parameter to make the tree and/or branches zigzag. It's very straight and I haven't found a parameter to tweak that (it can be bended on one side, but not zigzag). Though, since it's open source, maybe I can actually add one šŸ¤”

While I really like trees, I realize I have never studied them 🫣 I can only recognize and name a few, and don't know the english names.

Looking at photos, I see that sometimes a branch changes direction at the point where a smaller branch comes out. I think it's what can cause a zigzag look. Angle variations are smaller on the trunk, but thickness can have a brutal reduction at the point where a big branch comes out.

Also, sometimes the low branches are bent towards the ground.

Another thing is that the shape of the junction, when a branch comes out of the trunk, may need a bit more work to look better.

I need to be wary that photos online are often iconic trees that stand out. But I don't want to make a forest of very special trees, actually since I'll repeat a few model of trees everywhere, it will look better if they don't have particular features that attract the eye.

After some more thoughts about this, I wonder if it wouldn't make more sense to generate trees in #Blender, instead of using an external program.

A node-based approach would probably give more customization freedom, and instant feedback. Unless I'm idealizing it (never did that kind of thing in Blender).

I suppose this has already been done. Countless times. Actually the difficulty might be to pick one among the sea of available addons... Or start from scratch šŸ˜…

I'm making some experiments with the Modular Tree plugin for #Blender3D.

For now I only test in-game performances. There is still work to get a better visual quality.

What I did is that I make a branch (a very small tree actually) that I bake in a texture, and then use it as "leaf". I'm more or less back at 60fps, even when increasing trees view distance. I still need LODs and impostors for the farthest ones.

Trees already give a better sense of scale for the mountains šŸ™‚

#GameDev #Godot

It's reasonably efficient, but visually the foliage doesn't really work 🫤

That's a lot of trees. But still not enough to look like a forest. Or maybe I just need bigger trees. So far I feel like I just made a big orchard. Also struggling to keep good performances. Nature is tough šŸ˜…

#GameDev #Godot

I'm surprised I can't find existing solutions to generate tree LODs in Blender. The decimate modifier does not work very well on foliage (starting with a quad for each leaf in my case, generated by the Modular Tree addon)

I'm considering to implement something based on ideas from a few papers I've read, but it feels odd since I would have thought this is a recurring task for any game with outdoor scenes šŸ¤”

#GameDev #Blender #Blender3D

I think it's slowly taking shape and starting to look like a forest.

Now I have to find ways to simplify foliage geometry and reduce overdraw because 10fps is not enough šŸ˜…

#GameDev

I'm not sure I like these new trees, but at least performance-wise it's really better. Back at 60fps (but I still need to add impostors for distant trees).

Having the game run at 60fps is not really in my objectives, but I want it to run on "old" hardware, so on my powerful 5-years-old dev machine it should definitely run at more than 60fps otherwise it means I have an issue I need to fix.

#GameDev

One thing that really adds to the final result is to fake self-shadowing. I use this both for tree foliage and grass.

For trees, a configurable virtual sphere shape adds shadow to leaves inside the sphere.

For grass, I just add more shadow near the ground.

This adds a lot to the lighting, both in direct light and in actually shadowed areas (in which case the effect is similar to ambient occlusion)

It's implemented in shaders and has almost no perf cost.

#GameDev #Godot

So far I've been using the VoxelInstancer system, of the transvoxel library I use for the terrain (https://github.com/Zylann/godot_voxel), to spawn trees, and also grass. But I think I'll need to implement my own system instead.

I will need different models of trees, which is possible with VoxelInstancer, but then they would be fully independent from each other which means some instances could overlap. Also, it's not adapted for very distant objects (impostor trees) since it uses the terrain mesh geometry.

GitHub - Zylann/godot_voxel: Voxel module for Godot Engine

Voxel module for Godot Engine. Contribute to Zylann/godot_voxel development by creating an account on GitHub.

GitHub

I need a system that generates trees with varying density (depending on biome, slope, etc.), with guaranteed minimal distance between trees, and then chooses which 3D model to use for each tree. All this can be done statically (at world generation) as long as I can remove some trees (when cutting them down). And I need to access very distant instances, even if terrain is not generated at that place.

Then I need fine granularity for managing LODs of close trees, but also very distant impostors.

Some progress with my system to instantiate trees to render forests.

Using primitive shapes for debugging (each shape reprensents a different tree LOD)

There is still a bit of work for this to look like a forest šŸ˜…

#GameDev #Godot

Remaining work:
- randomize tree locations
- use actual tree models (multiple models, each with multiple LODs)
- project trees to the terrain heightmap
- varying tree density (depending on slope, biome, etc.)
- colliders on nearby trees
- possibility to cut down trees (replace by a physics model, and remember which are missing in the instancing system)

And probably more I haven't thought about yet...

Still a lot of things to fix and improve, but it's slowly taking shape.

#GameDev #Graphics #Godot

I've spent much more time on this than I thought it would need, but the tree impostors lighting is starting to work more decently. I've also improved the trees distribution (but so far there is still a single repeated tree model).

There is still a lot of popping, but I expect it would be less visible during normal gameplay (players are not supposed to fly above the forest at high speed).

#GameDev #Godot

A few screenshots of forested areas. It lacks variety, but I think for now the global visual quality level will have to do (it's not the interesting part of the game, I can't spend too much time on this). Maybe I'll improve the ground below trees, add a few tree variations and bushes, but then I'll try to focus again on actual gameplay...

#GameDev

Also, now that there are more clues to gauge terrain scales and shape, the dynamic water simulation doesn't look so good šŸ˜† The rest of the environment improved while this didn't change. I'm not sure I can make it look better though.

I've integrated a new "river bed" voxel material (based on https://ambientcg.com/view?id=Ground021) and added a basic biome system. Trees and grass don't grow in the middle of rivers anymore. Also, the terrain is lowered one meter in the river bed (like if water eroded it). This is still not very realistic rivers, but much better already!

The video shows a comparison before/after for two different viewpoints.

#GameDev

Trying to make things a bit more varied. I've changed so many little things I'm not sure I can sum it up anymore šŸ˜…

One thing I'll need to rework is how I generate forest ground and trees. As of now, I generate forest ground areas, and then I spawn trees. These areas *could* spawn trees, but by chance sometimes no tree spawns there, and I end up with dead leaves without trees.

#Engineer #GameDev #Godot

@youen This post just popped up in my feed and my first thought was "Why is someone posting nature photos under the #Godot hashtag?" It wasn't until I clicked on the images that I realised they weren't photos!

So well done on making these look so realistic. Not just the quality of the graphics, but the distribution of different grasses, trees, the shadowing, clouds, etc. Looks great!

What game is this for?

@ConditionalCoder thanks! I think a lot of the "realism" comes from the textures, some of which have been created through photogrammetry (didn't make them myself, I'm using textures freely available under CC0 license).

This is the environment for the game I'm making https://engineer-game.org/ Though I really need to update the website, basically everything has changed since then, I even switched from Unreal Engine to Godot.

Engineer

Engineer is a free and open-source game where players create machines and buildings. Your survival depends on your engineering skills!

Engineer
@ConditionalCoder it's a survival/construction game with a focus on engineering, as opposed to games where you build large ready-made/single-purpose blocks, here I want to allow players to design their own functional machines, mechanisms, vehicles, free-shape buildings, etc. The game has a dynamic terrain (players can dig and move terrain), water simulation (all rivers and lakes are dynamic), and a basic construction system. No playable version yet, but I'm working on it.
@youen oh, first I thought the video shows a flooding before I read the post

@uint8_t actually, it's typically what will happen in the game if the player modifies the terrain and causes a flooding. My change only create river beds for initial rivers at world generation.

At some point I think I'll add a system that converts grass to river bed and vice versa over time (in the case a river is diverted somewhere else, or a lake emptied, or whatever)

@youen I’m intrigued!
@uint8_t I'll try to make a video showing how a river can be diverted to another valley (though for now it's only possible with in-game debug tools ; final digging tools and drill machine parts are not implemented yet)