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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

confuse about procesural properties caching

Discussion in 'Scripting' started by CyberTurboPlays, Oct 19, 2015.

  1. CyberTurboPlays

    CyberTurboPlays

    Joined:
    Nov 7, 2014
    Posts:
    65
    hi there
    i just got to play around with substance procedural mat with unity, and i was playing around with run-time modifying property and rebuilding it, thats all fine, but when i read about the parts regarding property caching, the documentation just confuses me.

    quote from unity manual:
    from the above, it seems like i should enable caches for properties that will not be modified in run-time, and whenever a rebuild is requested, it sounds like those cached properties will help speedup/optimize the rebuild, right? (edited: how do i inform unity about variables that will not change to help it cache? Set ProceduralMaterial.CacheProceduralProperty true? or false?)

    quote from scripting reference for ProceduralMaterial.CacheProceduralProperty:
    from the above, its saying cache all properties that you expect to be tweaking, and the fewer properties marked cache true, the more efficient when rebuilding happen! so, what exactly happen to the cached properties when a rebuild occurs? are those cached properties being reused in the rebuild? or are they force flushed and cached again and causing rebuilding not efficient?

    so, my question is:
    should i cache as much non-runtime tweaking properties as possible for performance optimization, or should i not?
    (edited: maybe i should be asking should i set cache TRUE for runtime tweaking properties, or NON-runtime tweaking properties)
     
    Last edited: Oct 19, 2015
  2. CyberTurboPlays

    CyberTurboPlays

    Joined:
    Nov 7, 2014
    Posts:
    65
    no one can clearify this a bit for me?