Line
- Last UpdatedJan 12, 2026
- 6 minute read
The Line node enables you to create flat segmented, tape-like 3D lines.
Platform support
This element is fully supported on XR-Windows, XR-Portable Windows, XR-Portable iOS, XR-Portable Android, and XR-P WASM platforms.
|
XR-WIN |
XR-P-WIN |
XR-P-IOS |
XR-P-AND |
XR-P-WASM |
|---|---|---|---|---|
|
Full support |
Full support |
Full support |
Full support |
Full support |
|
|
|
|
|
|
Line types
These are the line types.
|
Line type |
Description |
|---|---|
|
line |
Draws a line between start and end. |
|
line_billboard |
Draws a line between start and end. The line always faces the camera. |
|
parabola |
Draws a parabola-like curve that passes through three points: -start, -median, and -end. The Median point is calculated by adding height value to the middle point in the start-to-end junction line. |
|
gittata |
Based on a complex algorithm.
|

Code example
To have a line that uses lineColor as the rendering color in the scene, it is necessary to have three elements in place. A Line node definition that specifies a custom MWX and the desired lineColor.
This is a code example for the Line node.
<Line name="testLine" positionStart="-375.67 9.6 369.93" positionEnd="-375.67 9.6 365.92" visible="true" segments="25" width="0.2" height="-5" mode="gittata" positionStartDirection="1 1 0"/>
Advanced user customization
If you need to use a flat color instead of a texture on the line mesh, you can use a custom MWX that gets the value of lineColor field dynamically and uses it in the shader.
In the following MWX example, the keyword LINE_COLOR is used to dynamically populate the material parameter called cCustomColor. The value of the lineColor field will be written by the system at load time. The material then uses a shader (EngineLib|shDC_CustomColor|default) that uses cCustomColor as the input of the self diffuse channel, resulting in the line mesh to be visualized with the flat color defined in lineColor.
An MWX, such as the one below, uses the keyword LINE_COLOR and uses a shader that gets the color from a material parameter in the project GameData/models/user/ folder with the same name that has been specified in the Line node definition.
<?xml version="1.0" encoding="utf-8" ?>
<mwx version="1.0">
<Mesh type="Unified" name=" custom_line |line" version="1">
<transform scale="1.0 1.0 1.0"
rotation="-0.0 -0.0 -0.0 1.0"
translation="0.0 0.0 0.0"/>
<material>
<Material type="DX11" version="1.1">
<pass name="standard" shader="EngineLib|shDC_CustomColor|default">
<param type="unknown" name="cCustomColor" value="LINE_COLOR"/>
</pass>
</Material>
</material>
<geometry>
<Geometry name=" custom_line |line" version="1">
<vertices num="VERTICES_NUM">
VERTICES_DATA
</vertices>
<faces num="FACES_NUM">
FACES_DATA
</faces>
</Geometry>
</geometry>
<obbox center="0.0 0.0 0.0"
hsize="1000 1000 1000"
uaxis="1.0 0.0 0.0"
vaxis="0.0 1.0 0.0"
waxis="0.0 0.0 1.0"/>
<sphere center="0.0 0.0 0.0" radius="1000"/>
</Mesh>
<extra>
<exportParams>
<exportHiddenFrozen value="false"/>
<enableOptimizations value="true"/>
<enableRadiosityChecks value="false"/>
<exportWorldSpace value="false"/>
<skipCompletionBoxes value="false"/>
<enableHierarchicalNames value="true"/>
<preferXMLTextValues value="true"/>
<deleteExistingDirectory value="false"/>
</exportParams>
</extra>
</mwx>
The shader used by the MWX must be in the project GameData/Shaders/user/ folder and it must use cCustomColor in the correct way. For example, to render a flat color shDC_CustomColor should look like this.

Automatic width scaling
Sometimes, lines need to be visible at any distance and keep their width. This is typical when they are used to represent a measurement.
To achieve this requirement, the scaleMode field can be used.
When its value is set to:
-
none: There is no automatic scaling.
-
keepdistancecenter: The line is scaled based on the distance of their center to the camera.
-
keepdistanceneaerest: The line is scaled based on the distance of the its nearest point (among start, center and end) to the camera.
The widthScale field exposes the internally calculated scaling factor and can be used to apply the same scaling to other objects that are connected to the line.

Priority levels
To increase line visibility, it could be useful to be able to draw lines over the rest of the geometries in the scene.
This can be achieved using the priorityLevel field.
-
When the priority is set to none, the line is rendered as a normal geometry.
-
When setting to a level in the level1 to level4 range, the line is rendered over the rest of the scene.
-
When more lines are in the same priority level, their relative sorting is not granted.
For this reason, it’s recommended to use different levels for lines of different color or different logical priority.

Edit position
You can adjust the start and end positions of the line either by editing the corresponding fields in the node or by enabling the Move toggle.
When the Move toggle is enabled, a movement gizmo appears at the line's start position. It allows you to reposition it directly in the viewport.
To move the gizmo to the end position instead, select the positionEnd field in the Node explorer.

Line fields
These are the fields for Line node. Only the node-specific fields are indicated, not fields obtained by inheritance.
Field inheritance: NodeBase > Line
|
Parameter |
Type |
Use |
Default value |
Description |
|---|---|---|---|---|
|
_debug |
sbool |
Optional |
false |
Shows line 3D debug elements (start, stop, and junction line). |
|
castShadows |
senum |
Optional |
default |
When set to default, this keeps the setting defined in MWX or by config.xml. Set to true or false overrides the setting. |
|
displayOverPostEffects |
sbool |
Optional |
false |
If set to true, the line is displayed over any Filler and Silhouette. |
|
height |
sfloat |
Optional |
1 |
Used in gittata and parabola. |
|
ignoreScaleOnAutoTiling |
sbool |
Optional |
false |
When set to true, the width scale is ignored during automatic tile calculation. Use this option to preserve the number of tiles in keepsizenearest or keepsizecenter mode. The line must support tiling. |
|
length |
sfloat |
Read only |
Internally calculated |
Line length in meters. |
|
lineColor |
svec3 |
Optional |
1 1 1 |
Color of the debug junction line between start and end points. |
|
mode |
senum |
Optional |
Line |
Specifies line draw algorithm. Options are: line, parabola, and gittata. |
|
mwxTemplate |
sstring |
Optional |
modules/hand/line_template.MWX |
Line MWX template. This value should not be changed. |
|
offset |
sfloat |
Optional |
1 |
Specifies the tile offset when tiling is supported by the line. Accepts value from 0 to 1. |
|
pointsColor |
svec3 |
Optional |
0 1 0 |
Color of the debug start and end points placeholders. |
|
positionEnd |
svec3 |
Optional |
0 0 0 |
Line end position. |
|
positionStart |
svec3 |
Optional |
0 0 0 |
Line start position. |
|
positionStartDirection |
svec3 |
Optional |
0 0 0 |
Used in gittata. |
|
priorityLevel |
senum |
Optional |
none |
When set to level1, level2, level3, or level4 the line is drawn over the scene. Higher priority lines are drawn over lower ones. Correct sorting of lines inside the same level is not granted. |
|
receiveShadows |
senum |
Optional |
default |
When set to default, this keeps the setting defined in MWX or by config.xml. Set to true or false overrides the setting. |
|
segments |
sint |
Optional |
1 |
Number of line segments. The larger the number is, the smoother the line. |
|
scaleMode |
senum |
Optional |
none |
When set to keepsizecenter or to keepsizenearest this forces the actual line width to be internally scaled to keep size independently from distance to camera. |
|
skipScreenSpaceCulling |
sbool |
Optional |
false |
If set to true, the line is never culled. |
|
tiles |
sint |
Optional |
1 |
Specifies the number of tiles to use when tiling is supported by the line. |
|
texture |
sstring |
Optional |
line_template.png |
Texture of the line. |
|
useAutoTiling |
sbool |
Optional |
true |
When set to true, the node automatically calculates the number of tiles based on the texture and line dimensions. The line must support tiling. |
|
visible |
sbool |
Optional |
true |
Show/hides the line. |
|
width |
sfloat |
Optional |
1 |
Line width in meters. |
|
widthScale |
sfloat |
Read only |
Internally calculated |
Exposes the width automatic scaling factor when the scaleMode is not set to none. |