I want to use the Alpha channel of TextureAtlas to store fonts, and the other three channels are not used. The pixelFormat parameter is pixelFormat.alpha when TextureAtlas is initialized.
this._textureAtlas = new TextureAtlas({
context: context,
pixelFormat: Cesium.PixelFormat.ALPHA,
});
As I store more words, I don’t have enough space allocated during initialization, and when I need to reallocate memory, something strange happens, some words disappear from TextureAtlas, I suspect the problem is TextureAtlas.Prototype.resize function to redistribute copies data from the FrameBuffer. I did not save the problem picture, because I do not have the corresponding correct font data, so I cannot reproduce the problem.The problem disappeared when I changed pixelFormat to PixelFormat.RGBA.
Only the Alpha channel is needed to save the font, and the other three channels are not needed, which is a bit wasteful.
In addition, when I passed in more fonts, I found that about half of the space in TextureAtlas was wasted. Is there any good way to solve this problem?Thank you for your help! :