Draw the Navara CCTV frame and viewshed in the depth-tested opaque scene so walls hide them

Navara's transparent pass runs after the post effects without the scene depth, so a camera frame clamped in front of a wall still painted through it. scripts/qa-edge-cctv-occlusion.mjs serves a one-box tileset as a local fixture with no network and checks on both engines that the frame ends at the wall and is not visible behind it.
This commit is contained in:
German Khokhlov committed 2026-11-03 20:11:23 +04:00
1 parent 37ea4e1f93
commit 3144169057
2 files changed
+7 -2

No files matched your search

+5 -1
View File
@@ -46,8 +46,12 @@ export function createCctvNavaraMeshes(engine, { view, MeshDesc }) {
super(owner, ctx, config);
this.cctv = config[KIND];
}
// The opaque scene draws after the scene depth is copied into its
// target, so walls and terrain hide the frame and volume; Navara's
// transparent pass runs after the effects without that depth and
// painted them through (scripts/qa-edge-cctv-occlusion.mjs).
getPassKey() {
return 'transparent';
return 'opaque';
}
createMesh() {
return this.cctv.group;
+2 -1
View File
@@ -28,7 +28,8 @@ function harness() {
}
const kind = Object.keys(config)[0];
const desc = new (kinds.get(kind))(view, {}, config);
assert.equal(desc.getPassKey(), 'transparent');
// Depth-tested against the scene: the frame must not paint through walls.
assert.equal(desc.getPassKey(), 'opaque');
const object = desc.createMesh();
scene.add(object);
const handle = {