CesiumGS/cesium

Default texture should be transparent instead of white

Open

#12,775 opened on 2025年7月29日

GitHub で見る
 (5 comments) (0 reactions) (0 assignees)JavaScript (11,758 stars) (3,324 forks)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.

コントリビューターガイド