Go back to documentation on product:

Zibra Effects

Zibra Liquid

<aside> đź’ˇ If you want to have a Zibra Liquid instance pre-filled on startup you will need to use Initial State baking.

After baking, the Zibra Liquid instance will remember its initial state and will start simulation from it. Note that we do not support baking animation, simulation over time, etc. Simulation itself is always performed on the device in real time, only the initial state is baked.

Initial State Baking will simulate the first N seconds of your liquid instance, save it, and simulation in play mode will start from that point.

Note that after changing some parameters you’ll have to rebake your liquid, specifically: Grid Resolution, Container Size (in case you changed the size non-uniformly, and as a result changed the Effective grid resolution), Max particle count (in case your baked state has more particles that the current max number).

</aside>

To bake initial state:

  1. If you haven’t already, add all emitters, voids, and colliders that you are going to have to your liquid.

  2. Open the baking utility and select your Zibra Liquid instance to bake.

    1. Open the Zibra Liquid Inspector and set Initial State to “Baked Liquid State”.

      Baked Liquid State.png

    2. Press “Open Zibra Liquid Baking Utility”

       “Open Zibra Liquid Baking Utility” .png

  3. Now you see the Baking Utility window

    Baking Utility window .png

  4. Set the Simulation time to the number of seconds you want to simulate.

  5. (optional) If you want to run a baking simulation with specific timestamp, you can disable “Use project fixed timestep” and set your desired “Simulation timestep”

    “Simulation timestep” .png

  6. Press “Run Simulation”. You’ll see the simulation running in Scene/Game view (only Game view on URP)

    “Run Simulation”.png

  7. (optional) If you want to run the simulation further, set the Simulation time to the amount of time you want to run simulation forward, and press “Run Simulation Forward”.

    “Run Simulation Forward”.png

  8. (optional) If you simulated too far, and want to start over, press “Stop” and go back to step 4

    stop.png

  9. Press “Save new state” to save baked state.

    “Save new state”.png

    That will save the new state to the file in the subdirectory next to your scene file. e.g. for Liquid Instance “ZibraLiquid1” in “/Assets/NewScene.unity” scene, liquid baked state will be saved into “/Assets/NewScene/” folder as “ZibraLiquid1BakedState.bytes”.

    9.1. If you already had a previous saved state you’ll have 2 buttons: “Save new state” and “Overwrite existing state”.

    “Overwrite existing state”.png

    9.2. “Save new state” creates a new file, while “Overwrite existing state” overwrites the old file with a new state.

  10. (optional) After you are done with baking, press “Stop” to stop the liquid simulation and unlock the parameters that are disabled when the liquid is “live”. Next time you’ll change a scene or enter playmode this state will reset, so you usually don’t need to manually stop it.