Foliage Renderer Object Module
1327
post-template-default,single,single-post,postid-1327,single-format-standard,bridge-core-3.2.0,ajax_fade,page_not_loaded,,qode_grid_1300,footer_responsive_adv,qode-content-sidebar-responsive,qode-child-theme-ver-1.0.0,qode-theme-ver-23.2,qode-theme-bridge,disabled_footer_bottom,qode_header_in_grid,wpb-js-composer js-comp-ver-7.7.2,vc_responsive

Foliage Renderer Object Module

Foliage Renderer Object Module

Extend your Foliage Renderer workflow with the ability to submit individual GameObjects straight from your scene to FoliageRenderer’s IndirectRenderer.

Foliage Renderer Object Module (FROM) extends and REQUIRES Foliage Renderer! Make sure your project is already utilizing Foliage Renderer (FR) and you have it installed!

For the latest version of FROM we recommend you:

  • Join the DWD Discord
  • Follow the directions in the documentation channel to gain Github Access
  • Now you can stay up to date with the latest version of FROM!

Working with FROM

FROM is very easy to work with, and will merge with your existing Foliage Renderer workflow!

  1. Install FROM via the PackageManager
  2. Find a GameObject in your Scene you want to Render via the FR IndirectRenderer, or drag the included ‘IndirectCapsuleExample’ into your Scene.
  3. If you’re not using the example Prefab… Click ‘Add Component’ in the Inspector Panel
    • Navigate to ‘Foliage Renderer > Providers > Indirect GameObject Provider

Great job! Now your GameObject will render via the IndirectRenderer! From here you can configure a few settings to adjust the behaviour of the Indirect GameObject Provider.

Like all Provider Components in the FR ecosystem, there are several Update Settings:

  • Update Settings
    • Force Refresh On Enable: If enabled, when this Component or GameObject’s OnEnable function would be called, this Provider will Refresh its Draw data and Register with the IndirectRenderer.
    • Update On Transform Changed: If enabled, when this Component is moved it will Refresh its Draw data.
    • Update Timing: At what point in the Update loop should this Provider actually resolve any queued Refreshing.

Additionally, Indirect GameObject Providers have a few extra GameObject Settings:

  • GameObject Settings
    • Toggle Default Renderers: When enabled, this Provider will disable any Child Renderer components when it is enabled. And it will re-enabled those Child Renderer components when it is disabled.
    • Draw Type: This determines the “kind” of Object you wish to render and what Overrides it will use in the FR Indirect Draw Manager. Options are; Tree, Detail and Object.

IndirectGameObjectProvider API

The base functionality of Indirect GameObject Providers should “just work.” However, you may need some direct control for your Project. In addition to the public functions you will find on IndirectProviderBase there are a few methods to know about.

EnableDefaultRenderers(bool enabled): This function turns the array of Child Renderer Components on/off depending on the passed in bool.

SetRenderObject(GameObject go): This lets you assign the GameObject to be rendered by this Provider. Remember, at runtime Unity no longer “knows” about Prefabs, they are an edit time concept. If at runtime you are constructing an IndirectGameObjectProvider, you may wish to pass in a reference to the rendered GameObject so it collates into the IndirectDrawManager with existing instances. In most expected use cases, this should be unnecessary.