@pirireis/webglobeplugins 1.6.2 → 1.6.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pirireis/webglobeplugins",
3
- "version": "1.6.2",
3
+ "version": "1.6.3",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT",
@@ -404,6 +404,7 @@ export class TerrainPolygonSemiPlugin {
404
404
  return;
405
405
  }
406
406
  const gl = this.globe.gl;
407
+ const globeFBO = gl.getParameter(gl.FRAMEBUFFER_BINDING);
407
408
  const useDepth = this._useDepth();
408
409
  gl.enable(gl.BLEND);
409
410
  defaultblendfunction(gl);
@@ -447,7 +448,7 @@ export class TerrainPolygonSemiPlugin {
447
448
  gl.frontFace(gl.CCW);
448
449
  if (this._pickerDisplayer && !this._options.pickablePause && !useDepth) {
449
450
  gl.bindFramebuffer(gl.FRAMEBUFFER, null);
450
- this._pickerDisplayer.drawColorTexture();
451
+ this._pickerDisplayer.drawColorTexture(globeFBO);
451
452
  this._selfSelect();
452
453
  }
453
454
  if (this._options.drawEdges) {
@@ -295,6 +295,11 @@ class PointTracksPlugin {
295
295
  throw new Error("Plugin is unregistered, PointTracks Plugin");
296
296
  }
297
297
  this.resize();
298
+ // Save the framebuffer the globe is currently rendering into and pass it to the
299
+ // program so the final composite lands in the globe's render target. The globe may
300
+ // render to its own FBO (3D depth-buffered mode); forcing null would discard the
301
+ // output and break subsequent plugins.
302
+ const globeFBO = gl.getParameter(gl.FRAMEBUFFER_BINDING);
298
303
  _pickerDisplayer.bindFBO();
299
304
  _pickerDisplayer.clearTextures();
300
305
  if (this._focusParams.on) {
@@ -303,8 +308,7 @@ class PointTracksPlugin {
303
308
  else {
304
309
  _pointProgram.draw(_vao, _bufferOrchestrator.length, this._drawOptionsUBO, null);
305
310
  }
306
- gl.bindFramebuffer(gl.FRAMEBUFFER, null);
307
- _pickerDisplayer.drawColorTexture();
311
+ _pickerDisplayer.drawColorTexture(globeFBO);
308
312
  this._selfSelect();
309
313
  }
310
314
  resize() {
@@ -175,11 +175,11 @@ class PickerDisplayer {
175
175
  }
176
176
  }
177
177
  // call after drawing the scene with gl picker shader
178
- drawColorTexture() {
178
+ drawColorTexture(targetFBO) {
179
179
  const gl = this.gl;
180
180
  const saved = this._saveState();
181
181
  try {
182
- gl.bindFramebuffer(gl.FRAMEBUFFER, null);
182
+ gl.bindFramebuffer(gl.FRAMEBUFFER, targetFBO);
183
183
  gl.disable(gl.DEPTH_TEST);
184
184
  this.displayer.draw(this.colorTexture);
185
185
  }
@@ -206,7 +206,6 @@ export default class WindPlugin {
206
206
  }
207
207
  setUseSpeedField(use) {
208
208
  if (this.particlePlugin) {
209
- console.log("use speed field set to ", use);
210
209
  this.particlePlugin.setUseSpeedField(use);
211
210
  }
212
211
  }
@@ -228,7 +227,6 @@ export default class WindPlugin {
228
227
  set minSpeed(value) {
229
228
  this.options.minSpeed = value;
230
229
  if (this.particlePlugin) {
231
- console.log("value", value);
232
230
  this.particlePlugin.setMinSpeedThreshold(value);
233
231
  }
234
232
  }