Context: Ultimately, I would really like to have the path part of my PolylineGraphics change color as it progresses. Before I can coherently discuss how that might happen I want to understand how and where polyline geometry gets created and rendered.
Here's my current understanding of how and where polyline geometry gets managed and rendered. I would like to ask for a quick sanity check including where I'm wrong and especially pointers to important things I've missed.
- PolylineGeometry has its geometry created in Primitive.createCommands(). The user supplies the geometry directly, including (optionally) an array of Colors to be used to color the vertices or line segments. I don't know whether the GL layer does the interpolation itself or whether this happens in a fragment shader. PolylinePipeline can finesse the geometry however it wants, of course, but the positions and colors arrays are the starting point.
- PolylineGraphics takes one of two paths depending on whether the geometry is static or dynamic.
* Static geometry: PolylineGeometryUpdater.createFillGeometryInstance() creates a PolylineGeometry that then gets used in a GeometryInstance. Since the color is passed in as a ColorGeometryInstanceAttribute, this path only supports a single solid color.
* Dynamic geometry: The DynamicGeometryUpdater defined in PolylineGeometryUpdater.js instantiates a PolylineCollection for each Scene. Each PolylineGraphics in a scene gets an item (a Polyline) in that PolylineCollection. That uses the material set on the PolylineGraphics, which looks like it could do time-varying color via SampledProperty(Color) but apparently has no way to do per-vertex color.
Is this correct? There's lots more to discuss but I want to make sure I'm on solid ground before I dive into what the future may hold.