GenesisAnimation
GenesisAnimation controls the shader-driven motion of a Genesis material — vertex animation modes (wind, wave, jelly, …) and UV animation (scroll, wave, distortion). It is accessed through GenesisMaterial.Animation; all motion runs on the GPU from _Time, so there is no per-frame CPU cost once configured.
using Genesis.Runtime;
var gm = new GenesisMaterial(GetComponent<Renderer>());
gm.Animation.SetVertexAnimation(GenesisVertexAnim.Wind);
gm.Animation.SetUVScroll(new Vector2(0.1f, 0f));
gm.Apply();Because animation is time-based on the GPU, you typically configure it once and never touch it again. Use VertexAnimPhase from a per-instance MaterialPropertyBlock to de-sync a crowd of identical meshes without breaking batching.
Properties
Methods
Examples
Animate foliage with de-synced wind
using Genesis.Runtime;
using UnityEngine;
public class Foliage : MonoBehaviour
{
[SerializeField] Renderer target;
void Start()
{
var gm = new GenesisMaterial(target);
gm.Animation.SetVertexAnimation(GenesisVertexAnim.Wind);
gm.Animation.SetVertexAnimDirection(Vector3.up);
gm.Animation.VertexAnimStrength = 0.3f;
gm.Animation.VertexAnimPhase = Random.value; // de-sync this instance
gm.Apply();
gm.Dispose();
}
}Scroll a conveyor belt texture
public void StartBelt(GenesisMaterial gm, float speed)
{
gm.Animation.SetUVScroll(new Vector2(speed, 0f));
gm.Apply();
}Setting VertexAnimPhase (or any per-instance property) directly on a shared material instances it and breaks the SRP Batcher. Always drive per-instance offsets through a GenesisMaterial(Renderer), which routes them through a MaterialPropertyBlock.