GenesisKeywords
GenesisKeywords is a static utility that maps the type-safe GenesisFeature enum to the shader keyword strings Genesis compiles against, and helps prewarm variants before they first render. You normally toggle features through GenesisMaterial.EnableFeature; reach for this class directly only for prewarming or low-level keyword work.
using Genesis.Runtime;
// Prefer the typed path on a material:
gm.EnableFeature(GenesisFeature.Dissolve);
// Use GenesisKeywords for prewarming and keyword lookups:
string kw = GenesisKeywords.GetKeyword(GenesisFeature.Hologram); // "GENESIS_HOLOGRAM"
GenesisKeywords.Prewarm(GenesisFeature.Hologram);Every feature is gated by a multi-compile keyword, and each on/off combination is a separate compiled variant. Toggling a keyword that has never rendered triggers on-demand compilation — visible as a stall. Prewarm the variants you switch into at runtime.
GenesisFeature enum
Methods
Examples
Prewarm the variants a scene toggles at runtime
using Genesis.Runtime;
using UnityEngine;
public class VariantWarmup : MonoBehaviour
{
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
static void Warm()
{
GenesisKeywords.PrewarmAll(
GenesisFeature.Dissolve,
GenesisFeature.Hologram,
GenesisFeature.HitEffect);
}
}Build a ShaderVariantCollection entry from a feature
string keyword = GenesisKeywords.GetKeyword(GenesisFeature.IntersectionGlow);
// keyword == "GENESIS_INTERSECTION_GLOW"The most common shipping bug from this API: a script toggles a feature that was not present in any scene at build time, so its variant was stripped and must compile on demand — a visible hitch on slow GPUs. Prewarm aggressively, and prefer GenesisMaterial.EnableFeature over raw Material.EnableKeyword so the inspector and bookkeeping stay in sync.