Skip to main content

Module sdf_batch

Module sdf_batch 

Source
Expand description

SDF-aware instanced glyph batch rendering.

Adapts the existing GlyphInstance / GlyphBatcher approach for SDF rendering:

  • Same VBO/instance layout, but rendered with sdf_glyph.frag
  • Automatic smoothing calculation based on glyph screen-space size
  • Scale-dependent threshold for consistent edge quality at all sizes
  • Per-glyph SDF effects (outline, shadow, glow, bold, wave, glitch)

Structs§

PendingSdfGlyph
Pending SDF glyph submission.
SdfBatchStats
SdfBatchUniforms
Uniforms that are set once per SDF draw call (not per-instance).
SdfGlyphBatch
A batch of SDF glyph instances ready for rendering.
SdfGlyphBatcher
Builds and sorts SDF glyph batches each frame.
SdfInstanceExtra
Per-instance SDF-specific data that supplements the base GlyphInstance.

Functions§

layout_sdf_text
Lay out a string of text using the SDF atlas metrics and return GlyphInstance
layout_sdf_text_with_effects
Lay out text with SDF effects applied.