mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
Cut duplicated and dead code across the engines, the layers and the QA scripts
- src/geo drops the ported debug argument checks and the tests that bitExact already covers; package boundaries accept a directory entry, so src/geo/ is listed once per group. - Cesium no longer carries movers and lines nobody draws with: they are optional engine capabilities. The fake engine and the Cesium camera use the shared cameraMath; unused contract tables, clock.ticked, the 'finest' surface detail and Navara click statistics are gone. - ALPR keeps one overlay core and one presentation model for both engines, bikeshare one station bookkeeping, the Navara ground effects one definition helper; image atlases, view centres, mover banks and colours are shared. - The legacy switch route, the clock offset and rate controls and other unused exports are removed. - The acceptance runs the Navara draw, geo import and scope checks; scenarios use the harness switch and page helpers; the main chunk check keeps the size budget only and runs once in CI.
This commit is contained in:
1 parent
c502404e1d
commit
7abf74518f
272 files changed
+4828
-10213
No files matched your search
@@ -3,7 +3,6 @@
|
||||
// visible terrain and 3D tiles by one non-pickable classification pass. Only
|
||||
// surface pixels take it, so the fire markers above stay untouched. The
|
||||
// adapter has heatImagery.js's interface, so the layer drives both alike.
|
||||
import { Effect, EffectAttribute } from 'postprocessing';
|
||||
import {
|
||||
DataTexture,
|
||||
LinearFilter,
|
||||
@@ -18,9 +17,9 @@ import {
|
||||
groundSurfaceUniforms,
|
||||
updateGroundSurface,
|
||||
} from '../../shared/render/navaraGroundSurface.js';
|
||||
import { defineGroundEffect } from '../../shared/render/navaraGroundEffect.js';
|
||||
|
||||
const KEY = 'gevFirmsHeat';
|
||||
const registeredViews = new WeakSet();
|
||||
|
||||
// Row 0 of the raster is the north edge and column 0 is 180°W; the texture
|
||||
// keeps that order (no flip), so v = 0 is north.
|
||||
@@ -63,59 +62,45 @@ void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor) {
|
||||
}
|
||||
`;
|
||||
|
||||
function heatEffectClass(EffectDesc, NavaraEffect) {
|
||||
return class FirmsHeatEffectDesc extends EffectDesc {
|
||||
static key = KEY;
|
||||
// Under the heat cells' and markers' place in the chain: after the other
|
||||
// surface drapes, before sharpening, anti-aliasing and overlays.
|
||||
static insertAfter = [
|
||||
'gevEarthquakeGround',
|
||||
'gevObservedWeather',
|
||||
'gevNepalEvent',
|
||||
'gevRecentImagery',
|
||||
'toneMapping',
|
||||
];
|
||||
static insertBefore = [
|
||||
'gevFirmsGround',
|
||||
'gevPreSharpenOverlay',
|
||||
'gevSharpen',
|
||||
'smaa',
|
||||
'fxaa',
|
||||
'gevOverlay',
|
||||
'final',
|
||||
];
|
||||
constructor(view, context, config) {
|
||||
super(view, context, config);
|
||||
this.owner = config[KEY].owner;
|
||||
}
|
||||
createPass() {
|
||||
this.effect = new Effect('GevFirmsHeat', fragmentShader, {
|
||||
attributes: EffectAttribute.CONVOLUTION,
|
||||
uniforms: new Map([
|
||||
...groundSurfaceUniforms(),
|
||||
['tHeat', new Uniform(null)],
|
||||
['uOpacity', new Uniform(1)],
|
||||
['uInverseView', new Uniform(new Matrix4())],
|
||||
]),
|
||||
});
|
||||
return new NavaraEffect(this.view.camera.raw, this.effect);
|
||||
}
|
||||
updateFrame() {
|
||||
const owner = this.owner,
|
||||
camera = this.view.camera.raw;
|
||||
if (!this.effect || !owner.texture || !camera) return;
|
||||
updateGroundSurface(this.effect, camera, this.ctx, this.find('mrt'));
|
||||
const u = this.effect.uniforms;
|
||||
u.get('tHeat').value = owner.texture;
|
||||
u.get('uOpacity').value = owner.opacity;
|
||||
u.get('uInverseView').value.copy(camera.matrixWorld);
|
||||
}
|
||||
onDestroy() {
|
||||
this.effect?.dispose();
|
||||
super.onDestroy();
|
||||
}
|
||||
};
|
||||
}
|
||||
const heatEffect = defineGroundEffect({
|
||||
key: KEY,
|
||||
name: 'GevFirmsHeat',
|
||||
fragmentShader,
|
||||
// Under the heat cells' and markers' place in the chain: after the other
|
||||
// surface drapes, before sharpening, anti-aliasing and overlays.
|
||||
insertAfter: [
|
||||
'gevEarthquakeGround',
|
||||
'gevObservedWeather',
|
||||
'gevNepalEvent',
|
||||
'gevRecentImagery',
|
||||
'toneMapping',
|
||||
],
|
||||
insertBefore: [
|
||||
'gevFirmsGround',
|
||||
'gevPreSharpenOverlay',
|
||||
'gevSharpen',
|
||||
'smaa',
|
||||
'fxaa',
|
||||
'gevOverlay',
|
||||
'final',
|
||||
],
|
||||
uniforms: () => [
|
||||
...groundSurfaceUniforms(),
|
||||
['tHeat', new Uniform(null)],
|
||||
['uOpacity', new Uniform(1)],
|
||||
['uInverseView', new Uniform(new Matrix4())],
|
||||
],
|
||||
update() {
|
||||
const owner = this.owner,
|
||||
camera = this.view.camera.raw;
|
||||
if (!this.effect || !owner.texture || !camera) return;
|
||||
updateGroundSurface(this.effect, camera, this.ctx, this.find('mrt'));
|
||||
const u = this.effect.uniforms;
|
||||
u.get('tHeat').value = owner.texture;
|
||||
u.get('uOpacity').value = owner.opacity;
|
||||
u.get('uInverseView').value.copy(camera.matrixWorld);
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* The raster as a texture: linear between pixels, wrapping across 180°. Its
|
||||
@@ -148,10 +133,7 @@ export function createFirmsHeatDrape(
|
||||
engine,
|
||||
{ view, EffectDesc, NavaraEffect },
|
||||
) {
|
||||
if (!registeredViews.has(view)) {
|
||||
view.registerEffect(KEY, heatEffectClass(EffectDesc, NavaraEffect));
|
||||
registeredViews.add(view);
|
||||
}
|
||||
heatEffect.register(view, { EffectDesc, NavaraEffect });
|
||||
const owner = { texture: null, opacity: 1 };
|
||||
let raster = null,
|
||||
show = true,
|
||||
|
||||
Reference in new issue
Block a user