Table of Contents

Class MsdfRenderer

Namespace
Kroltan.Keen.Compute
Assembly
me.kroltan.keen-vectors.dll

Generates a MSDF texture from a sequence of curve bounds.

public class MsdfRenderer : IDisposable
Inheritance
MsdfRenderer
Implements
Inherited Members

Methods

AddRange(ArraySegment<Curve>)

Adds a sequence of curves to be drawn.

public void AddRange(ArraySegment<Curve> curves)

Parameters

curves ArraySegment<Curve>

Curves in canvas pixel coordinate space. No structure is assumed from the array, this only takes an array for performance purposes.

Remarks

MsdfRenderer takes ownership of this segment until it is disposed or generated, so if this segment came from a pool, it can only be released back to it afterwards.

Dispose()

public void Dispose()

Generate(Vector2Int)

Consumes this object to render the distance field.

public Texture2D Generate(Vector2Int dimensions)

Parameters

dimensions Vector2Int

Returns

Texture2D

SimpleEdgeColoring(Span<Curve>, float)

Writes a simple coloring scheme for each edge.

public static void SimpleEdgeColoring(Span<Curve> edges, float maximumStraightDegrees)

Parameters

edges Span<Curve>

A sequence of curves forming a closed path.

maximumStraightDegrees float

Sequential edges whose tangents form an inner angle larger than this are considered a straight line.