Billboard subregion render error
What happened?
After the fix #12958, the initial billboards with subregion work well when creating the BillboardCollection. However, the billboards added later to the collection fail to render with the expected subregion and instead display the full sprite image.
Reproduction steps
- Open the Sandcastle example link
- Watch if all the markers are rendered with the expected subregion
Sandcastle example
https://sandcastle.cesium.com/#c=pVZtT9tIEP4rI3QfbM6skwCnKgeoNEXXD0BOkLY6kYpu7Im9Zb22dtdAitLf3rG9ThxI0enuk70zz7zuM2OLrMi1hV3gBkZoRJnBXOcZTHei+jTd+XOqRAO65iqOuLESW8xaUuOmKsqVsXAv8AE1HIPCB+eVfaplXut3lCvLhUI93QngaaoATJqXMj6lYNziEKwuMajkFrUm5LB1NGnOrErhc65l7ASeT/Cl30nDRKiQsmjSYfWR1PWTJTKfIYuxsOkEjT1NyIWxzhcZVfFrXzLn8QXXd6iN13jnZqEimJcqsiJXsAFoamniC3pc8IKc8QcuLMzRRqlX6YF6l1pbmGEY3lshsc+iWLGMF2z/jx6LVDjoDfb7vcGb0BRaWHQP9s3kijpW+fCZTVF5nkbjw/EJ0LNWe36VZTeHS56hoSzGs28YWXaHC+O53LrQrKmBgKfUhEXdYO8JJKrEpkPo93o9WAbg3QYg4sc65lNTjEZbatWeABQFHMLXpinw2xPB4XfoL78GLaLIjaiaN4SbvYNDUl5wmzJNdKKYPtHxMIDt8i8rH1UJ1+XsCpPakavoZlXxzY8f3nPzlZI1ZflfWn/LuhPLpiGOMREhNWcGbcVez9UXE12E4k36jpQjri29cbVft+09JhrReHsHB1THmwD6eOgHqwDrns+ElLOc63iUS4kNnzbG5t1LQJtHzePhBrs3Q4QhzIWmKDyOweQZtldcKTuvAMwUUkTo9QKgpjmVaxGEMPB9h5vn+owTiR2mJgF5b27a21JN4AL5bVLddBmROiMe3NN9kJdt9p1aqiqI5Gui8jntBhjUNdAdTUSGeWk9r0vNtpb/lzhUxB/QAFSHZZVRuLtL4l14W3DNM3j69XUtt11yZRtO1WqH/LtUni+XFfuJMw2EbYjrzLc4rJvtGrSexNepzBhzIVoL300OLeyEePgfN1qhErfQnKfOSHfnIC9VLFRyRRVwlUj0tq4B9rhaD4f9fdh7pl28kKQoktRu3ynsQcQ2/YVuw7BtRZTLXK87WZ3YP2fn5+PPDnCP2oqIy7EWSeeb9mlDzN6NJ5PxhTNJcy2+V1/L50YfninY6OxycnblzOrch68U1BQwfK2s5nCFc9SoIlxH3pSz0fnpxd+3k/HtX1fjj5fvnXUhHlGO53MazY2rXBFsUO2bve5ipNHaCXaOjF1IPKmkb92vR6klMTC0mBWSfg9MOCujO7QsMqayOwpbk6NY3NPn6XjLfwZEkhtDmnkp5bX4Tv8sJ0ch4TfMqq858WxMNyX5ooKk/ZPzRkgzcBTS8aWVzXM547rj8Sc
Environment
Browser: NOT RELATED CesiumJS Version: 1.136.0 Operating System: NOT RELATED
/cc @Beilinson @mzschwartz5
Looking into this :/
@plainheart I can confirm this is an issue caused by my implementation primarily targeting the entity api (which updates these properties every frame), however I neglected to account for the direct use of a BillboardCollection, which is what is causing this issue: the billboard subregion index resolves a frame before the image index, partially caused by what we discussed in this comment https://github.com/CesiumGS/cesium/pull/12958#discussion_r2503847168
I'm opening a PR with a suggested fix @mzschwartz5 https://github.com/CesiumGS/cesium/pull/12958#discussion_r2518974654 ... you were right :(
In the meantime @plainheart you can add the billboards through the entity api instead