mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-06 19:34:01 +00:00
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:
1 parent
37ea4e1f93
commit
3144169057
2 files changed
+7
-2
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in new issue
Block a user