CesiumGS / cesium-native

Apache License 2.0
391 stars 200 forks source link

Raster overlays don't work with non-indexed triangles, or with triangle fans or strips #918

Open kring opened 2 weeks ago

kring commented 2 weeks ago

The top of upsamplePrimitiveForRasterOverlays has this:

  if (primitive.mode != MeshPrimitive::Mode::TRIANGLES ||
      primitive.indices < 0 ||
      primitive.indices >= static_cast<int>(parentModel.accessors.size())) {
    // Not indexed triangles, so we don't know how to divide this primitive
    // (yet). So remove it.
    return false;
  }

Fortunately, indexed triangle lists are the most common by far, so as far as I'm aware no one has ever actually complained about this. But still, we should round out this functionality.

csciguy8 commented 2 weeks ago

PR #777 has lots of code for dealing with non-indexed tris, fans, and strips. Could be helpful as reference.