Hide Navara infrastructure stems and data pack meshes behind walls, terrain and the Earth

Navara draws its transparent scene after the post effects into a target without the scene depth, so stems and pack polygons and images painted through 3D tiles. A scene-depth test now drops each of their fragments behind the depth Navara packs after its opaque pass; they stay in the transparent pass, so their look in the open is unchanged (scripts/qa-edge-occlusion.mjs compares it with the previous build). Wind flow was already hidden and is kept as a guard in the same scenario.
This commit is contained in:
German Khokhlov committed 2026-11-03 21:15:03 +04:00
1 parent c392d6fb50
commit eee4f48745
6 files changed
+298 -5

No files matched your search

+12 -2
View File
@@ -11,6 +11,10 @@ import {
SRGBColorSpace,
Texture,
} from 'three';
import {
attachSceneDepth,
createSceneDepthTest,
} from '../../layers/shared/render/navaraSceneDepth.js';
const KEY = 'gevScenePack',
registered = new WeakSet();
const cyan = [0, 1, 1, 1],
@@ -24,10 +28,13 @@ export function createNavaraPackRenderer(engine, { view, MeshDesc }) {
super(host, ctx, config);
this.object = config[KEY];
}
// Transparent, so the effects leave its look alone; the scene-depth
// test hides a pack behind terrain, 3D tiles and the Earth.
getPassKey() {
return 'transparent';
}
createMesh() {
attachSceneDepth(this.object.group, this.ctx);
return this.object.group;
}
onDestroy() {
@@ -39,7 +46,8 @@ export function createNavaraPackRenderer(engine, { view, MeshDesc }) {
registered.add(view);
}
const meshGroup = (handle) => {
const group = new Group(),
const depthTest = createSceneDepthTest();
const group = depthTest.object(new Group()),
owned = [];
let released = false;
const dispose = () => {
@@ -62,7 +70,7 @@ export function createNavaraPackRenderer(engine, { view, MeshDesc }) {
dispose();
}
});
return { group, owned };
return { group, owned, depthTest };
};
function addMesh(batch, shape, properties, id, texture) {
if (!shape) return;
@@ -99,6 +107,8 @@ export function createNavaraPackRenderer(engine, { view, MeshDesc }) {
.copy(pigment)
.multiplyScalar(1 / Math.max(1, view.toneMappingExposure ?? 1));
};
batch.depthTest.material(material);
batch.depthTest.object(mesh);
mesh.position.set(origin.x, origin.y, origin.z);
mesh.userData.pickId = id;
batch.group.add(mesh);