3D text: label, geometry or interface
Choose Label3D or TextMesh, control size and wall occlusion, and distinguish text from UI.
Choose the representation
| Task | Tool | Limitation |
|---|---|---|
| Character name or item caption | Label3D | World text, not a Control with focus and layout |
| Extruded sign lettering | TextMesh in MeshInstance3D | Actual glyph geometry; create collision separately |
| Menus, input fields and buttons | Control; optionally a SubViewport displayed in the world | Requires layout, focus and input routing, which Label3D does not provide |
Run an object caption
Use all three complete files from the camera example: LodVisual3D.cs, ViewLabMeshes.cs and ViewLab3D.cs. Use SDK 1.0.0, net10.0, run dotnet build and attach ViewLab3D.cs to the Entity3D root of a .rscene level. Leave UseWall=false before startup. Reckfell appears above the object; arrow keys change distance and angle.
Caption is a Label3D with FontSize=48, PixelSize=0.008 and Billboard=Enabled. World dimensions depend on the font, PixelSize and transform. FontSize alone is not a screen-size setting. Normal perspective makes distant text look smaller.
Captured in the current local runtime at distance 6 without a visible wall. This is game output, not the editor interface.
Size, rotation and walls
- Billboard=Enabled turns the label toward the camera. FixedY preserves the vertical axis, useful for upright world signs.
- FixedSize=true reduces apparent-size changes with distance. Checks at distances 6 and 18 retained approximately equal text area with unchanged FOV and viewport. This does not promise identical pixels across other FOV, DPI or window dimensions.
- NoDepthTest=false allows a wall to hide the label. Setting true shows it through the wall; use deliberately for markers.
Changing Text queues an update. Do not inspect final pixels in the same statement that changes the text. The test waits for completed frames. Supply a font covering Russian or any other required glyphs; a Latin caption does not demonstrate all-language coverage.
Create extruded letters
The complete helper below includes ViewLabMeshes.Text. It returns a TextMesh with FontSize=64, PixelSize=0.01 and Depth=0.15. Assign it to Mesh on a new MeshInstance3D, set MaterialOverride and position, then add the instance to the level. A TextMesh resource alone is not rendered. The main ViewLab3D creates a Label3D; it does not automatically add a TextMesh instance.
ViewLabMeshes.cs
using Reckfell;
public static class ViewLabMeshes
{
public static StandardMaterial3D Material(Color color) => new()
{
AlbedoColor = color,
ShadingMode = BaseMaterial3D.ShadingModeEnum.Unshaded
};
public static MeshInstance3D Box(Vector3 size, Color color) => new()
{
Mesh = new BoxMesh { Size = size },
MaterialOverride = Material(color)
};
public static TextMesh Text(string text) => new()
{
Text = text,
FontSize = 64,
PixelSize = 0.01f,
Depth = 0.15f
};
}This separate frame uses a MeshInstance3D with Mesh=ViewLabMeshes.Text("3D"), Position=(0,1,0), a white material from Material(Colors.White) and camera distance 6; the label, both models and floor are hidden. The front view does not clearly show extrusion: native checks separately confirm glyph geometry and AABB depth above 0.14.
Depth creates geometric thickness, not a physics shape. Label3D.GenerateTriangleMesh() is not a TextMesh substitute: the tested nonempty label produced only a two-triangle rectangle, not letter contours or an automatically added collider.
Diagnosis
| Problem | Check |
|---|---|
| Text is too small | PixelSize, FontSize, scale, distance and FOV |
| Caption is viewed edge-on | Billboard and Entity3D orientation |
| Text shows through obstacles | NoDepthTest; keep false for ordinary labels |
| Missing-glyph squares | Selected font glyph coverage |
| Caption cannot be clicked | Label3D is not a button; implement UI or a gameplay hit test separately |
| Extruded letters are absent | MeshInstance3D in the tree, assigned Mesh, transform, material and active camera |
Checks cover normal perspective, fixed size, wall occlusion and geometry. They do not cover every font, writing direction, projection mode or large-text performance.