CesiumGS/cesium

Irrelevant error message from `PerInstanceColorAppearance`

Open

#12.107 geöffnet am 2. Aug. 2024

Auf GitHub ansehen
 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (3.324 Forks)batch import
FCFcategory - docgood first issuetype - bug

Repository-Metriken

Stars
 (11.758 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 26T 3h) (26 gemergte PRs in 30 T)

Beschreibung

What happened?

As reported on the forum Adding a GeometryInstance with a RectangleOutlineGeometry to the scene as a Primitive with a default PerInstanceColorAppearance gives the following error:

DeveloperError: Appearance/Geometry mismatch. The appearance requires vertex shader attribute input 'compressedAttributes', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.

See this Sandcastle example.

But vertexFormat is not an option for RectangleOutlineGeometry. In this case, the PerInstanceColorAppearance will work as long as it is initialized with the option flat: true. See this updated Sandcastle.

Reproduction steps

  1. Construct a GeometryInstance with a RectangleOutlineGeometry
  2. Add it to the scene with a default PerInstanceColorAppearance

Sandcastle example

https://sandcastle.cesium.com/#c=zZNdS8MwFIb/SuiNLcx09eNC1w1lggiCouCN9SJLjzWYJiVJJ1P2303StXZbvRVvEnLOed+T8zSlUmiDlgw+QKEpEvCB5qBZXeInHwuzgPrzXApDmACVBdEkE5mgXvmFNAUBaG3FjUsvqYAaIgoON/ZEBIVku8U1yBKMWrXp8CsTCBWbKDrv1z60Xne14fYerbbRoJ9eVrYrwa9KlldQKAAdHiYnYzweoWO/HiZjv7tYNHJW62ZjuTU66FwPfJAYo9iiNqBtctOYSi7V9l3nLrQ73GWrDX3DpFvG+DTyjTOxdmh/YXf0L9g11I4admcdyL9C16c2gM6/RVwpVjLDlqAxyfOw537fZrZptX3c1Z73H+1o4GO8NENVFRDlAttT3INqK/1Al11d6BCto2gSjIJUmxWHWcMCoQtWVlIZVCseYhwbKCtOLK94UdN3MJhq7WZ0pWncl6Y5W1ro04FfFVFOtLaZ15rzR/YJWTBLY1u/J+WS5EwUd0tQnKxc2Vsyu22CGOM0tsdhpZGSL4jacf4G

Environment

Browser: Chrome CesiumJS Version: 1.120 Operating System: Windows

Contributor Guide