Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Flora - Advanced Foliage System

Discussion in 'Assets and Asset Store' started by MA-Rob, Jul 21, 2023.

  1. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80

    Flora, an intuitive and performant foliage system.

    We've built this tool to overcome a lot of the restrictions when using the Terrain system for foliage placement and instancing. Instead of relying on the Terrain's detail and tree system, Flora manages its own set of instance data, allowing for the freedom to paint on any static mesh or terrain.

    Want to easily brush in ivy or moss on your structures? ✅︎
    Want grass and plants decorating your cliffs? ✅︎
    Want complete artistic control over foliage placement and instances? ✅︎

    Flora also has a specialized rendering system for instances that is compatible with any render pipeline. By leveraging Burst and the Jobs system, millions instances can be efficiently culled, LODed, and batched together.

    Features

    Placement Settings
    Flora Prototype assets describe how instances are placed and can be re-used across scenes.



    Intuitive Tools
    Paint, fill and erase instances easily.


    Fill
    Fill a mesh or terrain with instances.



    Multi-Model
    Paint multiple types of instances at the same time.



    Custom Attributes
    Use custom attributes to apply effects like color tinting. Access the attributes easily within ShaderGraph.



    Instance Tracking
    Flora ensures instances stay with objects they were placed on.



    Directional Shadow Culling
    When Separate Shadow Culling is enabled for a prototype, Flora approximates the view of the main shadow casting light so that tall objects, such as trees, never lose their shadows — even when the sun is at a very low angle.




    Debug Window
    Get in-depth information about the rendering system with the rendering debug window.


    Performance
    Flora can cull and render a scene with millions of instances.



    Auto-Shader

    Create an AutoShader asset that automatically modifies and creates a new shader for Flora from any Shader or ShaderGraph. If the original shader changes, it always stays up to date. No manual editing required!



    Additional Features
    • VR - Instanced stereo support.
    • Runtime Debugger - During play mode or when the player is built in development mode, open the debugger with Ctrl+Backspace (Ctrl+Delete on macOS).
    • Masking - Paint only on specific terrain layers or mesh vertex colors.
    • Sample Assets - Includes an example scene with 10 stylized models.
    • Prefab Instances - For large objects that need colliders or scripts, Flora can create and manage GameObject instances of the prefab (instances are still rendered with Flora).
    • Light Probe Support - If your scene contains baked light probes, Flora will interpolate the probes for each instance and pass the lighting data to the shader (requires a shader feature or define).
    Requirements
    • Unity 2021.3.0f1+
    • Platform Compute Shader Support
    Workflow
    • Create a FloraPrototype asset per model prefab you wish to use.
    • Create a FloraContainer game object in the scene.
    • Add your prototypes to your new FloraContainer object.
    • Activate which prototypes you want to paint by checking the box next to their icon.
    • Paint your instances!

    If you have any questions, please feel free to ask!
     
    Last edited: Sep 23, 2023
  2. TauntGames

    TauntGames

    Joined:
    Jan 31, 2016
    Posts:
    14
    Not sure if anyone else was getting compilation errors but this fixed it for me.

    UnsafeIndirectList.cs Line 312
    NotBurstCompatible throws error, Changed to BurstDiscard

    NativeListExtensions.cs Line 406,422,438
    NotBurstCompatible throws error,Changed to BurstDiscard

    The UI went weird after all code compiled and was gettin GUILayout errors so changed
    FloraPrototypeListUI.ccs Line 330 - 335
    changed
    GUI.skin.FindStyle("ToolbarSearchCancelButton")
    to
    EditorStyles.toolbarButton

    Also deleted #IF statement for unity 2022.3

    After this i was able to use the flora container to delete and paint,
    and all UI was showing up as seen in the demo image.

    Hope this helps.

    Steven.
     
  3. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80
    Hey Steven, sorry you're getting errors! What version of Unity did you get these errors on?

    Also what version of the Unity.Collections package are you using?
     
  4. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    422
    @MA-Rob This looks really nice. Do you have any plans for some kind of procedural painting for large maps? Or better still, is there a way to injest foliage that has been placed using another method? (e.g. Jason Booth's MicroVerse)
     
  5. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80
    @jeromeWork Thank you! I'm definitely considering procedural placement for a future release, but I really want to make sure the core system and API is stable first. However, you can certainly use the current API to place instances procedurally.

    As for MicroVerse, since Flora doesn't rely on the Terrain system for instance placement, a 3rd party asset like MircoVerse would probably need to interact with Flora directly. I haven't used MicroVerse yet though, so I couldn't say for sure how that would need to be implemented.
     
    Lars-Steenhoff likes this.
  6. TauntGames

    TauntGames

    Joined:
    Jan 31, 2016
    Posts:
    14
    • Unity: 2022.3.0
    • com.unity.burst: 1.8.7
    • com.unity.collections: 2.1.4
    • com.unity.jobs: 0.70.0-preview.7
    • com.unity.mathematics: 1.2.6
    • com.unity.profiling.core: 1.0.2
    • com.unity.render-pipelines.core: 14.0.7
    • com.unity.shadergraph: 14.0.7
    • com.unity.settings-manager: 2.01
     
  7. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80
    @TauntGames Thanks for the info! I've fixed the errors, there will be an update early this week with the fixes included.
     
  8. TauntGames

    TauntGames

    Joined:
    Jan 31, 2016
    Posts:
    14
    That's awesome response time. Messing with it just now and its great. The grass taking on the colour of the terrain layer is brilliant.
    One small thing as I am impatient I was trying to paint the grass with attribute0, after adding it in inspector. This throws no errors as it exists, but it wasnt ticked in materials.
    You cant account for all use cases but if there was a way to just add a throw or comment when painting without material bool ticked.
    Other than that its going to be great for my game. Especially for adding foliage in city environments.
     
  9. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80
    @TauntGames Thank you, glad you're enjoying it!

    That's a good point. It should at least show some information when the prototype doesn't handle attributes, but checking for material support is much harder. For now I just added a note in the PDF documentation, but I'll definitely think about how to better indicate attribute usage to the user.

    Appreciate the input!
     
  10. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,450
    Flora looks very interesting, does it use Instance Indirect for rendering ?

    And would it work on Nintendo Switch?
     
  11. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,450
    Also it would be nice if you can add pen pressure support for paining operations.
    For example the radius or density.

    I have done some test in the past, I can let you know how to set it up.

    And last but not least can you make a preview of the model show when painting like in the video I embedded. this helps to see how large it will be placed

     
    Last edited: Jul 23, 2023
  12. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80
    @Lars-Steenhoff Thanks! Currently Flora uses instancing, but doesn't rely on indirect instancing because it's culling instances on the CPU. So the system already knows how many instances to render before the draw call. This could be done on the GPU, but I haven't found a need for it quite yet as it's already very fast. It works similar to the ECS graphics system.

    Switch should be supported, but I haven't tested it.

    As for the pen pressure, I've definitely considered that, but I haven't looked into setting up pen pressure in Unity in quite a while. Are you using the new input system or another method?
     
    Last edited: Jul 23, 2023
    Lars-Steenhoff likes this.
  13. TauntGames

    TauntGames

    Joined:
    Jan 31, 2016
    Posts:
    14
    Sorry I had a sec, feel free to dismiss this but might be an option.

    bool GetMaterialUseAttribute(FloraPrototype proto)
    {
    if (Math.Abs(proto.ModelPrefab.GetComponentInChildren<Renderer>().sharedMaterials[0].GetFloat("_USE_INSTANCE_ATTRIBUTE_0_COLOR") - 1) < .001)
    return true;
    Debug.Log("Material Property Not Set To True");
    return false;
    }

    I added this to FloraAttributePaintTool.cs

    then on line 28 i added it to the if statement.
    if (prototype.AttributeCount > 0 && GetMaterialUseAttribute(prototype))
     
  14. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,450
    Last edited: Jul 23, 2023
  15. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80
    @TauntGames The only issue with that is that define is only applicable to the demo ShaderGraph. It’s just there to ensure the prototype has the attribute. I’ll think about how to make it simpler.

    @Lars-Steenhoff Ok, didn’t know it was that simple. It’ll be in the next version. Thanks for letting me know!
     
    TauntGames and Lars-Steenhoff like this.
  16. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,450
    Thats great, I think a toggle check box for each value to use pressure or not will be good to have. for example you may want to use the pressure only for density or radius and sometime for both. or none depending on what you want to paint.

    also a mix and max value is good to have user adjustable, as pressure it can be hard to have fine control if those are fixed to 0-1


    IMG_5357.png
     
    Last edited: Jul 23, 2023
  17. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80
    Lars-Steenhoff likes this.
  18. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,450
    And one more thing, can you make a mode that only paints on a selected material ?
    and optionally only on a selected color ( from material or from texture
    ( can be a range of color values close to the color )

    This way it would allow me to easy paint grass only on parts of a model that are green for example.
     
  19. Dragonname

    Dragonname

    Joined:
    Jun 25, 2015
    Posts:
    6
    I‘m considering trying it out for my game but have a few questions. Currently I’m using nature renderer for my vegetation, how does Floare compare to it in terms of performance and features? (Would nice to see a sort of benchmark, also again GPUI). I’m considering switching because of the sort of subscription model of nature renderer, would this be a one time purchase or also we have to buy an upgrade each new version from unity 2021 to 2022 for example?
     
  20. colin_young

    colin_young

    Joined:
    Jun 1, 2017
    Posts:
    243
    Does Flora implement a non-destructive workflow? If not, that would present a challenge to any sort of integration with MicroVerse.

    That said, just being able to import (either automatically or manually) from the standard Unity terrain system would be a very useful feature. For better or worse that's really the only "standard" exchange format for vegetation, and it's more realistic to expect other vegetation generators (MV, Gaia, VSP, etc.) to support than than to expect them to create support for a specific third party tool, especially one that may be seen to compete with their offerings.
     
  21. jeromeWork

    jeromeWork

    Joined:
    Sep 1, 2015
    Posts:
    422
    Agreed that at the very least an import function from the Unity terrain would be a great start. For those working with MicroVerse, you could see the Flora process as a final optimisation after locking down the environment (it's a while since I've worked on environment design but from memory, you can strip MV out of a scene once you're happy with what you have)
     
  22. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,450
    There are tools that convert unity terrain trees to normal meshes, same for the terrain itself it can be converted to a normal mesh. That said yes it would be nice to make use of the trees / details that are painted on the terrain and get them extracted to flora to get a potential boost in rendering.
     
  23. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80
    You can mask by vertex color as a setting on the prototype, but you can't override that in the tools yet. Are you asking for actual shader evaluation of the material or just masking by the material of a mesh (the submesh)?

    While I don't have exact benchmarks, I have a test scene with 20 million cubes and Flora takes about 0.7ms in a IL2CPP build (or ~1ms in the editor) to cull and submit the instances. This is obviously a contrived example as it's only instancing a cube, with one material, and no shadow culling. The demo scene for example, has around 1.25 million instances and runs at about 0.9ms in a build. Basically, you'll most likely max out your GPU with triangle count or memory before Flora's instancing becomes the bottleneck.

    I don't intend to do yearly versions and Flora will continue to receive updates for the foreseeable future.

     
    Last edited: Jul 24, 2023
    rrahim and Lars-Steenhoff like this.
  24. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80
    I'm not quite sure what you mean by non-destructive workflow. If you mean adding, adjusting and removing instances - you can do this with the API. So if a procedural tool used Flora's API to interact with instances, it could easily re-generate instances on the fly. Flora is mainly a core system for instancing, with some painting tools to get started, but it could definitely be expanded on with procedural tools.

    I'm working on a conversion tool for Flora that converts terrain details to Flora. I'll have to see how slow this process is, but it might be possible to have some sort of synchronization that can be turned on while using a procedural tool that places terrain details.

    Another option, but one that will take more time, is to have a component that can render a terrain's details with Flora. You wouldn't be able to use Flora's tools and they would have to be culled separately, but it might be a nice option to have. You could also move them to Flora later with the conversion tool.
     
  25. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,450
    I think just masking by the material of a mesh (the submesh), although I’m not sure what shader evaluation means in this case :)
     
  26. colin_young

    colin_young

    Joined:
    Jun 1, 2017
    Posts:
    243
    What I mean by "non-destructive" is with MV the entire terrain is rebuilt, from scratch on every change. If you tried to combine that with painting tools, anything you've painted on would get overwritten, unless there was a way to replay the painting actions. MV uses stamps to achieve it's magic, and it doesn't seem unreasonable that Flora could take a similar approach for the painting, assuming you thought it was useful. Many other terrain/vegetation generator tools are similarly non-destructive, at least to some extent, at least making it easy for the user to regenerate their terrain/vegetation. The usual process with MV is to paint the details/trees you want to place manually, and then create a copy stamp that you insert into your MV stack so it gets replayed on each rebuild. That's kind of backwards to what would be needed for Flora.

    A one-time import from a generated terrain/vegetation placement obviously wouldn't have that problem, but if you're painting additional vegetation on the terrain, after creating procedural vegetation with a tool like MV, there's always going to be the temptation to modify MV stuff, or to do so accidentally, and getting your additional painted details wiped out -- although given that you are storing those in a different structure, perhaps that's not such an issue, and the import could be a build-time step.

    As has been noted in this thread, MV is stripped at runtime, and it's always possible to remove it from the editor once you've completed your terrain work, so the one-time import would be a useful feature. I've heard rumors that there are people who finish designing their terrain and vegetation and stop tweaking things, but I don't really believe they exist :)

    If I were you, I'd take a look at MV's features and Discord. Jason has encountered and solved a number of performance-related issues dealing with terrain and inserting tree data. Might be worth reaching out to him to see if you could also take advantage of any of those for the editor side of things.
     
  27. colin_young

    colin_young

    Joined:
    Jun 1, 2017
    Posts:
    243
    One other question -- is Flora compatible with The Vegetation Engine shaders?
     
    Lars-Steenhoff likes this.
  28. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80
    @TauntGames
    Update is on the store with the fixes for those errors.

    @Lars-Steenhoff
    Ah okay, ya that should be pretty simple. It's mainly a UI problem. I'll see what I can do.

    @colin_young
    Gotcha. Ya the included tools are destructive, but procedural tools aren't out of the question. As for MV, I'm leaning towards having terrain details render with Flora out of the box. This way you can use any procedural asset with Flora, and if you want more fine-tuned control of instances you'll be able to move them to a Flora container later using the conversion tool.

    As for The Vegetation Shaders, they won't work out of the box, but all they would need is to include the Flora.hlsl header. I'll add a shader patcher soon so you don't have to do this manually.
     
    Last edited: Jul 25, 2023
    TauntGames and Lars-Steenhoff like this.
  29. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,450
    The Vegetation Engine Shaders compatibility is very welcome! Thanks for adding that too, which makes me wonder if Amplify imposters for the last LOD stage are also going to be supported?

    Or if you have an automatic way to create imposters for the far away objects potentially getting even better performance
     
  30. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,450
    One example use case I have in mind is that on a terrain or mesh when there is a texture that has brown / green / blue for example I can set it to only paint from a grass collection on the green texture and from a rocks collection on the brown and underwater plants collection on the blue parts of the texture. same for materials I can set it to only paint on a certain material. And yes mostly a UI thing to make it easy to use.

    A bit like in photoshop you can choose a color range and then make a selection out of that, allowing to only work on that color range.

    I would be extra nice to have the color density ( range falloff ) optionally affect the size of the painted object too, but only optional as a user setting.

    I imagine a flood fill option for that color / material collection to be nice to have too.

    hope it's clear what I mean, I can create a mockup video too to show in more details if needed.

    And for this function it would be really good to have the model preview like in that video I showed before painting so you get feedback on what will be painted.
     
  31. colin_young

    colin_young

    Joined:
    Jun 1, 2017
    Posts:
    243
    For TVE, it might be worth getting in touch with Boxophobic. He is already including support for NR, GPUI, etc. with TVE and would probably be open to also adding Flora to the TVE shader setup tool.

    Looking forward to when I have the budget to pick up Flora (Unity is a hobby thing for me, not my job, so "budget" refers to both $ and time -- I've got a very long list of things I'm supposed to be working on instead of messing around with Unity).
     
    Lars-Steenhoff likes this.
  32. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    269
    Hi there, the system is very interesting.
    I've looked at the feature set, just curious is there way to destroy instance on demand? for example gameplay script bomb an area and remove instances?
    The promo video have LOD popping though, do you have an eta to add cross fade?
     
  33. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80
    So submesh selection isn't too hard as that's easily accessible, but if you mean actually masking by what the target material is outputting (e.g. a specific color or range of colors)... that's really tough, and might not be possible. I would have to hook into the target object's shader somehow, and I don't think there's any good way of doing that in Unity.

    This is only the case for meshes though - the terrain has standard textures that determine where layers are painted; so masking by terrain layers is already included with the current paint tool.


    Currently only thing required for Flora to work with a shader is:
    Code (CSharp):
    1. #include "Assets/Magnetic Arcade/Flora/ShaderLibrary/Flora.hlsl"
    2. #pragma instancing_options procedural:FloraInstancingSetup
    Not a fan of the hard codded path there, so that might change... It's much easier with ShaderGraph, you can just use the FloraInstancingSetup SubGraph before the vertex position slot.

    That's all that Flora really needs to work. I haven't used Amplify's imposter setup so I can't say for sure, but I can't think of a good reason why you wouldn't be able to use it with Flora (or any shader). As for automatic imposters, that could be something for a future release, but it's not currently planned.


    Thanks for this, I'll look into it. As far Flora, totally get it, appreciate the input either way!


    You can definitely remove instances on demand. The API is a little clunky right now, but here's an example of how you can remove instances of a certain type within a bounding box:
    Code (CSharp):
    1.  
    2. /// <summary>
    3. /// Removes all instances of the given prototype inside the given bounds.
    4. /// </summary>
    5. /// <param name="container">The container to remove instances from.</param>
    6. /// <param name="prototype">The prototype to remove instances of.</param>
    7. /// <param name="worldBounds">The bounds to remove instances inside.</param>
    8. public void RemoveFloraInstancesInsideBounds(FloraContainer container, FloraPrototype prototype, Bounds worldBounds)
    9. {
    10.     // Iterate over all cells in the container that are inside the given bounds.
    11.     foreach (FloraCell cell in container.GetCellEnumeratorInWorldBounds(worldBounds))
    12.     {
    13.         // Check if the cell contains a renderer for the given prototype.
    14.         if (cell.Renderers.TryGetValue(prototype, out FloraInstanceRenderer renderer))
    15.         {
    16.             // Get the indices of all instances inside the given bounds.
    17.             NativeArray<int> instancesToRemove = renderer.GetInstancesOverlappingBox(worldBounds, Space.World, Allocator.Temp);
    18.        
    19.             // Remove the instances from the renderer.
    20.             renderer.RemoveInstances(instancesToRemove.AsSpan());
    21.         }
    22.     }
    23. }

    Admittedly the assets in that scene don't have the best LOD transitions. They were created in SpeedTree, and since you can't include SpeedTree assets in a published asset, they don't have the required SpeedTree data or shader to use their smooth LOD method. If you were using a native SpeedTree asset with a SpeedTree shader, they would transition better.

    However, I do have cross-fading planned, but it will probably be about a month before it's implemented in Flora.
     
    Last edited: Jul 27, 2023
    Lars-Steenhoff and Spikebor like this.
  34. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    269
    Thanks, a user gave you 1 star review because the email cannot reach. Maybe there is typo in your email that you provide on the store, maybe check that out...
     
  35. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80
    @Spikebor Yikes, thank you for letting me know!
     
    Spikebor likes this.
  36. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,450
    Flora support for the Vegetation Engine will be added by @BOXOPHOBIC and that should also support the amplify imposters, will test it soon.
     
    rrahim and MA-Rob like this.
  37. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    481
    Hi there, I added the support, however, I'm unsure if the renderinglayer part is ignored in BIRP or will throw some error.
     
    Neiyra likes this.
  38. Neiyra

    Neiyra

    Joined:
    Apr 19, 2016
    Posts:
    28
    Hi there, that looks really promising!

    I am very interested in buying it, but I would like to know if it´s possible to use it at runtime.
    I don´t bother about clunky APIs :), but my game includes an World Builder Tool for the Players.
    So I have no pre-saved terrains or terrain scenes, terrain data is read from disc and the terrains are created from scratch at runtime, including detail layers.
    This works fine with all assets that rely on unitys terrain detail system, but as the detail system is quite slow and laggy, I would highly prefer to switch to a soultion like yours.

    So, is it possible to set up and use flora at runtime? Create the container and populate the cells the same way they were painted?
    Can I use the method that creates a Flora Prototype at runtime, too? And is it possible to make the paint tools work at runtime? I would really appreciate to include them in the World Builder Tool instead of writing new ones from scratch. :)

    Oh, and I agree - a converter tool for existing terrain vegetation would be awesome. :)
     
  39. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80
    First, thank you for putting in that work!

    Second, I'm pretty sure it's ignored in BIRP, however on re-evaluating the rendering code I don't think Unity uses that option anymore (it just depends on a global multi_compile). I'll test it more in depth, but I believe that line should just be:
    Code (CSharp):
    1. #pragma instancing_options procedural:FloraInstancingSetup
    Thanks again!

    The tools are currently editor only as is a lot of their functionality (a lot of the way instances are tracked are currently only available in the editor). However, nothing would stop you from adding types and instances at runtime, but this isn't documented and the API is likely to change. It's a bit cumbersome right now, and I want to work to improve that, but first I'm focusing on the Editor tools and experience (as well as general stability).
     
    Neiyra and Lars-Steenhoff like this.
  40. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    481
    Np :) It was actually quite easy to add, I already have everything in place to inject code in my shaders.
    I removed the renderinglayer option, looks like the other instanced indirect renderers are not using it as well.

    Congrats on the release and keep up the good work!
     
    MA-Rob and Lars-Steenhoff like this.
  41. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80
  42. Bwacky

    Bwacky

    Joined:
    Nov 2, 2016
    Posts:
    171
    Hello, have a few questions before biting the bullet and grabbing the asset:
    1. I see the spawning capability but is there a projection option? I use some rocks & cliffs with a projection shader to drop grass on top of rocks, and I'd like for vegetation to grow on top of them based on the object rotation & world top-down projection.
    2. Can we use any shaders with Flora or are we tied to using your specific set of shaders made for the tool?
    3. Any online documentation I can take a look at before buying? Would like to check out the workflow and if it fits to what I got going on now.
    4. How's Flora compared to something like Nature Renderer or GPUI which hook directly into the terrain? Meaning - is this a good alternative or more of an additional tool I can use on top?
    5. Does Flora support self-Oclussion Culling like GPUInstancer does or nay?
    6. Does it work for all sorts of objects (eg. Trees as well) or just detail objects?
    7. Does it hook any way into the terrain system and can it take over my currently painted details? If not, can I convert my existing painting to Flora and have it work? I'm using spawners like Microverse for placement and having them render via Nature Renderer right now - they don't collide with one another which is a great toolset for massive open-world scenes.
    8. LOD Cross-Fading support? :)

    Sorry for the question wall and thanks in advance!
     
    Zaddo and MA-Rob like this.
  43. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    111
    Congrats with your release.

    note

    Code (CSharp):
    1. #include "Assets/Magnetic Arcade/Flora/ShaderLibrary/Flora.hlsl"
    2. #pragma instancing_options renderinglayer procedural:FloraInstancingSetup
    In ASE you can optimize each pass as needed by only including to specified pass.
    upload_2023-7-26_16-40-54.png

    to set for different SRP versions if need
    multiple passes are defined with semicolon separators.
    e.g Forward;GBuffer

    if all SRP versions just leave it blank
     
    MA-Rob and Lars-Steenhoff like this.
  44. fendercodes

    fendercodes

    Joined:
    Feb 4, 2019
    Posts:
    190
    I'm interested in the answers to some of these questions too. We're currently using MicroVerse with Nature Renderer and TVE shaders. Would be great to have Flora automatically work with existing terrain details procedurally placed by MV. I could do a side-by-side benchmark then and report back.

    Ultimately, being able to paint extra instances of trees or details on cliff meshes would be a huge benefit to our workflow. Especially if they're being instanced together with the stuff on the terrain.
     
    MA-Rob, Bwacky and Lars-Steenhoff like this.
  45. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80
    Sorry, can you explain what you mean by projection? Do you mean masking by the surface angle (slope), height, etc.?

    Any shader should work, as long as the Flora shader header is included. However, I'm working on a shader patching tool to make this process easier.

    Unfortunately, I don't have any online documentation yet, but we're working on a full site with comprehensive documentation. For now, here's a link to the getting started PDF: Getting Started

    Flora is similar to those tools, but currently stores instances outside of the terrain system (allowing you to paint on meshes). I'm going to add support for terrain details and trees, but it hasn't been added yet. There's nothing stopping you from using both right now, but it would probably be a bit performance intensive having two separate instancing solutions running at the same time.

    Not yet, however it's not out of the question for a future release.

    Yes, it works with any kind of object. Flora can also spawn instances of the prefab model (GameObjects). This allows you to get things like collision and use gameplay scripts, while also being rendered with the instancing system. You wouldn't want to do this with objects that have tens of thousands of instances though, as it has to spawn GameObjects, which would be slow in of itself.

    As mentioned above, this isn't supported yet, but I plan on integrating the terrain's system with Flora. I'm also working on a conversion tool that can bring types of instances into Flora.

    Not yet, but it'll be coming in an update.

    Thank you! I've been considering adding either an ASE template or nodes to support Flora with ASE. What do you consider the best way to support ASE, or the one that is the least amount of friction for ASE users?

    Considering how important this has been for everyone (it's the most asked question by far), I'm going to add support for rendering the terrain details and trees with Flora. I'm working on it now, but it'll probably be a few weeks before it's added in an update.

    Being able to place instances on meshes, like cliffs, that also take advantage of instancing, is a huge reason we created Flora.
     
    Bwacky and Lars-Steenhoff like this.
  46. fendercodes

    fendercodes

    Joined:
    Feb 4, 2019
    Posts:
    190
    Looking forward to the update. In regards to cliffs - as @Bwacky mentioned it would be great to have a way to procedurally place instances only on parts of the mesh that have a certain angle. For example, trees on ledges of a cliff. We also clone and rotate our cliffs in different ways so manually painting the ledges wouldn't be possible.
     
    MA-Rob likes this.
  47. Bwacky

    Bwacky

    Joined:
    Nov 2, 2016
    Posts:
    171
    Should've specified, my bad!
    I'm using a bunch of shaders like Better Lit, TVE Prop Shader, and a handful of others that have a projection capability, where, at a certain angle I can specify (usually top-down) I can paint a different texture on a mesh based on the world position of the object and the object rotation. We use this mostly for rocks, cliffs, overhangs, etc.

    What I meant was if there's some way to have a mesh or two render not based on the object's rotation but in world space, projected top to bottom on top of the mesh.

    The below gif shows a rock with projected grass on it. Would be great if we could project a mesh on top of a rock this way.

    https://imgur.com/a/Mc80E72
     
    fendercodes and MA-Rob like this.
  48. Amplify_David

    Amplify_David

    Joined:
    Mar 29, 2023
    Posts:
    111
    reach out to me in discord if you need help
    i should be easy
     
    MA-Rob likes this.
  49. MA-Rob

    MA-Rob

    Joined:
    Sep 10, 2014
    Posts:
    80
    Ah okay I see, I could definitely add a component that you could add to a MeshRenderer or LODGroup game object that would procedurally place instances depending on the rotation of the mesh. I'll look into it!

    Will do, thank you!
     
    fendercodes likes this.
  50. fendercodes

    fendercodes

    Joined:
    Feb 4, 2019
    Posts:
    190
    Nice. Have purchased Flora now whilst it's at 50% off. Looking forward to the updates.
     
    MA-Rob likes this.