Skip to content

Points and lines rendering

Michalis Kamburelis edited this page Sep 7, 2020 · 3 revisions

Rendering points and lines in X3D 4 spec draft is extremely simple now:

  1. The points and lines are now rendered just like any other geometry.

  2. 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.

  3. I would advise to use the UnlitMaterial with points/lines with normal=NULL, not Material. 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.

  4. Points/lines with normal <> NULL really work just like any other geometry, no exceptions. Lighting also works, if you use Material or PhysicalMaterial on them.

  5. Points/lines (with or without normals) interact with textures, per-vertex colors (Color, ColorRGBA nodes) and generally everything... just like any other geometry.

  6. 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 a texCoord field, and so you cannot use nodes like TextureCoordinate or TextureCoordinateGenerator with them. This may change in future X3D versions (glTF allows texture coordinates on points/lines, just as on other geometry nodes).

  7. 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.

Clone this wiki locally