2D-Trees with better shadows

Hi there!
Faking thousands of trees by displaying them as 2D, always pointing to the camera. I like solutions without Add-ons. I found a very good one on Youtube:
„Scatter Large-scale Forests in Blender“

But there is one problem:
Angles arise where the trees point at right angles to the sun and their shadow will therefore disappear for all these objects.
So I think the solution would be:
How can you add to each primary tree a second - shadow casting - for the camera invisible tree - (perhaps with Geo Nodes)?
Link to the Blender-File: magentacloud.de


Thank you in advance for help!
Best regards,
Lutz

1 Like

… and it should work with a fixed rotation to the sun and any scaling factor of the tree. Like “pick it’s origin (possibly unnessesary) and scaling factor and apply it to the shadow object” or so. I just don’t know the GeoNode setup …

Couldn’t the shadow be improved simply by curving the tree plane?

If this doesn’t do it, I might have an other idea, which is done entirely in the material. Basically, you can have both planes as part of the same object and make the second one disappear in the material using the viewing angle.

Here is the file:

planes_exemple.blend (927.4 KB)

1 Like

Hey, you can try it with this setup in geo nodes:

align_sun_camera.blend (1.4 MB)

6 Likes

hey thank you guys, I’ll try both things out. The challenge is that the tree-shadow element shall not rotate while the visible tree always point to a moving camera …

1 Like

Hey higgsas, this is exact the functionality that I desired! Thank you very much. Just one question: In camera view there are dark vertical artefacts as well as in the background black areas. Where does that come from?


1 Like

Looks like you’re using Cycles…

The number below is the max number of transparent objects a light ray will go through… the higher the number the slower the render.
image

Good luck.

2 Likes

Hi zeroskilz,
thank you for your hint. I increased the Transparent value from 8 to 400. This is what I get:

I think the black areas are gone with increasing the Transparent value.

And the dark sides of the trees are only visible if the sun is behind the camera. Do they come from the “shadow”-tree-objects (?)

Is there a way that the “shadow”-tree-object does not affect it’s primary tree?

That appears to be the shadow caster:
image
You can try using an emission shader:


Good luck!

2 Likes

Hi thank you for this emission shader idea.
I did it but it did not work. I still got these vertical shadows in the trees.

Link to my adapted Blender-File (in my cloud see post above - it seems I can’t append files here)
align_sun_camera-packed-b.blend

In Outliner you see the viewort-visibility for the shadow object is on, but it makes no difference.

Thanks in advance for to busy yourself again with it :wink:
Lutz

If you’re rendering with Cycles, my advice is to use 3D trees. Being instances means Cycles renders them at no effort, you just have to make sure that the base instance(s) fits in memory.

3 Likes

Ah, thank you, yes, I will use Cycles. This is good news. I thought about instances of 3D trees (with proxies) for my project of a 17th century city. I will test render some hundreds of trees an see how long it will take …

There are a couple gotchas (don’t use nested instances, and don’t rely on transparency) but in most cases it’s pretty painless

1 Like

It worked like you predicted. Put an insane amount of trees into my scene scattered on a plane with “distribute points on faces”, “instance on points” a.s.o… Render time was just the same as before :-))) Great! Thank you so much!
What kind of transparency do you mean?

1 Like

Fantastic ! transparency as in textures with alpha (usually for the leaves). Keeping track of transparency is difficult for pathtracers like Cycles, and too much transparent depth (the value you set to 400) can slow down your render rather dramatically. I advise modeling the leaves’ shape instead of relying on an alpha. But if it works, it works, don’t change it

1 Like

Ah ok, I made the render above with a already set back Transparent value from 400 back to 8. So no problem :slight_smile:
The trees are made with “The Grove” - I think the leaves are real geometry.

… and I explicitly want to thank ALL of you for your input :slight_smile:

2 Likes