mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(globe): Sharpen on Navara, on at 80 % by default
The contract gains render.setSharpen({ enabled, amount }) and
render.sharpen(). Navara draws it as a custom EffectDesc: Cesium's unsharp
mask (3x3 box blur, gamma 2.2 round trip so one amount matches Cesium)
right after tone mapping and before SMAA/FXAA, skipping sky and cloud
pixels by scene depth. The Cesium engine keeps the state only; Cesium mode
still sharpens with its own post stage, unchanged. The fake engine records
it and the contract suite checks it.
Without a viewer the Sharpen slider and toggle drive the engine with the
same slider-to-amount mapping. On Navara the defaults, presets and share
links read Cesium's 49 % as 80 %.
This commit is contained in:
1 parent
ac081a008d
commit
bb8c0b83c4
17 files changed
+521
-16
No files matched your search
@@ -143,6 +143,40 @@ test('render requests are forceUpdate and continuous mode is Navara animation',
|
||||
assert.equal(view.animation, false);
|
||||
});
|
||||
|
||||
test('setSharpen hands changed states to the sharpen port and draws a frame', () => {
|
||||
const view = fakeView();
|
||||
const shown = [];
|
||||
let destroyed = 0;
|
||||
const engine = createNavaraEngine(view, {
|
||||
hooks,
|
||||
sharpen: {
|
||||
set: (state) => shown.push(state),
|
||||
destroy: () => destroyed++,
|
||||
},
|
||||
});
|
||||
assert.deepEqual(engine.render.sharpen(), { enabled: false, amount: 1 });
|
||||
engine.render.setSharpen({ amount: 1.7 });
|
||||
engine.render.setSharpen({ enabled: true });
|
||||
assert.deepEqual(view.calls.at(-1), ['forceUpdate']);
|
||||
const calls = view.calls.length;
|
||||
engine.render.setSharpen({ enabled: true, amount: 1.7 });
|
||||
assert.equal(view.calls.length, calls, 'an unchanged state draws nothing');
|
||||
assert.throws(() => engine.render.setSharpen({ amount: -1 }), TypeError);
|
||||
assert.deepEqual(shown, [
|
||||
{ enabled: false, amount: 1.7 },
|
||||
{ enabled: true, amount: 1.7 },
|
||||
]);
|
||||
engine.destroy();
|
||||
engine.destroy();
|
||||
assert.equal(destroyed, 1);
|
||||
});
|
||||
|
||||
test('without a sharpen port setSharpen keeps the state only', () => {
|
||||
const { engine } = setup();
|
||||
engine.render.setSharpen({ enabled: true, amount: 0.5 });
|
||||
assert.deepEqual(engine.render.sharpen(), { enabled: true, amount: 0.5 });
|
||||
});
|
||||
|
||||
test("the camera starts from Navara's drawn camera and pushes poses with setCamera", () => {
|
||||
const { engine, view } = setup();
|
||||
near(engine.camera.pose().cartographic.height, 1e7, 1e-3, 'height');
|
||||
|
||||
Reference in new issue
Block a user