@treasuryspatial/map-kit 0.1.18 → 0.1.20

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.
@@ -1 +1 @@
1
- {"version":3,"file":"mapThreeLayer.d.ts","sourceRoot":"","sources":["../src/mapThreeLayer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,QAAQ,CAAC,oBAAoB,CAAC;IACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,SAAS,EAAE,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IACjE,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC;IAC3F,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CAofhF"}
1
+ {"version":3,"file":"mapThreeLayer.d.ts","sourceRoot":"","sources":["../src/mapThreeLayer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,QAAQ,CAAC,oBAAoB,CAAC;IACrC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,SAAS,EAAE,CAAC,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,KAAK,IAAI,CAAC;IACjE,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,KAAK,IAAI,CAAC;IAC3F,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CAggBhF"}
@@ -96,6 +96,16 @@ export function createMapThreeLayer(options) {
96
96
  renderer.clear(true, true, true);
97
97
  checkFramebuffer(gl, 'prerender');
98
98
  renderer.render(scene, camera);
99
+ if (debug && renderTicks < 1) {
100
+ try {
101
+ const pixel = new Uint8Array(4);
102
+ gl.readPixels(0, 0, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel);
103
+ log('renderTarget sample', { r: pixel[0], g: pixel[1], b: pixel[2], a: pixel[3] });
104
+ }
105
+ catch (err) {
106
+ logError('renderTarget sample failed', err);
107
+ }
108
+ }
99
109
  logGlError(gl, 'prerender');
100
110
  renderer.setRenderTarget(null);
101
111
  };
@@ -175,7 +185,7 @@ export function createMapThreeLayer(options) {
175
185
  antialias: true,
176
186
  logarithmicDepthBuffer: true,
177
187
  alpha: true,
178
- premultipliedAlpha: false,
188
+ premultipliedAlpha: true,
179
189
  });
180
190
  renderer.autoClear = false;
181
191
  renderer.outputColorSpace = THREE.SRGBColorSpace;
@@ -190,7 +200,10 @@ export function createMapThreeLayer(options) {
190
200
  depthBuffer: true,
191
201
  stencilBuffer: false,
192
202
  });
203
+ renderTarget.texture.format = THREE.RGBAFormat;
204
+ renderTarget.texture.type = THREE.UnsignedByteType;
193
205
  renderTarget.texture.colorSpace = THREE.SRGBColorSpace;
206
+ renderTarget.texture.premultiplyAlpha = true;
194
207
  log('renderTarget', { width: targetWidth, height: targetHeight });
195
208
  const vsrc = `
196
209
  attribute vec2 a_pos;
@@ -340,7 +353,7 @@ export function createMapThreeLayer(options) {
340
353
  gl.disable(gl.SCISSOR_TEST);
341
354
  gl.colorMask(true, true, true, true);
342
355
  gl.enable(gl.BLEND);
343
- gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
356
+ gl.blendFuncSeparate(gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
344
357
  const canvas = mapRef?.getCanvas();
345
358
  if (canvas) {
346
359
  gl.viewport(0, 0, canvas.width, canvas.height);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@treasuryspatial/map-kit",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "main": "./dist/index.js",