Skip to Content
DocumentationScripting APIEffects API

GenesisEffects

Namespace: Genesis.Runtime · Assembly: Genesis.Runtime.dll · Inherits: System.Object

GenesisEffects exposes the gameplay-facing FX of a Genesis material — dissolve, hologram, hit flash, intersection glow, and fade-by-distance. It is reached through GenesisMaterial.Effects and includes both immediate setters and time-driven Play* helpers.

using Genesis.Runtime; var gm = new GenesisMaterial(GetComponent<Renderer>()); gm.Effects.PlayHitFlash(Color.red, 0.15f); gm.Effects.SetDissolveAmount(0.5f); gm.Apply();

The Play* methods return a Coroutine started on a shared runner and call Apply() internally each frame — you do not need to manage the MaterialPropertyBlock flush yourself for those. Plain setters still require gm.Apply().

Properties

DissolveAmount
property
public float DissolveAmount { get; set; }

The clip threshold, 0 (solid) to 1 (fully dissolved). Maps to _DissolveCutoff. See Dissolve.

Returns float

HitAmount
property
public float HitAmount { get; set; }

Drives the hit flash, 0 (off) to 1 (full tint). Maps to _HitEffect. See Hit Effect.

Returns float

HologramColor
property
public Color HologramColor { get; set; }

Base HDR tint of the Hologram effect. Maps to _HologramColor.

Returns Color

Methods

SetDissolveAmount(float)
method
public void SetDissolveAmount(float amount)

Sets the dissolve clip threshold directly, enabling the GENESIS_DISSOLVE keyword. See Dissolve.

Parameters

NameTypeDescription
amountfloatClip threshold, 0–1. 0 = solid, 1 = fully dissolved.

Returns void

PlayDissolve(float, bool)
coroutine
public Coroutine PlayDissolve(float duration, bool reverse = false)

Animates the dissolve over time and applies each frame. Returns the running Coroutine so you can stop it.

Parameters

NameTypeDescription
durationfloatSeconds to dissolve from 0 to 1.
reverseboolWhen true, re-materializes from 1 back to 0. Defaults to false.

Returns Coroutine

PlayHitFlash(Color, float)
coroutine
public Coroutine PlayHitFlash(Color tint, float seconds = 0.15f)

Spikes _HitEffect to 1 and animates it back to 0 over seconds, giving the classic damage flash. See Hit Effect.

Parameters

NameTypeDescription
tintColorFlash color. White, red, or gold are typical. Maps to _HitColor.
secondsfloatDecay time. Defaults to 0.15.

Returns Coroutine

EnableHologram(Color)
method
public void EnableHologram(Color color)

Turns on the Hologram effect with the given base tint, enabling the GENESIS_HOLOGRAM keyword.

Parameters

NameTypeDescription
colorColorBase HDR tint. Multiply past 1.0 for bloom.

Returns void

SetIntersectionGlow(Color, float)
method
public void SetIntersectionGlow(Color color, float width = 0.25f)

Enables the depth-based Intersection Glow and sets its HDR color and world-space width.

Parameters

NameTypeDescription
colorColorHDR glow tint. Maps to _IntersectionColor.
widthfloatWorld-space distance the glow fades over, 0–2. Defaults to 0.25.

Returns void

SetFadeDistance(float, float)
method
public void SetFadeDistance(float start, float end)

Configures Fade by Distance, fading surface alpha between the start and end camera distances.

Parameters

NameTypeDescription
startfloatCamera distance where the fade begins. Maps to _FadeStart.
endfloatCamera distance where the surface is fully faded. Maps to _FadeEnd.

Returns void

Examples

Dissolve a defeated enemy

using Genesis.Runtime; using UnityEngine; public class Death : MonoBehaviour { [SerializeField] Renderer target; GenesisMaterial gm; void Awake() => gm = new GenesisMaterial(target); void OnDestroy() => gm.Dispose(); public void Die() { gm.Effects.PlayHitFlash(Color.white, 0.1f); gm.Effects.PlayDissolve(1.2f); } }

Reveal a hologram on interact

public void ShowHologram(GenesisMaterial gm) { gm.Effects.EnableHologram(new Color(0.3f, 0.9f, 1f) * 2f); gm.Effects.PlayDissolve(0.5f, reverse: true); }

PlayHitFlash and PlayDissolve allocate one coroutine per call. For projectiles or bullet-hell volumes that flash hundreds of renderers per frame, pool the effect or drive HitAmount directly from a single update loop instead of starting a coroutine each hit.

See also

Last updated on