From 20e9d4a0facc1654cebc14ca92859040d8eaa595 Mon Sep 17 00:00:00 2001 From: German Khokhlov Date: Sat, 17 Oct 2026 02:15:04 +0400 Subject: [PATCH] fix(globe): Navara sprite atlases are sampled as Cesium samples billboards Linear, without mipmaps: Cesium's billboard atlas has none, and a mipmapped atlas greyed small glyphs Cesium draws at full colour (a 5 px aircraft at 15,000 km: 239 against Cesium's 255; now 255 on both). Task 10b colour parity. --- src/globe/navara/movers/moverMesh.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/globe/navara/movers/moverMesh.js b/src/globe/navara/movers/moverMesh.js index 1c7761592..6372e2d05 100644 --- a/src/globe/navara/movers/moverMesh.js +++ b/src/globe/navara/movers/moverMesh.js @@ -12,6 +12,7 @@ import { DynamicDrawUsage, InstancedBufferAttribute, InstancedMesh, + LinearFilter, MeshBasicMaterial, PlaneGeometry, SRGBColorSpace, @@ -147,15 +148,20 @@ export function patchMoverShader(shader, uniforms, { point = false } = {}) { return shader; } +// Sampled as Cesium samples its billboard atlas: linear, no mipmaps (a +// mipmapped atlas greys small glyphs that Cesium draws at full colour). +function cesiumSampling(texture) { + texture.colorSpace = SRGBColorSpace; + texture.generateMipmaps = false; + texture.minFilter = LinearFilter; + texture.magFilter = LinearFilter; + return texture; +} + /** The atlas as a three texture (a canvas at once, a URL once loaded). */ function atlasTexture(atlas, onLoad) { - if (atlas.canvas) { - const texture = new CanvasTexture(atlas.canvas); - texture.colorSpace = SRGBColorSpace; - return texture; - } - const texture = new Texture(); - texture.colorSpace = SRGBColorSpace; + if (atlas.canvas) return cesiumSampling(new CanvasTexture(atlas.canvas)); + const texture = cesiumSampling(new Texture()); const image = new Image(); image.crossOrigin = 'anonymous'; image.onload = () => {