"Prevent" plants from sticking through walls/glass etc

Hi guys,

how do you prevent scenarios like this:

Is there a way to “automagically” clip the plant asset’s mesh so it won’t poke through the glass/wall etc?
I’m scattering objects in these planters, there are ways to influence the scatter system away from objects/collections, but that only influences the mesh origins, not the mesh (my hopefully educated guess). Having them naturally bend away from the glass would probably be rather complicated and would ensue in making instances real, but maybe I can use the glass barrier as a clipping object for the plant collection, for example, or use the entire building collection for clipping another collection?

Hi.

Here is a shader hack:

Basically using Object coordinates to affect the instance shader’s alpha.

It does mean that you’ll need a more complex shader setup or a bunch of different materials for each clipping “group” you want to make.

Good luck.

3 Likes

Oooook :sweat_smile:

As far as I understand, I’d have to

  1. go into the plant assets and add the texture coordinate, separate XYZ and greater than nodes in relation to the empty to the leaf material’s shaders,

  2. add the GeoNode setup to the empty, object info would be the plant collection (I knowingly only used 1 GeoNode setup so far, to spread inset lights on a ceiling across all vertices of an invisible mesh, that worked with a collection)

  3. move the empty close to the glass to “cut off” the mesh that uses said material

Right?

there is no magic solution, you have to pick your poison and use the “best” method that you can think of…

maybe try to tweak the plants so their don’t stick out that much from the pots. You might orient them so the back is always against the wall without plants sticking out, and the front is always against an open area so the plants might expand a bit toward the boundaries of the pot…

You can cut them but you’ll loose instancing and it might look weird if it’s a glass…

Or, vegetation is a very important topic and you can come up with a clever way to generate them so they react to their surroundings but it’s likely to take days to make something good…

1 Like

Since they’re being scattered, everything is randow. I take all manually placed plants and rotate them so they fit, but it would take half an eternity to place them manually in my projects, I’m afraid :sweat_smile:
I can very well have them be pushed away from some onbect/collection, I just wanted to avoid them having a huge distance to the glass, so I wanted them to snuggle up to it, details would be invisible anyway.

I’ll see, maybe I’ll stick to retouching…

As I said , you’ll have to pick your poison :smiley:
Maybe it’s just that particular bush-like plant that needs a special treatment , having some kind of border to push them inside / away from the wall would be good enough, or manual tweaks indeed , I’ll just be cautious to try to keep instancing as much as possible…

Good luck !

1 Like

Hi, sorry, I was out.

To answer your questions:

  1. Yes. It needs to be part of the instance’s material.
  2. This is irrelevant… I just used a simple Instance on Point setup for demonstration purposes… to show that it works with instances.
  3. Yes.

Good luck.

2 Likes

It would be a lot of work upfront, but you could create a duplicate set of instances that are trimmed on one side, then have a separate scattering group for plants close to the wall.

It’s a hassle no matter what way you do it.

Or you can realize instances, add in clipping meshes and displace / clip geometry on the millions of polys you’re going to have to deal with in a full scene…

I feel your pain, there isn’t yet a robust solution to this issue.

2 Likes

Already yesterday i had the idea that (like for polygonal hair) some physics maybe can be added to the plants and when placing the plant one meter above the target and then “putting them down” like in real life if you place the plants could/would to the trick.
But i’m bad in ny simulations :sweat_smile: and of course couldn’t find something like i had in mind.

2 Likes

Since the scattered items are also rotated randomly, this attempt would be futile, unless I scatter 10 times more assets not to make them look uniform, I GUESS!

Realizing assets would be horrific memorywise - I already use up to 70 GB of memory on that project and the file is 8 GB in size. 4 Millions of polys already!

Not yet - but people with skillz - like those who claim to have @zeroskilz - may come up with something. I can see this may be of use for more people than myself. Zeroskilz has already been taken out of the game with nobody buying his revolutionary fence generation addon - so after giving it away for free, maybe someone with ability and creativity could jump in. It’s something I would definitely pay for as an addon. Like the other 14 people who paid for the fence addon :expressionless:

BUT I’ll try the material node thing anyway.

Just my fantasy: the would-be addon could ingest a target collection as clipping obstacle, analyse the materials contained and automagically edit said materials to what Zeroskilz said. No clue if this would even be possible.

Physics would be a problem for scattered assets, I believe. That would bend the entire instance to the side, in my understanding. But I get where you’re going, especially for hair etc. I never used hair. I’ll try to silently involve the GeoScatter Dev.

Well, if you don’t want to realize instances there isn’t a lot of solutions…
What could work is to do some calculations based on the bounding box of each instance and try to replaces instances that pass through the glass with one that doesn’t, but it seems to be pretty complex for what it is…

If realizing instances is allowed or if you can generate the plants right away, then more options are possible. you can always cut, or push inside what is outside the glass …

The alternate solution is to use special models of plants just in these areas… maybe based on proximity of the walls…

I got the feeling that you’re looking for a solution that is nearly impossible or that requires a lot of engineering, namely “post-processing” the vegetation but keeping them as instances in the meantime…

Anyway, I would look into ways to cleverly distributes vegetation, and probably go for a good enough / lazy solution first, and maybe go back to it if it’s really an issue.

What could be possible to do, even tho probably not the simplest solution would be to calculate the size / bounds of vegetation elements, then use that info and the distance to the walls to scale down the instances when they are outside. But it looks like a lot of work already, I would probably spend easily two or tree days to figure all that out…

Another option much easier, if the building model allows, you use a curve to dictate how to scale down the instances.
Basically you manually put a curve where you have vegetation sticking out, you set the curve radius to the desired size. Then you transfer that radius to the instances, and you add a range of influence : if the distance between the instances and the curve is too big then the instances aren’t scaled down basically…

Hope this quick brainstorm will help you to move things forward !

3 Likes

Of course i’m aware that this might only be a solution for one balcony… if this is for something big then this may give big problems… :wink:

So maybe just “design” the plant area smaller than the diameter of the possible plants so they never get “overboard” ? ( :stuck_out_tongue_winking_eye: )

1 Like

@sozap the problem with scaling is that some of those assets are narturally big & bushy, but some have very small versions of themselves, so the idea with the bounding box size and swapping for a smaller asset from the pool of scattered items sounds good to me, but will ultimately depend on the asset type.
Another application would be a rooftop garden with a layer of grass. I’m using GeoScatter for all those things, and it does a mighty good job giving me lots of options - I can define collections the scatter keeps a defined distance around, with a defined transition area. So with grass, this works well, and depending on the size of the scattered grass clump I get a reasonably small gap.
Large clumps/models would get pushed away too far in their entirety. Hence the thoughts on clipping.

If realizing the instances is the only key, or permanently altering the asset shaders, OK. The “problematic” assets are limited in number. Sometimes my clients want to swap foliage, just one type of asset. OK, I could still keep the scatter system hidden on a separate hidden emitter, delete the realized instances and swap out the specific item.

I’m very much for cutting (clipping)! I’m looking for a simple solution, and @zeroskilz’ seems very straightforward. Now, Terrascape’s Grass Scapes pack has around 260 (gr)assets using around 200 materials in total (very roughly counted), of which I realistically would only have to modify the leaf materials, i.e. 2/3 of those materials.

My problem: I’m a node dummy. There is not one single texture coordinate node in those specific materials, just a “group input”, 1 color map, 2 bump maps, a couple of adjustment & mixing nodes, I understand all but the group input node. HOWEVER, I suspect that could not work, especially not automagically, since, I’m guessing, the materials, depending on who created them, have very different builds - so I, with my limited understanding, am back to square 1 :sweat_smile:

Maybe the bounding boxes can be clipped and with them the contained mesh?

I’m really sorry, I’m trying to grasp and/or “modify” very complex scenarios with primitive, uninformed input. I understand this isn’t Lego. I just thought clipping ojects/instances would be a lot easier. But then people would already be doing it…

@Okidoki it’s not just for one balcony with some planters. It’s every single house plant placed in a corner or wherever. You get a HUGE bounding box dropping items from the asset browser, that sometimes reflects the size of the asset, sometimes doesn’t. If I could easily just have them clipped by the adjacent walls, that would save me trying 6 different assets. In real life (I DO understand the difference, still :sweat_smile:) you just push the plant where you want it and the leaves will bend away, if necessary. physically, I’m sure this is very hard to achieve, but maybe it can be faked easily…

Of course… :wink: you could also use obstacle considered grow simulation of the plants… :stuck_out_tongue_winking_eye:

There are always a way to make a system (or user) “sweat”…

It’s possible to remove geometry outside the walls, but first it might feel weird if it’s against a glass ? and you’ll have to realize those instances.
I think the most complicated part is to isolate the instances that goes through the walls…

1 Like

Either make the poly, which is the base for the instances, smaller. Or place the plants by hand, which works faster. Just place the plants in the first box so they look good, then copy them over to the next box and do some little movement or scaling and rotating, so it doesn’t look like a copy.

When your system is already crawling, scattering is king :sweat_smile:
Friday: “I need this my Monday, Tuesday latest” - no time to waste

Linked Duplicates are the same, memory wise, i guess.

I know, but until that duplicate appears, reacts to grab, move, rotate - at some point, it gets too tedious and time consuming. Allegedly due to Blenders architecture, once lots ob objects are in the scene