Search Unity

Semver, backwards compatibility, VisualEffect & Addressables

Discussion in 'Visual Effect Graph' started by Timboc, Feb 21, 2022.

  1. Timboc

    Timboc

    Joined:
    Jun 22, 2015
    Posts:
    238
    Apologies for being relatively new to Visual Effect Graph and if I've missed an overview of this somewhere, I'd appreciate being pointed in the right direction.

    We bundle VisualEffects as part of our addressables pipeline.
    We've just discovered that loading a bundle published with VisualEffectGraph 12.1.2 completely fails to load and display properly in a project (main app) using 12.1.4.

    Shouldn't this be a major version increase as opposed to patch?
    Is this because there are editor upgrade paths that it's considered backwards compatible in editor?
    Also being relatively new to this, how often should we expect backwards compat to be broken?

    Currently we're considering publishing a new bundle per version of Visual Effect Graph as we need our content to be backwards compatible.

    I also want to check that it sounds like:
    a) we would need to do this for every version no matter the Major/Minor/Patch indicator that our main app ever uses
    b) we can rely on edit-time backwards compatibility?
    That is to say, loading a VFX Graph authored in e.g. 12.xxx will be reasonably (understandably not necessarily 1:1) upgraded to e.g. 14.xxx when loaded in a newer version of the editor? Or if indeed semver is being used for editor rather than runtime, does that mean no guarantee but an attempt? Or is this a URP dependency/issue? Working out how to juggle this.

    Many thanks in advance.
     
    Last edited: Feb 21, 2022
  2. PaulDemeulenaere

    PaulDemeulenaere

    Unity Technologies

    Joined:
    Sep 29, 2016
    Posts:
    154
    Hello,
    Sorry for the late answer, we had to gather some informations first.

    The VisualEffectAsset contains a set of instructions for the CPU evaluation. Sometimes, we have to add or modify this definition. In that case, we are updating the runtime version of the VisualEffectAsset which will invalidate your previously produced Asset Bundle/Addressables.

    Indeed, we incremented the version with 2021.2.11f1 (which corresponds to the release of 12.1.4, if you are curious, this is a consequence of the resolution of this issue)

    The VFXManager is serializing the runtime version in your project (see the content of ProjectSettings/VFXManager.asset), even if it isn't public, you can track this value to detect when runtime data has been changed. We are going to improve our communication in the upgrade guide to indicate when an export with VFX must be regenerated.

    We are ensuring compatibility of editor data even between major editor versions of Unity, the VisualEffectAsset is automatically upgraded at import time.

    The VisualEffectAsset also relies on the SRP behavior, the material expectation could have changed or shader pass name. Thus, if possible, it's recommended but not mandatory to upgrade your AssetBundle for every new runtime version.

    I hope it helps, let me know if you have any question or need clarification.
     
    Timboc and Vita- like this.
  3. Timboc

    Timboc

    Joined:
    Jun 22, 2015
    Posts:
    238
    This is incredibly helpful - we really appreciate the comprehensive response - thank you.