CesiumGS/cesium

Default texture should be transparent instead of white

已關閉

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

 (5 則留言) (0 個反應) (0 位負責人)JavaScript (3,324 個分叉)batch import
category - graphicsgood first issueonrampingtype - bug

倉庫指標

星標
 (11,758 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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.

貢獻者指南