CesiumGS/cesium

Default texture should be transparent instead of white

Open

#12,775 建立於 2025年7月29日

在 GitHub 查看
 (5 留言) (0 反應) (0 負責人)JavaScript (11,758 star) (3,324 fork)batch import
category - graphicsgood first issueonrampingtype - bug

描述

This issue is related to several material image flashing issues: https://github.com/CesiumGS/cesium/issues/1640 and https://github.com/CesiumGS/cesium/issues/12532 (among others, probably).

A lot has been done to address these issues (see https://github.com/CesiumGS/cesium/pull/12722 and https://github.com/CesiumGS/cesium/pull/12767/), but an issue remains that, on constructing a new Material, users may still see a white flash.

This has to do with the Update-loop-based image loading model that Material employs. Image loading is queued on construction but only kicked off on subsequent Update loop iterations. There's not a whole lot to be done there, if you can't use the async constructor (linked PR above).

One very easy mitigation would be to just make the default texture transparent instead of white. At least this way, materials won't flash white into existence before loading. The change would be super easy: simply change colors here to [0, 0, 0, 0]. (Admittedly, there might be a whole lot of unit tests to update after this... hopefully not, if we've structured things right).

Bonus: update the default cubemap in the same file.

貢獻者指南