Geometry vs. Alpha for detailed pine tree

Godot Version

4.5.1

Question

I’ve been reading a lot about preferred methods of producing foliage in games, and a lot of it boils down to the balance between polygon counts and required processing for alpha channels/leaf cutouts. I’d like to get some suggestions for a model before I get down to actually modeling everything. I’m planning a stylized but detailed pine tree, and I’d like to figure out what strategy is better for the pine needles: actual geometry, as in maybe one or two double-sided polygons for each needle, or alpha channels to create each “tuft” of pine needles. I’m not making a full forest or anything, just one tree, but I’d like some serious detail in the single tree. I’m hoping to make it work nicely on mobile, preferably even mid-range mobile devices. I’ve read that moblie rendering will labor and stutter with mutiple (hundreds) overlapping alpha channeled polygons such as would be needed to create the density I desire. On the other hand, with each “tuft” of pine needles being 40-80 polygons in a fully modeled mode, the polygon count would get very high. Assuming this to be the only tree in the scene, what’s the best strategy for Godot on mobile?

func _ready() -> void:
    print("hello world")

True alpha ordering and rendering would be terrible, but you can discard alpha pixels and skip Godot’s slow alpha pass. Either write your own shader with discard or use StandardMaterial3D’s Alpha Scissor or Alpha Hash option, this should be much better than pure geometry.

Thank you! I’m sort of new to shaders (I’m just reading Filip Rachunek’s books on Godot shaders and fascinated and a little bewildered by the logic) but I’ve put together a basic color shader with displacement to work on some simple planes in the shape of individual needles. It seems to work on a single bunch of needles, but we’ll see how it scales up. I doubt I’d be capable of writing a shader that could imitate 3D pine needles, but based on what I’ve seen at ShaderToy, I wouldn’t doubt it’s possible!

Oh, and if it matters at all, this is what I’d love to be able to get, rendered in Blender’s Eevee. But BOY did that tree ever lag Godot!

Are you sure you need individual needles?

Well, I’m not certain I need individual needles, at least in the sense that they won’t affect gameplay, but I really would need to do a complete redesign if I can’t make the tree look at least somewhat realistic. That’s not impossible, and I’m open to doing it, but I’d really like to avoid it.

Maybe download the free version of SpeedTree and see how it does things.

I’m going to! I’m lucky enough to be an academic and they’re comping me six months of Pro since the site is down as they fold everything over to Unity, their new owner. I was hoping to avoid it, actually, (I switched to Godot from Unity out of a distaste for sales shenanigans, not that I’ll ever have any) and have been enjoying playing with Godot and the Blender addon TreeBox, as well.