mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Add hillshade surface shading and draw it on the Cesium globe
The globe port takes the globe's material only when it is free, follows a terrain change, lets go of a material someone replaced, and takes it again once it comes free; idle ticks ask for no frame.
This commit is contained in:
1 parent
456645f291
commit
c32bf3177d
8 files changed
+227
-9
No files matched your search
@@ -3086,6 +3086,38 @@ export function portChecks() {
|
||||
},
|
||||
{ capability: 'surfaceIdentity' },
|
||||
),
|
||||
check(
|
||||
'globe.surfaceShading',
|
||||
'hillshade shading is set, restrengthened and cleared, drawing each time',
|
||||
async (h, r) => {
|
||||
await overAustin(h, r, 20000);
|
||||
const errors = [];
|
||||
const off = r.on('error', (e) => errors.push(e));
|
||||
const draws = [];
|
||||
const offDraw = r.frame.on('postRender', () => draws.push(1));
|
||||
try {
|
||||
for (const shading of [
|
||||
{ kind: 'hillshade', strength: 0.28 },
|
||||
{ kind: 'hillshade', strength: 0.5 },
|
||||
null,
|
||||
]) {
|
||||
const before = draws.length;
|
||||
r.globe.setSurfaceShading(shading);
|
||||
await h.frame(r);
|
||||
await h.frame(r);
|
||||
ok(
|
||||
draws.length > before,
|
||||
`drawn after ${shading?.strength ?? 'clearing'}`,
|
||||
);
|
||||
}
|
||||
deepEqual(errors, [], 'no errors');
|
||||
} finally {
|
||||
off();
|
||||
offDraw();
|
||||
}
|
||||
},
|
||||
{ capability: 'surfaceShading' },
|
||||
),
|
||||
check(
|
||||
'globe.sky',
|
||||
'sky settings round-trip and keep unchanged keys',
|
||||
|
||||
Reference in new issue
Block a user