Home Unreal Engine

Save foliage instances so that they are independent of static mesh and/or static mesh?

grand marshal polycounter
Offline / Send Message
Alex_J grand marshal polycounter
If you use the foliage tool to add foliage instances to a static mesh actor or a landscape, then you delete the actor or landscape, the foliage instances that were "stuck" to it are also deleted.

Anybody know a way to save out the instances so they just exist independently in the level? I spent some hours placing foliage onto blockout geo which gets replaced, but I don't necessarily want to have to replace foliage instances.

Replies

  • poopipe
    Online / Send Message
    poopipe grand marshal polycounter
    I don't think there's a button for it

    you can move foliage actors to other levels in world composition - prior to my world partition experiments I dumped mine into the persistent level cos I didn't want them streaming out 

    the foliage actor is just an actor with some HISM components hanging off it and some crap to attach it to a landscape  - you could probably build a editor utlity to duplicate the components out into another actor to make it completely independent. 

    Personally - I've swung back around to using procedural foliage volumes and masking for placing forests.
    It's a lot less work to resimulate when you make landscape changes than it is to repaint - you sacrifice some control and it does get quite crashy when you're looking at dumping several million instances into a  level but on balance I think I prefer that to the fuckery attached to handling painted foliage. 


  • Alex_J
    Offline / Send Message
    Alex_J grand marshal polycounter

    I was messing with the level streaming stuff to see if I could send it to an empty level just for purpose of holding foliage but I couldn't get the foliage selection to register. The 'send foliage to level' button always grayed out. That stuff is real buggy IME so I didn't wanna dig into to deeply before considering if I might do something more straightforward.

    In this case I am only manually placing foliage just as decoration in an urban environment. The editor utility sounds like probably the best option, however I wonder if a dumb but faster option might be to just place foliage as static mesh then use the Batch tool to convert them to instances. Tested that out and it's not terrible workflow for the amount of stuff I have to place, and I am usually placing one at a time anyway.

    Using the batch tool it creates a single actor that has ISM components.  The foliage actor must be grouping instances into HISM's based on proximity? If I use the batch tool and create actors based on proximity grouping, that is effectively the same thing, right?

    Example image: First I drag a few copies of a tree mesh into scene. Then use Actor -> Merge Actors -> Batch which makes them into a single actor with ISM components.
    This one actor would be occlusion culled and, if necessary, could take part in level streaming. There may be another foliage actor like this on other side of level acting independently from this one.
    This is same effect as using the foliage system as far as runtime performance considerations go, I believe?

  • poopipe
    Online / Send Message
    poopipe grand marshal polycounter
    the foliage actors us HISMs which are better than ISMs since they'll batch across lods - you likely won't notice any difference unless you have lots of trees on screen at once though

    if you're not putting loads in your level then you might as well leave them as static meshes - they'll batch dynamically so it'll be basically the same as using ISMs. solve the problem later when it becomes an actual problem


  • Alex_J
    Offline / Send Message
    Alex_J grand marshal polycounter
  • Alex_J
    Offline / Send Message
    Alex_J grand marshal polycounter
    What I ended up doing for this was just using static mesh for foliage like poopipe suggested and relying on unreal to handle them appropriately.

    However, after testing out Packed Level Blueprints (https://docs.unrealengine.com/5.0/en-US/level-instancing-in-unreal-engine/) it looks like that might be an easy way to basically auto convert to ISMs as much as possible. It works similar to the Actor-> Batch tool, except that you get a blueprint that offers you full editing tools (the snapping tools and such).

    Not sure if it makes a difference or not, but worth checking out if getting into an optimization pass.

    For placement of the foliage I wanted the easy, click to place and click+drag = paint functionality that the foliage tool offers. Luckily there is a cheap and very effective plugin on marketplace called Naatur Plugin.  It also has in-editor physics sim - I can highly recommend that. Not necessary for foliage but handy for other things.



Sign In or Register to comment.