This component defines the materials and containers for geometric nodes and their appearance.
See also X3D specification of the Shape component.
Allows to change line width and type (pattern).
Suitable for all line geometry,
It also affects normal (filled) geometry (like
when viewed in wireframe mode (see view3dscene "View -> Fill Mode"
We only support values 1..5 (Solid .. Dash-dot-dot) for
We use the GPU (OpenGL/OpenGLES) features to render lines with custom width and pattern (type).
This has the advantage that it's ultra-fast. Changing line width or using line pattern has virtually zero cost.
But the disadvantage is that we only support what the GPU (OpenGL/OpenGLES) supports.
This particularly hurts on OpenGLES (Android, iOS), where
glLineStippleis not supported (so X3D
linetypefield will unfortunately do nothing).
GLInformationString), as "Max line width". Unfortunately, on many Android devices it's just 1. Which means that
glLineWidthis supported, but actually completely ignored by the device.
If you need 100% reliable line width or patterns on Android/iOS, you may need to render them differently, using filled rectangles (e.g. using
Rectangle2D nodes). To simulate line patterns, use small repeatable textures with transparent pixels (you can set texture filtering to
TextureProperties node to avoid smoothing the alpha channel).
Notes about VRML 1.0 and multiple materials: multiple materials
within a single VRML 1.0
Material node work 100%
correctly if you change only emissive and transparency,
or only diffuse and transparency for each index.
For complicated cases (like when you change diffuse, and specular,
and emissive...) for each material index -> they will fail.
VRML 2.0 and X3D removed this idea, replacing it with much
that are implemented fully.
TODO: FillProperties, TwoSidedMaterial are missing.