@deck.gl/extensions 9.4.0-alpha.1 → 9.4.0-beta.1
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.
- package/dist/clip/clip-extension.d.ts +3 -0
- package/dist/clip/clip-extension.d.ts.map +1 -1
- package/dist/clip/clip-extension.js +7 -0
- package/dist/clip/clip-extension.js.map +1 -1
- package/dist/dist.dev.js +1164 -5
- package/dist/index.cjs +2623 -128
- package/dist/index.cjs.map +3 -4
- package/dist/terrain/shader-module.d.ts +16 -2
- package/dist/terrain/shader-module.d.ts.map +1 -1
- package/dist/utils/debug.d.ts.map +1 -1
- package/dist.min.js +1197 -54
- package/package.json +10 -6
- package/src/clip/clip-extension.ts +15 -1
|
@@ -64,8 +64,22 @@ export declare const terrainModule: {
|
|
|
64
64
|
readonly pseudoMeters: "f32";
|
|
65
65
|
};
|
|
66
66
|
}];
|
|
67
|
-
readonly vs: `${string}
|
|
68
|
-
|
|
67
|
+
readonly vs: `${string}
|
|
68
|
+
out vec3 commonPos;
|
|
69
|
+
// In globe mode, absolute Mercator position for terrain FBO UV lookups
|
|
70
|
+
out vec2 terrainMercPos;
|
|
71
|
+
out float terrainHeight;
|
|
72
|
+
|
|
73
|
+
vec2 terrain_globe_to_mercator(vec3 globePosition) {
|
|
74
|
+
float D = length(globePosition);
|
|
75
|
+
float sinLat = clamp(globePosition.z / D, -0.999998, 0.999998);
|
|
76
|
+
float x = atan(globePosition.x, -globePosition.y);
|
|
77
|
+
float y = atanh(sinLat);
|
|
78
|
+
return (vec2(x, y) + PI) * WORLD_SCALE;
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
81
|
+
readonly fs: `${string}in vec2 terrainMercPos;
|
|
82
|
+
in float terrainHeight;`;
|
|
69
83
|
readonly inject: {
|
|
70
84
|
readonly 'vs:#main-start': "\nif (terrain.mode == TERRAIN_MODE_SKIP) {\n gl_Position = vec4(0.0);\n return;\n}\n";
|
|
71
85
|
readonly 'vs:DECKGL_FILTER_GL_POSITION': "\ncommonPos = geometry.position.xyz;\nterrainHeight = commonPos.z + project.commonOrigin.z;\nif (project.projectionMode == PROJECTION_MODE_GLOBE) {\n terrainMercPos = terrain_globe_to_mercator(commonPos);\n terrainHeight = length(commonPos) - GLOBE_RADIUS;\n} else {\n terrainMercPos = commonPos.xy;\n}\nif (terrain.mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {\n vec2 texCoords = (terrainMercPos - terrain.bounds.xy) / terrain.bounds.zw;\n position = vec4(texCoords * 2.0 - 1.0, 0.0, 1.0);\n}\nif (terrain.mode == TERRAIN_MODE_USE_HEIGHT_MAP) {\n vec3 anchor = geometry.worldPosition;\n anchor.z = 0.0;\n vec3 anchorCommon = project_position(anchor);\n vec2 anchorMercPos = project.projectionMode == PROJECTION_MODE_GLOBE\n ? terrain_globe_to_mercator(anchorCommon)\n : anchorCommon.xy;\n vec2 texCoords = (anchorMercPos - terrain.bounds.xy) / terrain.bounds.zw;\n if (texCoords.x >= 0.0 && texCoords.y >= 0.0 && texCoords.x <= 1.0 && texCoords.y <= 1.0) {\n float terrainZ = texture(terrain_map, texCoords).r;\n if (project.projectionMode == PROJECTION_MODE_GLOBE) {\n // Height map is written in Mercator common space (units = TILE_SIZE / EARTH_CIRCUMFERENCE / cos(lat))\n // Convert to globe radial units (units = GLOBE_RADIUS / EARTH_RADIUS)\n terrainZ *= cos(radians(geometry.worldPosition.y)) * PI;\n geometry.position.xyz += normalize(geometry.position.xyz) * terrainZ;\n } else {\n geometry.position.z += terrainZ;\n }\n position = project_common_position_to_clipspace(geometry.position);\n }\n}\n ";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader-module.d.ts","sourceRoot":"","sources":["../../src/terrain/shader-module.ts"],"names":[],"mappings":"AAOA,OAAO,EAAU,YAAY,EAAkB,MAAM,eAAe,CAAC;AAErE,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAA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AC;IACjC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAWF,kDAAkD;AAClD,eAAO,MAAM,YAAY;;IAEvB,6EAA6E;;IAE7E,2EAA2E;;IAE3E,6FAA6F;;IAE7F,0EAA0E;;IAE1E,mEAAmE;;CAEpE,CAAC;AAkBF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAiFJ,OAAO,CAAC,kBAAkB,CAAC;;;;;;;;;;;;;CA+EkD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/utils/debug.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,qDAAqD;AAErD,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../src/utils/debug.ts"],"names":[],"mappings":"AAMA,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAE1C,qDAAqD;AAErD,eAAO,MAAM,QAAQ,GACnB,KAAK,WAAW,EAChB,sBAAmB;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAA;CAAM,SAkD9D,CAAC"}
|