@kepler.gl/deckgl-layers 3.3.0-alpha.28 → 3.3.0-alpha.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -35,7 +35,12 @@ var DEPTH_DISK_PARAMETERS = {
|
|
|
35
35
|
// and used purely to fill the depth buffer so far-side geometry (arcs/lines) is
|
|
36
36
|
// occluded by the planet.
|
|
37
37
|
depthTest: true,
|
|
38
|
-
|
|
38
|
+
// Do not inherit a disabled depth mask from earlier rendering.
|
|
39
|
+
depthMask: true,
|
|
40
|
+
cull: false,
|
|
41
|
+
// Deck normalizes the globe's global cull:true to cullMode:'back'. Luma applies
|
|
42
|
+
// that modern parameter after cull:false, which otherwise discards this plane.
|
|
43
|
+
cullMode: 'none'
|
|
39
44
|
};
|
|
40
45
|
|
|
41
46
|
// Earth radius in meters. The disk geometry is a [-1, 1] plane; we scale it into
|
|
@@ -91,11 +96,11 @@ var GlobeDepthDiskLayer = exports.GlobeDepthDiskLayer = /*#__PURE__*/function (_
|
|
|
91
96
|
var camPos = new _core2.Vector3(this.context.viewport.cameraPosition);
|
|
92
97
|
var camDir = camPos.clone().normalize();
|
|
93
98
|
var topDir = new _core2.Vector3(0, 0, 1);
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
var shiftToCamera =
|
|
99
|
+
|
|
100
|
+
// Tangent points satisfy dot(point, camera) = R², so the silhouette circle
|
|
101
|
+
// lies R² / |camera| toward the camera. This depends only on camera distance;
|
|
102
|
+
// deriving it from a world-up cross product leaves a gap near the globe's rim.
|
|
103
|
+
var shiftToCamera = normalizedRadius * normalizedRadius / camPos.len();
|
|
99
104
|
var adjustedDiskRadius = Math.sqrt(normalizedRadius * normalizedRadius - shiftToCamera * shiftToCamera);
|
|
100
105
|
|
|
101
106
|
// Camera-facing orientation: the plane's local X/Y axes map to world `right`/`up`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globe-depth-disk-layer.js","names":["_core","require","_meshLayers","_engine","_core2","_shaderUtils","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","_callSuper","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","Boolean","prototype","valueOf","call","_superPropGet","p","_get2","PLANE_GEOMETRY","PlaneGeometry","type","xlen","ylen","DEPTH_DISK_PARAMETERS","depthTest","cull","DEPTH_DISK_FULL_RADIUS","GLOBE_COMMON_RADIUS","exports","GlobeDepthDiskLayer","_SimpleMeshLayer","_classCallCheck2","_inherits2","_createClass2","key","value","getShaders","shaders","vs","editShader","inject","draw","_ref","uniforms","normalizedRadius","camPos","Vector3","context","viewport","cameraPosition","camDir","clone","normalize","topDir","sideDir","cross","sidePoint","scale","camToSide","subtract","adjustedSidePoint","shiftToCamera","dot","adjustedDiskRadius","Math","sqrt","forward","right","up","model","state","props","u_depthDiskOrientCol0","u_depthDiskOrientCol1","u_depthDiskOrientCol2","u_directionToCamera","u_depthDiskShift","u_depthDiskRadius","SimpleMeshLayer","getGlobeDepthDiskLayer","_ref2","fillColor","id","data","coordinateOrigin","coordinateSystem","COORDINATE_SYSTEM","CARTESIAN","getPosition","d","getColor","mesh","parameters"],"sources":["../../../src/globe/globe-depth-disk-layer.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nimport {COORDINATE_SYSTEM} from '@deck.gl/core';\nimport {SimpleMeshLayer} from '@deck.gl/mesh-layers';\nimport {PlaneGeometry} from '@luma.gl/engine';\nimport {Vector3} from '@math.gl/core';\n\nimport {editShader} from '../layer-utils/shader-utils';\nimport type {RGBColor} from '@kepler.gl/types';\n\n// luma.gl 9's PlaneGeometry ignores `radius`; pass explicit type/xlen/ylen so we\n// get a [-1, 1] quad (a `radius: 1` plane would only span [-0.5, 0.5]).\nconst PLANE_GEOMETRY = new PlaneGeometry({\n type: 'x,y',\n xlen: 2,\n ylen: 2\n} as any);\n\nconst DEPTH_DISK_PARAMETERS = {\n // Depth writes only happen with depthTest enabled. The disk is opaque-black-ish\n // and used purely to fill the depth buffer so far-side geometry (arcs/lines) is\n // occluded by the planet.\n depthTest: true,\n cull: false\n};\n\n// Earth radius in meters. The disk geometry is a [-1, 1] plane; we scale it into\n// METERS in the vertex shader (like the atmosphere SphereGeometry, whose radius is\n// ~6.4e6 m) and let SimpleMeshLayer's stock projection map it onto the globe —\n// exactly the working path the atmosphere mesh layers use.\nconst DEPTH_DISK_FULL_RADIUS = 6.371e6;\n\n// Globe common space uses GLOBE_RADIUS = 256 units (see deck.gl's project_globe_).\n// The disk orientation math is done in that 256-unit common space (matching\n// viewport.cameraPosition), then the resulting radius/shift ratios are converted to\n// meters for the shader, since the disk geometry is expressed in meters.\nexport const GLOBE_COMMON_RADIUS = 256;\n\n/**\n * Creates a view-oriented disk positioned along the direction from the globe's center to the camera.\n * The disk is a cross-section of the globe between the front (visible) and back side, and it fills\n * the depth buffer so anything on the far side of the globe (e.g. arcs/lines) is depth-culled and\n * hidden behind the planet.\n */\nexport class GlobeDepthDiskLayer extends SimpleMeshLayer<any> {\n static layerName = 'GlobeDepthDiskLayer';\n\n getShaders(): any {\n const shaders = super.getShaders();\n\n // Override the local `pos` computation: reorient the flat [-1,1] plane to face\n // the camera, scale it to meters, and shift it toward the camera along the view\n // axis so it sits at the globe's silhouette cross-section. The stock\n // project_position_to_clipspace call is left untouched so the disk projects onto\n // the globe through the exact same (working) path the atmosphere mesh layers use.\n const vs = editShader(\n shaders.vs,\n 'globe depth disk vs',\n 'vec3 pos = (instanceModelMatrix * positions) * simpleMesh.sizeScale + instanceTranslation;',\n `mat3 u_matDepthDiskOrientation = mat3(\n u_depthDiskOrientCol0,\n u_depthDiskOrientCol1,\n u_depthDiskOrientCol2\n );\n vec3 pos = (u_matDepthDiskOrientation * positions) * u_depthDiskRadius;\n vDepthDiskPos = pos;\n pos = pos + u_directionToCamera * u_depthDiskShift;\n `\n );\n\n const inject = {\n 'vs:#decl': `\n uniform vec3 u_depthDiskOrientCol0;\n uniform vec3 u_depthDiskOrientCol1;\n uniform vec3 u_depthDiskOrientCol2;\n uniform vec3 u_directionToCamera;\n uniform float u_depthDiskShift;\n uniform float u_depthDiskRadius;\n out vec3 vDepthDiskPos;\n `,\n 'fs:#decl': `\n uniform float u_depthDiskRadius;\n in vec3 vDepthDiskPos;\n `,\n 'fs:#main-start': `\n if (length(vDepthDiskPos) > u_depthDiskRadius) {\n discard;\n }\n `\n };\n\n return {\n ...shaders,\n vs,\n inject\n };\n }\n\n draw({uniforms}: {uniforms: object}): void {\n const normalizedRadius = GLOBE_COMMON_RADIUS;\n\n const camPos = new Vector3((this.context.viewport as any).cameraPosition);\n const camDir = camPos.clone().normalize();\n const topDir = new Vector3(0, 0, 1);\n const sideDir = camDir.clone().cross(topDir);\n const sidePoint = sideDir.clone().scale(normalizedRadius);\n\n const camToSide = sidePoint.clone().subtract(camPos).normalize();\n const adjustedSidePoint = camToSide.cross(topDir).scale(-normalizedRadius);\n\n const shiftToCamera = camDir.dot(adjustedSidePoint);\n const adjustedDiskRadius = Math.sqrt(\n normalizedRadius * normalizedRadius - shiftToCamera * shiftToCamera\n );\n\n // Camera-facing orientation: the plane's local X/Y axes map to world `right`/`up`\n // (both perpendicular to the camera direction), and local Z maps to `forward`.\n // Columns are handed to the shader as vec3s to avoid Matrix3 row/column ambiguity.\n const forward = camDir.clone();\n const right = topDir.clone().cross(forward).normalize();\n const up = forward.clone().cross(right).normalize();\n\n const model = this.state.model;\n if (model) {\n // Use the same uniform-delivery mechanism as the (working) atmosphere layers:\n // raw `uniform` declarations + assignment to model.props.uniforms.\n (model as any).props.uniforms = {\n ...(model as any).props.uniforms,\n // mat3(col0, col1, col2) in GLSL is column-major; mat3 * (x, y, 0) = x*right + y*up.\n u_depthDiskOrientCol0: [right[0], right[1], right[2]],\n u_depthDiskOrientCol1: [up[0], up[1], up[2]],\n u_depthDiskOrientCol2: [forward[0], forward[1], forward[2]],\n u_directionToCamera: [camDir[0], camDir[1], camDir[2]],\n // Convert the common-space (256-unit) radius/shift to meters, since the disk\n // geometry (and therefore `pos`) is expressed in meters.\n u_depthDiskShift: (shiftToCamera / normalizedRadius) * DEPTH_DISK_FULL_RADIUS,\n u_depthDiskRadius: (adjustedDiskRadius / normalizedRadius) * DEPTH_DISK_FULL_RADIUS\n };\n }\n super.draw({uniforms});\n }\n}\n\nexport const getGlobeDepthDiskLayer = ({fillColor}: {fillColor?: RGBColor}) => {\n return new GlobeDepthDiskLayer({\n id: 'globe-depth-disk-layer',\n data: [[0, 0, 0]],\n coordinateOrigin: [0, 0, 0],\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n getPosition: (d: number[]) => d,\n getColor: (fillColor ?? [0, 0, 0]) as any,\n mesh: PLANE_GEOMETRY,\n parameters: DEPTH_DISK_PARAMETERS\n } as any);\n};\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,YAAA,GAAAJ,OAAA;AAAuD,SAAAK,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,C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/C,OAAO,IAAIpD,mBAAmB,CAAC;IAC7BqD,EAAE,EAAE,wBAAwB;IAC5BC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACjBC,gBAAgB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC3BC,gBAAgB,EAAEC,uBAAiB,CAACC,SAAS;IAC7CC,WAAW,EAAE,SAAbA,WAAWA,CAAGC,CAAW;MAAA,OAAKA,CAAC;IAAA;IAC/BC,QAAQ,EAAGT,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAS;IACzCU,IAAI,EAAEzE,cAAc;IACpB0E,UAAU,EAAErE;EACd,CAAQ,CAAC;AACX,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"globe-depth-disk-layer.js","names":["_core","require","_meshLayers","_engine","_core2","_shaderUtils","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","_callSuper","_getPrototypeOf2","_possibleConstructorReturn2","_isNativeReflectConstruct","Reflect","construct","constructor","Boolean","prototype","valueOf","call","_superPropGet","p","_get2","PLANE_GEOMETRY","PlaneGeometry","type","xlen","ylen","DEPTH_DISK_PARAMETERS","depthTest","depthMask","cull","cullMode","DEPTH_DISK_FULL_RADIUS","GLOBE_COMMON_RADIUS","exports","GlobeDepthDiskLayer","_SimpleMeshLayer","_classCallCheck2","_inherits2","_createClass2","key","value","getShaders","shaders","vs","editShader","inject","draw","_ref","uniforms","normalizedRadius","camPos","Vector3","context","viewport","cameraPosition","camDir","clone","normalize","topDir","shiftToCamera","len","adjustedDiskRadius","Math","sqrt","forward","right","cross","up","model","state","props","u_depthDiskOrientCol0","u_depthDiskOrientCol1","u_depthDiskOrientCol2","u_directionToCamera","u_depthDiskShift","u_depthDiskRadius","SimpleMeshLayer","getGlobeDepthDiskLayer","_ref2","fillColor","id","data","coordinateOrigin","coordinateSystem","COORDINATE_SYSTEM","CARTESIAN","getPosition","d","getColor","mesh","parameters"],"sources":["../../../src/globe/globe-depth-disk-layer.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nimport {COORDINATE_SYSTEM} from '@deck.gl/core';\nimport {SimpleMeshLayer} from '@deck.gl/mesh-layers';\nimport {PlaneGeometry} from '@luma.gl/engine';\nimport {Vector3} from '@math.gl/core';\n\nimport {editShader} from '../layer-utils/shader-utils';\nimport type {RGBColor} from '@kepler.gl/types';\n\n// luma.gl 9's PlaneGeometry ignores `radius`; pass explicit type/xlen/ylen so we\n// get a [-1, 1] quad (a `radius: 1` plane would only span [-0.5, 0.5]).\nconst PLANE_GEOMETRY = new PlaneGeometry({\n type: 'x,y',\n xlen: 2,\n ylen: 2\n} as any);\n\nconst DEPTH_DISK_PARAMETERS = {\n // Depth writes only happen with depthTest enabled. The disk is opaque-black-ish\n // and used purely to fill the depth buffer so far-side geometry (arcs/lines) is\n // occluded by the planet.\n depthTest: true,\n // Do not inherit a disabled depth mask from earlier rendering.\n depthMask: true,\n cull: false,\n // Deck normalizes the globe's global cull:true to cullMode:'back'. Luma applies\n // that modern parameter after cull:false, which otherwise discards this plane.\n cullMode: 'none'\n};\n\n// Earth radius in meters. The disk geometry is a [-1, 1] plane; we scale it into\n// METERS in the vertex shader (like the atmosphere SphereGeometry, whose radius is\n// ~6.4e6 m) and let SimpleMeshLayer's stock projection map it onto the globe —\n// exactly the working path the atmosphere mesh layers use.\nconst DEPTH_DISK_FULL_RADIUS = 6.371e6;\n\n// Globe common space uses GLOBE_RADIUS = 256 units (see deck.gl's project_globe_).\n// The disk orientation math is done in that 256-unit common space (matching\n// viewport.cameraPosition), then the resulting radius/shift ratios are converted to\n// meters for the shader, since the disk geometry is expressed in meters.\nexport const GLOBE_COMMON_RADIUS = 256;\n\n/**\n * Creates a view-oriented disk positioned along the direction from the globe's center to the camera.\n * The disk is a cross-section of the globe between the front (visible) and back side, and it fills\n * the depth buffer so anything on the far side of the globe (e.g. arcs/lines) is depth-culled and\n * hidden behind the planet.\n */\nexport class GlobeDepthDiskLayer extends SimpleMeshLayer<any> {\n static layerName = 'GlobeDepthDiskLayer';\n\n getShaders(): any {\n const shaders = super.getShaders();\n\n // Override the local `pos` computation: reorient the flat [-1,1] plane to face\n // the camera, scale it to meters, and shift it toward the camera along the view\n // axis so it sits at the globe's silhouette cross-section. The stock\n // project_position_to_clipspace call is left untouched so the disk projects onto\n // the globe through the exact same (working) path the atmosphere mesh layers use.\n const vs = editShader(\n shaders.vs,\n 'globe depth disk vs',\n 'vec3 pos = (instanceModelMatrix * positions) * simpleMesh.sizeScale + instanceTranslation;',\n `mat3 u_matDepthDiskOrientation = mat3(\n u_depthDiskOrientCol0,\n u_depthDiskOrientCol1,\n u_depthDiskOrientCol2\n );\n vec3 pos = (u_matDepthDiskOrientation * positions) * u_depthDiskRadius;\n vDepthDiskPos = pos;\n pos = pos + u_directionToCamera * u_depthDiskShift;\n `\n );\n\n const inject = {\n 'vs:#decl': `\n uniform vec3 u_depthDiskOrientCol0;\n uniform vec3 u_depthDiskOrientCol1;\n uniform vec3 u_depthDiskOrientCol2;\n uniform vec3 u_directionToCamera;\n uniform float u_depthDiskShift;\n uniform float u_depthDiskRadius;\n out vec3 vDepthDiskPos;\n `,\n 'fs:#decl': `\n uniform float u_depthDiskRadius;\n in vec3 vDepthDiskPos;\n `,\n 'fs:#main-start': `\n if (length(vDepthDiskPos) > u_depthDiskRadius) {\n discard;\n }\n `\n };\n\n return {\n ...shaders,\n vs,\n inject\n };\n }\n\n draw({uniforms}: {uniforms: object}): void {\n const normalizedRadius = GLOBE_COMMON_RADIUS;\n\n const camPos = new Vector3((this.context.viewport as any).cameraPosition);\n const camDir = camPos.clone().normalize();\n const topDir = new Vector3(0, 0, 1);\n\n // Tangent points satisfy dot(point, camera) = R², so the silhouette circle\n // lies R² / |camera| toward the camera. This depends only on camera distance;\n // deriving it from a world-up cross product leaves a gap near the globe's rim.\n const shiftToCamera = (normalizedRadius * normalizedRadius) / camPos.len();\n const adjustedDiskRadius = Math.sqrt(\n normalizedRadius * normalizedRadius - shiftToCamera * shiftToCamera\n );\n\n // Camera-facing orientation: the plane's local X/Y axes map to world `right`/`up`\n // (both perpendicular to the camera direction), and local Z maps to `forward`.\n // Columns are handed to the shader as vec3s to avoid Matrix3 row/column ambiguity.\n const forward = camDir.clone();\n const right = topDir.clone().cross(forward).normalize();\n const up = forward.clone().cross(right).normalize();\n\n const model = this.state.model;\n if (model) {\n // Use the same uniform-delivery mechanism as the (working) atmosphere layers:\n // raw `uniform` declarations + assignment to model.props.uniforms.\n (model as any).props.uniforms = {\n ...(model as any).props.uniforms,\n // mat3(col0, col1, col2) in GLSL is column-major; mat3 * (x, y, 0) = x*right + y*up.\n u_depthDiskOrientCol0: [right[0], right[1], right[2]],\n u_depthDiskOrientCol1: [up[0], up[1], up[2]],\n u_depthDiskOrientCol2: [forward[0], forward[1], forward[2]],\n u_directionToCamera: [camDir[0], camDir[1], camDir[2]],\n // Convert the common-space (256-unit) radius/shift to meters, since the disk\n // geometry (and therefore `pos`) is expressed in meters.\n u_depthDiskShift: (shiftToCamera / normalizedRadius) * DEPTH_DISK_FULL_RADIUS,\n u_depthDiskRadius: (adjustedDiskRadius / normalizedRadius) * DEPTH_DISK_FULL_RADIUS\n };\n }\n super.draw({uniforms});\n }\n}\n\nexport const getGlobeDepthDiskLayer = ({fillColor}: {fillColor?: RGBColor}) => {\n return new GlobeDepthDiskLayer({\n id: 'globe-depth-disk-layer',\n data: [[0, 0, 0]],\n coordinateOrigin: [0, 0, 0],\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n getPosition: (d: number[]) => d,\n getColor: (fillColor ?? [0, 0, 0]) as any,\n mesh: PLANE_GEOMETRY,\n parameters: DEPTH_DISK_PARAMETERS\n } as any);\n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MACAb,aAAA,CAAAgB,mBAAA,oBAAW;QAACc,QAAQ,EAARA;MAAQ,CAAC;IACvB;EAAC;AAAA,EA9FsC6B,2BAAe;AAAA,IAAA1E,gBAAA,aAA3C+B,mBAAmB,eACX,qBAAqB;AAgGnC,IAAM4C,sBAAsB,GAAA7C,OAAA,CAAA6C,sBAAA,GAAG,SAAzBA,sBAAsBA,CAAAC,KAAA,EAA4C;EAAA,IAAvCC,SAAS,GAAAD,KAAA,CAATC,SAAS;EAC/C,OAAO,IAAI9C,mBAAmB,CAAC;IAC7B+C,EAAE,EAAE,wBAAwB;IAC5BC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACjBC,gBAAgB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC3BC,gBAAgB,EAAEC,uBAAiB,CAACC,SAAS;IAC7CC,WAAW,EAAE,SAAbA,WAAWA,CAAGC,CAAW;MAAA,OAAKA,CAAC;IAAA;IAC/BC,QAAQ,EAAGT,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAS;IACzCU,IAAI,EAAErE,cAAc;IACpBsE,UAAU,EAAEjE;EACd,CAAQ,CAAC;AACX,CAAC","ignoreList":[]}
|
|
@@ -30,7 +30,12 @@ var DEPTH_DISK_PARAMETERS = {
|
|
|
30
30
|
// and used purely to fill the depth buffer so far-side geometry (arcs/lines) is
|
|
31
31
|
// occluded by the planet.
|
|
32
32
|
depthTest: true,
|
|
33
|
-
|
|
33
|
+
// Do not inherit a disabled depth mask from earlier rendering.
|
|
34
|
+
depthMask: true,
|
|
35
|
+
cull: false,
|
|
36
|
+
// Deck normalizes the globe's global cull:true to cullMode:'back'. Luma applies
|
|
37
|
+
// that modern parameter after cull:false, which otherwise discards this plane.
|
|
38
|
+
cullMode: 'none'
|
|
34
39
|
};
|
|
35
40
|
|
|
36
41
|
// Earth radius in meters. The disk geometry is a [-1, 1] plane; we scale it into
|
|
@@ -86,11 +91,11 @@ export var GlobeDepthDiskLayer = /*#__PURE__*/function (_SimpleMeshLayer) {
|
|
|
86
91
|
var camPos = new Vector3(this.context.viewport.cameraPosition);
|
|
87
92
|
var camDir = camPos.clone().normalize();
|
|
88
93
|
var topDir = new Vector3(0, 0, 1);
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
var shiftToCamera =
|
|
94
|
+
|
|
95
|
+
// Tangent points satisfy dot(point, camera) = R², so the silhouette circle
|
|
96
|
+
// lies R² / |camera| toward the camera. This depends only on camera distance;
|
|
97
|
+
// deriving it from a world-up cross product leaves a gap near the globe's rim.
|
|
98
|
+
var shiftToCamera = normalizedRadius * normalizedRadius / camPos.len();
|
|
94
99
|
var adjustedDiskRadius = Math.sqrt(normalizedRadius * normalizedRadius - shiftToCamera * shiftToCamera);
|
|
95
100
|
|
|
96
101
|
// Camera-facing orientation: the plane's local X/Y axes map to world `right`/`up`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"globe-depth-disk-layer.js","names":["COORDINATE_SYSTEM","SimpleMeshLayer","PlaneGeometry","Vector3","editShader","PLANE_GEOMETRY","type","xlen","ylen","DEPTH_DISK_PARAMETERS","depthTest","cull","DEPTH_DISK_FULL_RADIUS","GLOBE_COMMON_RADIUS","GlobeDepthDiskLayer","_SimpleMeshLayer","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","getShaders","shaders","_superPropGet","vs","inject","_objectSpread","draw","_ref","uniforms","normalizedRadius","camPos","context","viewport","cameraPosition","camDir","clone","normalize","topDir","sideDir","cross","sidePoint","scale","camToSide","subtract","adjustedSidePoint","shiftToCamera","dot","adjustedDiskRadius","Math","sqrt","forward","right","up","model","state","props","u_depthDiskOrientCol0","u_depthDiskOrientCol1","u_depthDiskOrientCol2","u_directionToCamera","u_depthDiskShift","u_depthDiskRadius","_defineProperty","getGlobeDepthDiskLayer","_ref2","fillColor","id","data","coordinateOrigin","coordinateSystem","CARTESIAN","getPosition","d","getColor","mesh","parameters"],"sources":["../../../src/globe/globe-depth-disk-layer.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nimport {COORDINATE_SYSTEM} from '@deck.gl/core';\nimport {SimpleMeshLayer} from '@deck.gl/mesh-layers';\nimport {PlaneGeometry} from '@luma.gl/engine';\nimport {Vector3} from '@math.gl/core';\n\nimport {editShader} from '../layer-utils/shader-utils';\nimport type {RGBColor} from '@kepler.gl/types';\n\n// luma.gl 9's PlaneGeometry ignores `radius`; pass explicit type/xlen/ylen so we\n// get a [-1, 1] quad (a `radius: 1` plane would only span [-0.5, 0.5]).\nconst PLANE_GEOMETRY = new PlaneGeometry({\n type: 'x,y',\n xlen: 2,\n ylen: 2\n} as any);\n\nconst DEPTH_DISK_PARAMETERS = {\n // Depth writes only happen with depthTest enabled. The disk is opaque-black-ish\n // and used purely to fill the depth buffer so far-side geometry (arcs/lines) is\n // occluded by the planet.\n depthTest: true,\n cull: false\n};\n\n// Earth radius in meters. The disk geometry is a [-1, 1] plane; we scale it into\n// METERS in the vertex shader (like the atmosphere SphereGeometry, whose radius is\n// ~6.4e6 m) and let SimpleMeshLayer's stock projection map it onto the globe —\n// exactly the working path the atmosphere mesh layers use.\nconst DEPTH_DISK_FULL_RADIUS = 6.371e6;\n\n// Globe common space uses GLOBE_RADIUS = 256 units (see deck.gl's project_globe_).\n// The disk orientation math is done in that 256-unit common space (matching\n// viewport.cameraPosition), then the resulting radius/shift ratios are converted to\n// meters for the shader, since the disk geometry is expressed in meters.\nexport const GLOBE_COMMON_RADIUS = 256;\n\n/**\n * Creates a view-oriented disk positioned along the direction from the globe's center to the camera.\n * The disk is a cross-section of the globe between the front (visible) and back side, and it fills\n * the depth buffer so anything on the far side of the globe (e.g. arcs/lines) is depth-culled and\n * hidden behind the planet.\n */\nexport class GlobeDepthDiskLayer extends SimpleMeshLayer<any> {\n static layerName = 'GlobeDepthDiskLayer';\n\n getShaders(): any {\n const shaders = super.getShaders();\n\n // Override the local `pos` computation: reorient the flat [-1,1] plane to face\n // the camera, scale it to meters, and shift it toward the camera along the view\n // axis so it sits at the globe's silhouette cross-section. The stock\n // project_position_to_clipspace call is left untouched so the disk projects onto\n // the globe through the exact same (working) path the atmosphere mesh layers use.\n const vs = editShader(\n shaders.vs,\n 'globe depth disk vs',\n 'vec3 pos = (instanceModelMatrix * positions) * simpleMesh.sizeScale + instanceTranslation;',\n `mat3 u_matDepthDiskOrientation = mat3(\n u_depthDiskOrientCol0,\n u_depthDiskOrientCol1,\n u_depthDiskOrientCol2\n );\n vec3 pos = (u_matDepthDiskOrientation * positions) * u_depthDiskRadius;\n vDepthDiskPos = pos;\n pos = pos + u_directionToCamera * u_depthDiskShift;\n `\n );\n\n const inject = {\n 'vs:#decl': `\n uniform vec3 u_depthDiskOrientCol0;\n uniform vec3 u_depthDiskOrientCol1;\n uniform vec3 u_depthDiskOrientCol2;\n uniform vec3 u_directionToCamera;\n uniform float u_depthDiskShift;\n uniform float u_depthDiskRadius;\n out vec3 vDepthDiskPos;\n `,\n 'fs:#decl': `\n uniform float u_depthDiskRadius;\n in vec3 vDepthDiskPos;\n `,\n 'fs:#main-start': `\n if (length(vDepthDiskPos) > u_depthDiskRadius) {\n discard;\n }\n `\n };\n\n return {\n ...shaders,\n vs,\n inject\n };\n }\n\n draw({uniforms}: {uniforms: object}): void {\n const normalizedRadius = GLOBE_COMMON_RADIUS;\n\n const camPos = new Vector3((this.context.viewport as any).cameraPosition);\n const camDir = camPos.clone().normalize();\n const topDir = new Vector3(0, 0, 1);\n const sideDir = camDir.clone().cross(topDir);\n const sidePoint = sideDir.clone().scale(normalizedRadius);\n\n const camToSide = sidePoint.clone().subtract(camPos).normalize();\n const adjustedSidePoint = camToSide.cross(topDir).scale(-normalizedRadius);\n\n const shiftToCamera = camDir.dot(adjustedSidePoint);\n const adjustedDiskRadius = Math.sqrt(\n normalizedRadius * normalizedRadius - shiftToCamera * shiftToCamera\n );\n\n // Camera-facing orientation: the plane's local X/Y axes map to world `right`/`up`\n // (both perpendicular to the camera direction), and local Z maps to `forward`.\n // Columns are handed to the shader as vec3s to avoid Matrix3 row/column ambiguity.\n const forward = camDir.clone();\n const right = topDir.clone().cross(forward).normalize();\n const up = forward.clone().cross(right).normalize();\n\n const model = this.state.model;\n if (model) {\n // Use the same uniform-delivery mechanism as the (working) atmosphere layers:\n // raw `uniform` declarations + assignment to model.props.uniforms.\n (model as any).props.uniforms = {\n ...(model as any).props.uniforms,\n // mat3(col0, col1, col2) in GLSL is column-major; mat3 * (x, y, 0) = x*right + y*up.\n u_depthDiskOrientCol0: [right[0], right[1], right[2]],\n u_depthDiskOrientCol1: [up[0], up[1], up[2]],\n u_depthDiskOrientCol2: [forward[0], forward[1], forward[2]],\n u_directionToCamera: [camDir[0], camDir[1], camDir[2]],\n // Convert the common-space (256-unit) radius/shift to meters, since the disk\n // geometry (and therefore `pos`) is expressed in meters.\n u_depthDiskShift: (shiftToCamera / normalizedRadius) * DEPTH_DISK_FULL_RADIUS,\n u_depthDiskRadius: (adjustedDiskRadius / normalizedRadius) * DEPTH_DISK_FULL_RADIUS\n };\n }\n super.draw({uniforms});\n }\n}\n\nexport const getGlobeDepthDiskLayer = ({fillColor}: {fillColor?: RGBColor}) => {\n return new GlobeDepthDiskLayer({\n id: 'globe-depth-disk-layer',\n data: [[0, 0, 0]],\n coordinateOrigin: [0, 0, 0],\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n getPosition: (d: number[]) => d,\n getColor: (fillColor ?? [0, 0, 0]) as any,\n mesh: PLANE_GEOMETRY,\n parameters: DEPTH_DISK_PARAMETERS\n } as any);\n};\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;;AAEA,SAAQA,iBAAiB,QAAO,eAAe;AAC/C,SAAQC,eAAe,QAAO,sBAAsB;AACpD,SAAQC,aAAa,QAAO,iBAAiB;AAC7C,SAAQC,OAAO,QAAO,eAAe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,EAAExE,iBAAiB,CAACyE,SAAS;IAC7CC,WAAW,EAAE,SAAbA,WAAWA,CAAGC,CAAW;MAAA,OAAKA,CAAC;IAAA;IAC/BC,QAAQ,EAAGR,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAS;IACzCS,IAAI,EAAExE,cAAc;IACpByE,UAAU,EAAErE;EACd,CAAQ,CAAC;AACX,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"globe-depth-disk-layer.js","names":["COORDINATE_SYSTEM","SimpleMeshLayer","PlaneGeometry","Vector3","editShader","PLANE_GEOMETRY","type","xlen","ylen","DEPTH_DISK_PARAMETERS","depthTest","depthMask","cull","cullMode","DEPTH_DISK_FULL_RADIUS","GLOBE_COMMON_RADIUS","GlobeDepthDiskLayer","_SimpleMeshLayer","_classCallCheck","_callSuper","arguments","_inherits","_createClass","key","value","getShaders","shaders","_superPropGet","vs","inject","_objectSpread","draw","_ref","uniforms","normalizedRadius","camPos","context","viewport","cameraPosition","camDir","clone","normalize","topDir","shiftToCamera","len","adjustedDiskRadius","Math","sqrt","forward","right","cross","up","model","state","props","u_depthDiskOrientCol0","u_depthDiskOrientCol1","u_depthDiskOrientCol2","u_directionToCamera","u_depthDiskShift","u_depthDiskRadius","_defineProperty","getGlobeDepthDiskLayer","_ref2","fillColor","id","data","coordinateOrigin","coordinateSystem","CARTESIAN","getPosition","d","getColor","mesh","parameters"],"sources":["../../../src/globe/globe-depth-disk-layer.ts"],"sourcesContent":["// SPDX-License-Identifier: MIT\n// Copyright contributors to the kepler.gl project\n\nimport {COORDINATE_SYSTEM} from '@deck.gl/core';\nimport {SimpleMeshLayer} from '@deck.gl/mesh-layers';\nimport {PlaneGeometry} from '@luma.gl/engine';\nimport {Vector3} from '@math.gl/core';\n\nimport {editShader} from '../layer-utils/shader-utils';\nimport type {RGBColor} from '@kepler.gl/types';\n\n// luma.gl 9's PlaneGeometry ignores `radius`; pass explicit type/xlen/ylen so we\n// get a [-1, 1] quad (a `radius: 1` plane would only span [-0.5, 0.5]).\nconst PLANE_GEOMETRY = new PlaneGeometry({\n type: 'x,y',\n xlen: 2,\n ylen: 2\n} as any);\n\nconst DEPTH_DISK_PARAMETERS = {\n // Depth writes only happen with depthTest enabled. The disk is opaque-black-ish\n // and used purely to fill the depth buffer so far-side geometry (arcs/lines) is\n // occluded by the planet.\n depthTest: true,\n // Do not inherit a disabled depth mask from earlier rendering.\n depthMask: true,\n cull: false,\n // Deck normalizes the globe's global cull:true to cullMode:'back'. Luma applies\n // that modern parameter after cull:false, which otherwise discards this plane.\n cullMode: 'none'\n};\n\n// Earth radius in meters. The disk geometry is a [-1, 1] plane; we scale it into\n// METERS in the vertex shader (like the atmosphere SphereGeometry, whose radius is\n// ~6.4e6 m) and let SimpleMeshLayer's stock projection map it onto the globe —\n// exactly the working path the atmosphere mesh layers use.\nconst DEPTH_DISK_FULL_RADIUS = 6.371e6;\n\n// Globe common space uses GLOBE_RADIUS = 256 units (see deck.gl's project_globe_).\n// The disk orientation math is done in that 256-unit common space (matching\n// viewport.cameraPosition), then the resulting radius/shift ratios are converted to\n// meters for the shader, since the disk geometry is expressed in meters.\nexport const GLOBE_COMMON_RADIUS = 256;\n\n/**\n * Creates a view-oriented disk positioned along the direction from the globe's center to the camera.\n * The disk is a cross-section of the globe between the front (visible) and back side, and it fills\n * the depth buffer so anything on the far side of the globe (e.g. arcs/lines) is depth-culled and\n * hidden behind the planet.\n */\nexport class GlobeDepthDiskLayer extends SimpleMeshLayer<any> {\n static layerName = 'GlobeDepthDiskLayer';\n\n getShaders(): any {\n const shaders = super.getShaders();\n\n // Override the local `pos` computation: reorient the flat [-1,1] plane to face\n // the camera, scale it to meters, and shift it toward the camera along the view\n // axis so it sits at the globe's silhouette cross-section. The stock\n // project_position_to_clipspace call is left untouched so the disk projects onto\n // the globe through the exact same (working) path the atmosphere mesh layers use.\n const vs = editShader(\n shaders.vs,\n 'globe depth disk vs',\n 'vec3 pos = (instanceModelMatrix * positions) * simpleMesh.sizeScale + instanceTranslation;',\n `mat3 u_matDepthDiskOrientation = mat3(\n u_depthDiskOrientCol0,\n u_depthDiskOrientCol1,\n u_depthDiskOrientCol2\n );\n vec3 pos = (u_matDepthDiskOrientation * positions) * u_depthDiskRadius;\n vDepthDiskPos = pos;\n pos = pos + u_directionToCamera * u_depthDiskShift;\n `\n );\n\n const inject = {\n 'vs:#decl': `\n uniform vec3 u_depthDiskOrientCol0;\n uniform vec3 u_depthDiskOrientCol1;\n uniform vec3 u_depthDiskOrientCol2;\n uniform vec3 u_directionToCamera;\n uniform float u_depthDiskShift;\n uniform float u_depthDiskRadius;\n out vec3 vDepthDiskPos;\n `,\n 'fs:#decl': `\n uniform float u_depthDiskRadius;\n in vec3 vDepthDiskPos;\n `,\n 'fs:#main-start': `\n if (length(vDepthDiskPos) > u_depthDiskRadius) {\n discard;\n }\n `\n };\n\n return {\n ...shaders,\n vs,\n inject\n };\n }\n\n draw({uniforms}: {uniforms: object}): void {\n const normalizedRadius = GLOBE_COMMON_RADIUS;\n\n const camPos = new Vector3((this.context.viewport as any).cameraPosition);\n const camDir = camPos.clone().normalize();\n const topDir = new Vector3(0, 0, 1);\n\n // Tangent points satisfy dot(point, camera) = R², so the silhouette circle\n // lies R² / |camera| toward the camera. This depends only on camera distance;\n // deriving it from a world-up cross product leaves a gap near the globe's rim.\n const shiftToCamera = (normalizedRadius * normalizedRadius) / camPos.len();\n const adjustedDiskRadius = Math.sqrt(\n normalizedRadius * normalizedRadius - shiftToCamera * shiftToCamera\n );\n\n // Camera-facing orientation: the plane's local X/Y axes map to world `right`/`up`\n // (both perpendicular to the camera direction), and local Z maps to `forward`.\n // Columns are handed to the shader as vec3s to avoid Matrix3 row/column ambiguity.\n const forward = camDir.clone();\n const right = topDir.clone().cross(forward).normalize();\n const up = forward.clone().cross(right).normalize();\n\n const model = this.state.model;\n if (model) {\n // Use the same uniform-delivery mechanism as the (working) atmosphere layers:\n // raw `uniform` declarations + assignment to model.props.uniforms.\n (model as any).props.uniforms = {\n ...(model as any).props.uniforms,\n // mat3(col0, col1, col2) in GLSL is column-major; mat3 * (x, y, 0) = x*right + y*up.\n u_depthDiskOrientCol0: [right[0], right[1], right[2]],\n u_depthDiskOrientCol1: [up[0], up[1], up[2]],\n u_depthDiskOrientCol2: [forward[0], forward[1], forward[2]],\n u_directionToCamera: [camDir[0], camDir[1], camDir[2]],\n // Convert the common-space (256-unit) radius/shift to meters, since the disk\n // geometry (and therefore `pos`) is expressed in meters.\n u_depthDiskShift: (shiftToCamera / normalizedRadius) * DEPTH_DISK_FULL_RADIUS,\n u_depthDiskRadius: (adjustedDiskRadius / normalizedRadius) * DEPTH_DISK_FULL_RADIUS\n };\n }\n super.draw({uniforms});\n }\n}\n\nexport const getGlobeDepthDiskLayer = ({fillColor}: {fillColor?: RGBColor}) => {\n return new GlobeDepthDiskLayer({\n id: 'globe-depth-disk-layer',\n data: [[0, 0, 0]],\n coordinateOrigin: [0, 0, 0],\n coordinateSystem: COORDINATE_SYSTEM.CARTESIAN,\n getPosition: (d: number[]) => d,\n getColor: (fillColor ?? [0, 0, 0]) as any,\n mesh: PLANE_GEOMETRY,\n parameters: DEPTH_DISK_PARAMETERS\n } as any);\n};\n"],"mappings":";;;;;;;;;;;;AAAA;AACA;;AAEA,SAAQA,iBAAiB,QAAO,eAAe;AAC/C,SAAQC,eAAe,QAAO,sBAAsB;AACpD,SAAQC,aAAa,QAAO,iBAAiB;AAC7C,SAAQC,OAAO,QAAO,eAAe;AAErC,SAAQC,UAAU,QAAO,6BAA6B;AAGtD;AACA;AACA,IAAMC,cAAc,GAAG,IAAIH,aAAa,CAAC;EACvCI,IAAI,EAAE,KAAK;EACXC,IAAI,EAAE,CAAC;EACPC,IAAI,EAAE;AACR,CAAQ,CAAC;AAET,IAAMC,qBAAqB,GAAG;EAC5B;EACA;EACA;EACAC,SAAS,EAAE,IAAI;EACf;EACAC,SAAS,EAAE,IAAI;EACfC,IAAI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;UACtD;UACA;UACAoB,gBAAgB,EAAGhB,aAAa,GAAGT,gBAAgB,GAAIpB,sBAAsB;UAC7E8C,iBAAiB,EAAGf,kBAAkB,GAAGX,gBAAgB,GAAIpB;QAAsB,EACpF;MACH;MACAa,aAAA,CAAAX,mBAAA,oBAAW;QAACiB,QAAQ,EAARA;MAAQ,CAAC;IACvB;EAAC;AAAA,EA9FsChC,eAAe;AA+FvD4D,eAAA,CA/FY7C,mBAAmB,eACX,qBAAqB;AAgG1C,OAAO,IAAM8C,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAAAC,KAAA,EAA4C;EAAA,IAAvCC,SAAS,GAAAD,KAAA,CAATC,SAAS;EAC/C,OAAO,IAAIhD,mBAAmB,CAAC;IAC7BiD,EAAE,EAAE,wBAAwB;IAC5BC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACjBC,gBAAgB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IAC3BC,gBAAgB,EAAEpE,iBAAiB,CAACqE,SAAS;IAC7CC,WAAW,EAAE,SAAbA,WAAWA,CAAGC,CAAW;MAAA,OAAKA,CAAC;IAAA;IAC/BC,QAAQ,EAAGR,SAAS,aAATA,SAAS,cAATA,SAAS,GAAI,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAS;IACzCS,IAAI,EAAEpE,cAAc;IACpBqE,UAAU,EAAEjE;EACd,CAAQ,CAAC;AACX,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kepler.gl/deckgl-layers",
|
|
3
3
|
"author": "Shan He <shan@uber.com>",
|
|
4
|
-
"version": "3.3.0-alpha.
|
|
4
|
+
"version": "3.3.0-alpha.29",
|
|
5
5
|
"description": "kepler.gl constants used by kepler.gl components, actions and reducers",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/cjs/index.js",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"@deck.gl/geo-layers": "^9.4.1",
|
|
34
34
|
"@deck.gl/layers": "^9.4.1",
|
|
35
35
|
"@deck.gl/mesh-layers": "^9.4.1",
|
|
36
|
-
"@kepler.gl/constants": "3.3.0-alpha.
|
|
37
|
-
"@kepler.gl/types": "3.3.0-alpha.
|
|
38
|
-
"@kepler.gl/utils": "3.3.0-alpha.
|
|
36
|
+
"@kepler.gl/constants": "3.3.0-alpha.29",
|
|
37
|
+
"@kepler.gl/types": "3.3.0-alpha.29",
|
|
38
|
+
"@kepler.gl/utils": "3.3.0-alpha.29",
|
|
39
39
|
"@loaders.gl/wms": "4.4.5",
|
|
40
40
|
"@luma.gl/constants": "^9.4.2",
|
|
41
41
|
"@luma.gl/core": "^9.4.2",
|