Skip to content

LightDraw

namespace Griff.Runtime;
public struct LightDraw

A light to draw: its middle in the world, how far it reaches, its color times its brightness, and its softness.

public IReadOnlyList<ShadowEdge> Casters { get; init; }

For a light with Shadows: the sides that cast its shadows (see CastersFor). Empty for a light without, or with nothing in its way.

public Vector2 Center { get; init; }
public Color Color { get; init; }
public float Radius { get; init; }
public float Softness { get; init; }
public Vector3 At(Vector2 point)

How much light it puts on point, per channel.

public void Deconstruct(out Vector2 Center, out float Radius, out Color Color, out float Softness)
public override bool Equals(object obj)
public bool Equals(LightDraw other)
public override int GetHashCode()
public override string ToString()
public static Color Total(Color ambient, IReadOnlyList<LightDraw> lights, Vector2 point)

The light reaching point: ambient, the light everything gets, plus each of lights, each channel at most 1.