GeoTree: Procedural Trees in Geometry Nodes

Semi-aside here. I watched the video above for old time sake, and, you know, the fact I could actually understand about everything it’s saying now made me feel a little proud of myself. It’s like I’m actually learning stuff!

Because of it, I decided to download a 3.5 Alpha, and experiment with Eevee Next vertex displacements. Long story short, I was able to move a plane around using the mapping node in the material editor.

I might actually be able to make those fuzzy trees soon. After all these years…

…yeah, This is pretty promising.

3 Likes

Yes! It looks like I can make my fuzzy trees! I just have to wait until Eevee Next is finished before I can see exactly what it looks like, since it currently can only show an emission texture. But the nice thing is that it divides the faces according to the UV seams without any extra cutting, the faces track not just the camera, but the viewport, and it performs without any framerate hits or hiccups.

Edit: Finished! You’ve got your Map Range in place of the Repmap node, a Vector Transform to orient the faces from the Camera to Object (local) space, a Normalize math vector to allow the billboarded faces to keep the same size even when scaled, another Vector Transform from Object to World space, so you can rotate the object without discombobulating the billboards, and a Vector Mix node to act as the Lerp.

It looks like it’s working perfectly, but I won’t know for a fact until I can view materials in Eevee Next. For now, I’m uploading it both as a proof of concept, and to have a place to redownload it in case I accidentally delete it.

…cuz I think ahead like that.

Remember, this will only work in Blender 3.5.

Billboards_3.5.blend (862.0 KB)

5 Likes

This is cool so its sort of the equivalent to the unity/unreal one
Ill try this out

Provided the shading carries over much as it does in UE/Unity, yeah. I’ll have to wait until Eevee Next progresses some more before I’ll be able to test that, though.

Here’s a slightly more updated version of the shader. You can now spread the faces away from their source, or scale them in place by playing with the two value sliders to the right of the Principled shader.

Billboards_2_3.5.blend (882.9 KB)

Here and here

These trees i showed are using unreals particles, but there basically behaving like your shader in a sense. All the leaf cards are facing the camera, there noramals all point to the camera as there just planes. The gradient is the material and controlled to always point to the scenes sun location, with some other additional shader based effects

I would use the quad to billboard trick but i have Thisissue

The billboards dont rotate around there own center but instead offset depending on view angle
So as i move around you can see the leaves change where they are according to the branch
Instead of each card rotating on there own axis there on some weird offset, if i set the settings differently i can almost stop this but then the are limited variation in the tree

I think the unity one dosnt have this issue but maybe theres just more to the unreal code thats need to work properly, no idea

There is another unreal shader way to make billboards under the condition that all the faces are disconcerted to begin with. Using the trees made from your generator there leaf cards are disconnected so i can apply a billboard shader that maked each one point to the camera in a different and more accurate way to the quad to billboard trick

besides i want to have the different leaves in layers so i cant do this with the mesh to billboard trick anyway to im not bothered by not using that method

1 Like

The only way I could think to avoid that would be to put your leaf bulbs only towards the very end of your branches of your branches, and then maybe lift them so they’re floating slightly above to compensate for the spread when they get billboarded.

Though from the what I do know about this shader, it seems like the only way you could get a problem like that would be if you either spread them out too far, or the underlying geometry of the leaf bulbs intersect with the tree. Really, I think it’d all come down to trial and error tweaks.

Yeah, I’d say moreso than for trees, it’d be good for low ground cover, ivy, and things like that. If you use it too much, the trees do start looking too samey after awhile.

It shouldn’t be difficult to do, actually. Each leaf card is just a single quad spammed over and over and over again. Effectively, all those leaves do share the same UV space, just like each face on a leaf bulb destined for billboarding, so setting this shader up on one of my trees should be cake to do.

I’m going to do that eventually. There’s one other thing I need to do first, then I’ll hit it full time.

Cool, no rush it will be fun to play with it when its ready

The combo of this layering and even the billboards what to mimic how handpainted trees would be painted in say photoshop, which is many leaf brushes painted in clumps and varying in shades such as my gradient i have in my Unreal trees or that guys ghibli GN trees

There is also this trick iv just discovered recently that makes perspectives work in a 2D way for 3d objects. Basically making the 3d perspective look as it would be in a 2D way, good for say and anime style character but even on the trees as this guy has shows looks good. The difference is perspective really helps make the anime artstyle work and look much more accurate to the source style. Happy to have found this and now i need to make an unreal version :stuck_out_tongue:

2 Likes

That’s a great trick, thanks for sharing! I’m not 100% sure how to use it on a character, I’ll have to do some experimenting :slight_smile:

Well it should just work on the character if the character and clothes are all one object
You would want to make a character and clothes assembled with geo nodes so its just one gn object then add this camera view after it so it flattens the character according to the view angle

So like make a gn setup that just merges different parts of the character using join geometry
If your character is already one object then you dont need this

Then just use the camera to view checkbox to lock the camera to the viewport so you can move around and edit within the camera view

2 Likes

As a heads up, I started taking apart the anime tree shader today. I’ve come to understand a good bit of how it works. It’s both simple, and really clever.

The only question I have is what he’s using the Python script for.

Cool, looking forward to seeing the result

Didn’t know he was using one lol, i didnt look at its guts :stuck_out_tongue:

I get a warning every time I open the file, asking me IF I’M SURE I want to run this. Weird thing is, it doesn’t seem to make a difference whether I run it or not.

But anyway, it’s pretty straightforward, though I still have yet to delve into the super fine details. It starts out with two distribute instance nodes. The first distributes little icospheres across the surface of a canopy mesh, the 2nd distributes cubes in place of the icospheres, then transformed downwards a bit so it slices off about 2/3rds of the icospheres. These 2/3rd slices connect to a distribute instances node that the spawn the highlight leaves, while the untouched spheres spawn the background and regular leaves through two other distribute nodes.

What I have yet to figure out is why he’s using an extra fancy distribute instance node, and how the shadowing works. I know it uses the proximity of the icospheres to influence the colors on the leaf shader, but WHAT it’s doing, I still have to figure out.

Anyway, long story short, this shouldn’t be too difficult to implement on my trees. All I’d have to do is add an extra stage to the trees, with the leaves acting as the spawning mesh. Like so…

Hes doing two things with shadowing and overall shading, and shading per sphere/clump
See here

So theres is a gradient across the whole tree and also per clump section, he feeds this into the material as attributes

With the shader i wanted to look at this and combine parts if needed to get the best of both, or just as a variant style

1 Like

This is pretty preliminary, and I can’t get the shadow effect to work yet, but…

10 Likes

It looks rather splendid!

3 Likes

It’s actually real barebones compared to the source material. All I did was steal one of his leaf cards, then sourced it off the my Leaf Axis which was generating isospheres, and used a bog standard distribute node on those.

Also, the way dude guy grabs normal data for the shading is dead stupid simple. Remember all the struggling we did trying to find a way to transfer face corner normals in geonodes? You can do it with three nodes now. Didn’t even think to do it that way.

My only other concern is that I probably won’t be able to do the boolean effect he uses to create the highlight leaves without setting my whole computer on fire. Though I’m thinking there’s a way I can grab the faces oriented towards the top of the little spheres, and I could use that to generate them instead.

2 Likes

Hay thats starting to look good, even if it is barebones

So this guys work is helping you in general, im glad my request has become of more use to you

One thing i was thinking about was in alot of anime artstyle the leafcards are sometimes cut into to make a soft fade so that you dont always see the leaf shape everywhere on everything
See this example, What i was thinking is something like in the shader for the leaves we have a alpha cutout that cuts out a sort gradient at random places on the leafcard. But then we wouldnt want this gradient cutout on the edges of the tree as in we wouldnt want to see a leaf fade out on the outer part of the tree only in the center part of the tree, perhaps use fensel to cull it from happening on leaves on the outer edge maybe.

Any ideas there?
The point is to help blend patches so you get patches of color and not leaf cutout shapes all over, and help add that watercolor effect. Perhaps some world aligned 3d noise that effect all the leaves of the tree, not sure really. Just thought id put the idea out there if anyone has any ideas how to achive something like that

Btw here is the color ramp im using for the blue shadows, similar to my unreal trees. The top is for the highlights the bottom for the main leaves

Did you want to run tests with my leaf atlas?
I can send the proper image file if you want

1 Like

Perhaps you could utilize a dot product. It’d be a lot faster than raycasting or proximity.

1 Like

This looks quite interesting, not messed with it but thought id link this here
Could be useful with the trees but it could be awesome for all sorts of things

1 Like

Dude, you’ve been a straight up gold mine of neat stuff for me.

2 Likes