@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.mjs 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
  /******************************************************************************
@@ -2192,7 +2192,7 @@ var GLShaderLibrary = /** @class */ (function () {
2192
2192
  this._glFragShaderMap = new Map();
2193
2193
  }
2194
2194
  // @ts-expect-error safe to assign
2195
- this['renderer'] = null;
2195
+ this.renderer = null;
2196
2196
  };
2197
2197
  return GLShaderLibrary;
2198
2198
  }());
@@ -2503,7 +2503,12 @@ var GLTexture = /** @class */ (function () {
2503
2503
  gpuInfo[0] = internalFormat_1;
2504
2504
  gpuInfo[1] = type_1;
2505
2505
  gpuInfo[2] = target;
2506
- renderer.state.pixelStorei(gl_1.UNPACK_PREMULTIPLY_ALPHA_WEBGL, options.premultiplyAlpha ? 1 : 0);
2506
+ var pma = gl_1.getParameter(gl_1.UNPACK_PREMULTIPLY_ALPHA_WEBGL);
2507
+ //fucking pma conflicts for other webgl engine
2508
+ if (pma != options.premultiplyAlpha) {
2509
+ gl_1.pixelStorei(gl_1.UNPACK_PREMULTIPLY_ALPHA_WEBGL, options.premultiplyAlpha ? 1 : 0);
2510
+ }
2511
+ // renderer.state.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, options.premultiplyAlpha ? 1 : 0);
2507
2512
  renderer.state.pixelStorei(gl_1.UNPACK_FLIP_Y_WEBGL, flipY ? 1 : 0);
2508
2513
  if (sourceType === TextureSourceType.framebuffer) {
2509
2514
  var data = source.data;
@@ -2615,6 +2620,9 @@ var GLTexture = /** @class */ (function () {
2615
2620
  if (!this._mipmapUsed) {
2616
2621
  this.gpuInfo[3] = [[width_1, height_1]];
2617
2622
  }
2623
+ if (pma != options.premultiplyAlpha) {
2624
+ gl_1.pixelStorei(gl_1.UNPACK_PREMULTIPLY_ALPHA_WEBGL, pma);
2625
+ }
2618
2626
  this.width = width_1;
2619
2627
  this.height = height_1;
2620
2628
  this.setTextureFilters(gl_1, target, options);
@@ -3369,10 +3377,7 @@ var GLFrameBuffer = /** @class */ (function () {
3369
3377
  gl.framebufferRenderbuffer(gl.FRAMEBUFFER, attachment_1, gl.RENDERBUFFER, renderBuffer.glHandle);
3370
3378
  gl.bindFramebuffer(gl.FRAMEBUFFER, this.fbo);
3371
3379
  }
3372
- depthTexture.update({
3373
- sourceType: TextureSourceType.framebuffer,
3374
- data: { width: viewport[2], height: viewport[3] },
3375
- });
3380
+ depthTexture.update({ data: { width: viewport[2], height: viewport[3], data: new Uint16Array(0) } });
3376
3381
  var attachment = depthTexture && stencilTexture ? gl.DEPTH_STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT;
3377
3382
  gl.framebufferTexture2D(FRAMEBUFFER, attachment, gl.TEXTURE_2D, depthTexture.glHandle, 0);
3378
3383
  }
@@ -3415,7 +3420,7 @@ var GLFrameBuffer = /** @class */ (function () {
3415
3420
  var gl = this.renderer.gl;
3416
3421
  var gpu = this.renderer.gpu;
3417
3422
  var viewport = this.viewport;
3418
- var data = { width: viewport[2], height: viewport[3] };
3423
+ var data = { width: viewport[2], height: viewport[3], data: new Uint8Array(0) };
3419
3424
  var buffers = [];
3420
3425
  if (colors) {
3421
3426
  this.colorTextures = colors.slice();
@@ -3423,7 +3428,7 @@ var GLFrameBuffer = /** @class */ (function () {
3423
3428
  this.renderer.state.activeTexture(gl.TEXTURE0);
3424
3429
  var multisampleFBO = this.multisampleFbo;
3425
3430
  this.colorTextures.forEach(function (tex, index) {
3426
- tex.update({ sourceType: TextureSourceType.framebuffer, data: data });
3431
+ tex.update({ data: data });
3427
3432
  if (multisampleFBO) {
3428
3433
  gl.bindFramebuffer(gl.FRAMEBUFFER, multisampleFBO);
3429
3434
  var renderBuffer = new GLRenderBuffer(_this.renderer, {
@@ -3915,15 +3920,12 @@ var MarsTexture = /** @class */ (function () {
3915
3920
  }, options);
3916
3921
  if (!opt.sourceType) {
3917
3922
  if (opt.image) {
3918
- // @ts-expect-error
3919
3923
  opt.sourceType = TextureSourceType.image;
3920
3924
  }
3921
3925
  else if (opt.data) {
3922
- // @ts-expect-error
3923
3926
  opt.sourceType = TextureSourceType.data;
3924
3927
  }
3925
3928
  else if (opt.video) {
3926
- // @ts-expect-error
3927
3929
  opt.sourceType = TextureSourceType.video;
3928
3930
  }
3929
3931
  else {
@@ -3992,7 +3994,7 @@ var MarsTexture = /** @class */ (function () {
3992
3994
  };
3993
3995
  MarsTexture.prototype.uploadCurrentVideoFrame = function () {
3994
3996
  if (this.options.sourceType === TextureSourceType.video && this.options.video && this.internal) {
3995
- this.internal.update({ sourceType: TextureSourceType.video, video: this.options.video });
3997
+ this.internal.update({ video: this.options.video });
3996
3998
  return true;
3997
3999
  }
3998
4000
  return false;
@@ -5829,7 +5831,7 @@ var MarsSharedGeometry = /** @class */ (function (_super) {
5829
5831
  return MarsSharedGeometry;
5830
5832
  }(MarsGeometry));
5831
5833
 
5832
- consoleLog('version: ' + "0.1.65-beta.5");
5834
+ consoleLog('version: ' + "0.1.65-beta.7");
5833
5835
 
5834
5836
  export { DestroyOptions, GPUBufferOptionsMemoryShared, MarsGeometry as Geometry, MarsInstancedMesh as InstancedMesh, MarsTextureFactory, MarsMaterial as Material, MarsMaterialDataBlock as MaterialDataBlock, MarsMesh as Mesh, MarsRenderFrame as RenderFrame, MarsRenderPass as RenderPass, RenderPassAttachmentStorageType, RenderPassDestroyAttachmentType, RenderPassMeshOrder, RenderPassPriorityNormal, RenderPassPriorityPostprocess, RenderPassPriorityPrepare, MarsRenderer as Renderer, ShaderCompileResultStatus, ShaderLibraryEmpty, MarsSharedGeometry as SharedGeometry, MarsTexture as Texture, TextureLoadAction, TextureSourceType, TextureStoreAction, constants, getDefaultGPUCapability, getDefaultTextureFactory, setDefaultTextureFactory };
5835
5837
  //# sourceMappingURL=index.mjs.map