Points and lines rendering - michaliskambi/x3d-tests GitHub Wiki
Rendering points and lines in X3D 4 spec draft is extremely simple now:
-
The points and lines are now rendered just like any other geometry.
-
The only exception to AD 1 is that they cannot be "lit" if you don't provide explicit "normal" vector information for them. So the case of points/lines with "normal=NULL" remains special, as it forces "unlit" rendering (even if you use "Material" or "PhysicalMaterial" nodes with points/lines). Moreover (for compatibility with X3D 3), as a special case, if you use points/lines with "normal=NULL", and "Material" node, then we use
Material.emissiveColor
for unlit color. -
I would advise to use the
UnlitMaterial
with points/lines with normal=NULL, notMaterial
. This makes the intention ("points are unlit") explicit. This way you can forget about complicated exception in AD 2, and you can only remember the simple rule in AD 1. -
Points/lines with normal <> NULL really work just like any other geometry, no exceptions. Lighting also works, if you use
Material
orPhysicalMaterial
on them. -
Points/lines (with or without normals) interact with textures, per-vertex colors (
Color
,ColorRGBA
nodes) and generally everything... just like any other geometry. -
Full textures are applied to each point so they cover completely a square region around each point. The size of the region may vary depending on PointProperties.
Note that points/lines (
PointSet
,LineSet
,IndexedLineSet
) do not have atexCoord
field, and so you cannot use nodes likeTextureCoordinate
orTextureCoordinateGenerator
with them. This may change in future X3D versions (glTF allows texture coordinates on points/lines, just as on other geometry nodes). -
The
PointProperties.colorMode
field is removed. In light of the above decision, it is not needed. The interaction of points/lines with textures/colors is the same as any other geometry.