@predy-js/render-interface 0.1.65-beta.5 → 0.1.65-beta.7

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/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Name: @predy-js/render-interface
3
3
  * Description: undefined
4
4
  * Author: undefined
5
- * Version: v0.1.65-beta.5
5
+ * Version: v0.1.65-beta.7
6
6
  */
7
7
 
8
8
  'use strict';
@@ -2196,7 +2196,7 @@ var GLShaderLibrary = /** @class */ (function () {
2196
2196
  this._glFragShaderMap = new Map();
2197
2197
  }
2198
2198
  // @ts-expect-error safe to assign
2199
- this['renderer'] = null;
2199
+ this.renderer = null;
2200
2200
  };
2201
2201
  return GLShaderLibrary;
2202
2202
  }());
@@ -2507,7 +2507,12 @@ var GLTexture = /** @class */ (function () {
2507
2507
  gpuInfo[0] = internalFormat_1;
2508
2508
  gpuInfo[1] = type_1;
2509
2509
  gpuInfo[2] = target;
2510
- renderer.state.pixelStorei(gl_1.UNPACK_PREMULTIPLY_ALPHA_WEBGL, options.premultiplyAlpha ? 1 : 0);
2510
+ var pma = gl_1.getParameter(gl_1.UNPACK_PREMULTIPLY_ALPHA_WEBGL);
2511
+ //fucking pma conflicts for other webgl engine
2512
+ if (pma != options.premultiplyAlpha) {
2513
+ gl_1.pixelStorei(gl_1.UNPACK_PREMULTIPLY_ALPHA_WEBGL, options.premultiplyAlpha ? 1 : 0);
2514
+ }
2515
+ // renderer.state.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, options.premultiplyAlpha ? 1 : 0);
2511
2516
  renderer.state.pixelStorei(gl_1.UNPACK_FLIP_Y_WEBGL, flipY ? 1 : 0);
2512
2517
  if (sourceType === exports.TextureSourceType.framebuffer) {
2513
2518
  var data = source.data;
@@ -2619,6 +2624,9 @@ var GLTexture = /** @class */ (function () {
2619
2624
  if (!this._mipmapUsed) {
2620
2625
  this.gpuInfo[3] = [[width_1, height_1]];
2621
2626
  }
2627
+ if (pma != options.premultiplyAlpha) {
2628
+ gl_1.pixelStorei(gl_1.UNPACK_PREMULTIPLY_ALPHA_WEBGL, pma);
2629
+ }
2622
2630
  this.width = width_1;
2623
2631
  this.height = height_1;
2624
2632
  this.setTextureFilters(gl_1, target, options);
@@ -3373,10 +3381,7 @@ var GLFrameBuffer = /** @class */ (function () {
3373
3381
  gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment_1, gl.RENDERBUFFER, renderBuffer.glHandle);
3374
3382
  gl.bindFramebuffer(gl.FRAMEBUFFER, this.fbo);
3375
3383
  }
3376
- depthTexture.update({
3377
- sourceType: exports.TextureSourceType.framebuffer,
3378
- data: { width: viewport[2], height: viewport[3] },
3379
- });
3384
+ depthTexture.update({ data: { width: viewport[2], height: viewport[3], data: new Uint16Array(0) } });
3380
3385
  var attachment = depthTexture && stencilTexture ? gl.DEPTH_STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT;
3381
3386
  gl.framebufferTexture2D(FRAMEBUFFER, attachment, gl.TEXTURE_2D, depthTexture.glHandle, 0);
3382
3387
  }
@@ -3419,7 +3424,7 @@ var GLFrameBuffer = /** @class */ (function () {
3419
3424
  var gl = this.renderer.gl;
3420
3425
  var gpu = this.renderer.gpu;
3421
3426
  var viewport = this.viewport;
3422
- var data = { width: viewport[2], height: viewport[3] };
3427
+ var data = { width: viewport[2], height: viewport[3], data: new Uint8Array(0) };
3423
3428
  var buffers = [];
3424
3429
  if (colors) {
3425
3430
  this.colorTextures = colors.slice();
@@ -3427,7 +3432,7 @@ var GLFrameBuffer = /** @class */ (function () {
3427
3432
  this.renderer.state.activeTexture(gl.TEXTURE0);
3428
3433
  var multisampleFBO = this.multisampleFbo;
3429
3434
  this.colorTextures.forEach(function (tex, index) {
3430
- tex.update({ sourceType: exports.TextureSourceType.framebuffer, data: data });
3435
+ tex.update({ data: data });
3431
3436
  if (multisampleFBO) {
3432
3437
  gl.bindFramebuffer(gl.FRAMEBUFFER, multisampleFBO);
3433
3438
  var renderBuffer = new GLRenderBuffer(_this.renderer, {
@@ -3919,15 +3924,12 @@ var MarsTexture = /** @class */ (function () {
3919
3924
  }, options);
3920
3925
  if (!opt.sourceType) {
3921
3926
  if (opt.image) {
3922
- // @ts-expect-error
3923
3927
  opt.sourceType = exports.TextureSourceType.image;
3924
3928
  }
3925
3929
  else if (opt.data) {
3926
- // @ts-expect-error
3927
3930
  opt.sourceType = exports.TextureSourceType.data;
3928
3931
  }
3929
3932
  else if (opt.video) {
3930
- // @ts-expect-error
3931
3933
  opt.sourceType = exports.TextureSourceType.video;
3932
3934
  }
3933
3935
  else {
@@ -3996,7 +3998,7 @@ var MarsTexture = /** @class */ (function () {
3996
3998
  };
3997
3999
  MarsTexture.prototype.uploadCurrentVideoFrame = function () {
3998
4000
  if (this.options.sourceType === exports.TextureSourceType.video && this.options.video && this.internal) {
3999
- this.internal.update({ sourceType: exports.TextureSourceType.video, video: this.options.video });
4001
+ this.internal.update({ video: this.options.video });
4000
4002
  return true;
4001
4003
  }
4002
4004
  return false;
@@ -5833,7 +5835,7 @@ var MarsSharedGeometry = /** @class */ (function (_super) {
5833
5835
  return MarsSharedGeometry;
5834
5836
  }(MarsGeometry));
5835
5837
 
5836
- consoleLog('version: ' + "0.1.65-beta.5");
5838
+ consoleLog('version: ' + "0.1.65-beta.7");
5837
5839
 
5838
5840
  exports.GPUBufferOptionsMemoryShared = GPUBufferOptionsMemoryShared;
5839
5841
  exports.Geometry = MarsGeometry;