Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Extra cost for Exposed properties on VFX Graphs

Discussion in 'Visual Effect Graph' started by kid_kraken, May 16, 2024.

  1. kid_kraken

    kid_kraken

    Joined:
    Jul 12, 2017
    Posts:
    2
    Hey folks,

    I'm fairly new to VFX Graph and do VR development. I'm trying to be mindful of memory costs and keep my VFX as optimized as I can.

    One of our Tech Artists showed me the cost of write vs read/write in the System Attribute Summary and I'm wondering if there is a appreciable cost to exposed properties. As a house keeping rule, I've only been exposing the properties that might need to be accessed outside of the graph. I've noticed some of the VFX authored before I joined have almost everything exposed.

    Cheers!
     
  2. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    328
    Hi!

    Regarding attribute payload, it has a direct impact on memory footprint yes. In VFX Graph attribute payload per particle is derived at compile time for a given graph (depending on which attributes are used, and read/write where). The payload can be directly looked at per system using the new profiling overlay.

    For exposed properties, it can have a bit of memory cost but this will be neglectable in general (as it is per graph instance not per particle). Basically for each exposed properties we have to keep an override per instance. It also potentially disables some optimization we perform at graph compilation for runtime (like constant folding the branches of the graph that can be statically evaluated. As soon as there's an exposed properties as input to a branch, it cannot be evaluated at compile time anymore).

    But all this should not really drive how you define your set of exposed properties for a given graph. You should more focus on building a clean and understandable interface with exposing what is needed to customize the effect based on the desired modularity. So the consideration should be more about design, authoring pipe and integration with FX artist (who create the FX) and Level Designers (who intantiate and tweak the FX in scene) rather than underlying implementation details.
     
    minte131 and kid_kraken like this.