Class WorldTextRenderer
Draws every WorldTextComponent as text standing in the 3D scene rather than over it.
public class WorldTextRenderer : SceneRendererBase, IComponent, IReferencable, ICollectorHolder, ISceneRenderer, IRenderCollector, IGraphicsRenderer, IGraphicsRendererBase, IGraphicsRendererCore, IDisposable
- Inheritance
-
WorldTextRenderer
- Implements
- Inherited Members
Remarks
WorldTextProcessor adds one to the scene's compositor when the scene has a WorldTextComponent. Each text is drawn at its entity's transform, scaled by perspective and, by default, hidden by geometry in front of it.
How it works, and what it costs. SpriteBatch can be given explicit view and
projection matrices, which turns its 2D quads into geometry positioned in world space. Folding each
text's world matrix into the view matrix places and orients it, and the depth state decides whether
the scene occludes it. The catch is that the matrices belong to the batch rather than the draw call,
so each text needs its own Begin/End pair and therefore its own draw call: fine for
tens of labels, not for thousands.
Fields
ProfilingKey
The block the profiler shows this renderer's GPU time under.
public static readonly ProfilingKey ProfilingKey
Field Value
Methods
Destroy()
protected override void Destroy()
DrawCore(RenderContext, RenderDrawContext)
protected override void DrawCore(RenderContext context, RenderDrawContext drawContext)
Parameters
contextRenderContextdrawContextRenderDrawContext
InitializeCore()
protected override void InitializeCore()