@predy-js/render-interface 0.1.65-beta.6 → 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 +16 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -11
- package/dist/index.mjs.map +1 -1
- package/dist/statistic.js +1 -1
- package/dist/types/Texture.d.ts +8 -8
- package/dist/types/native/PredyNativeInternal.d.ts +4 -2
- package/dist/types/native/RendererInternal.d.ts +1 -2
- package/dist/types/native/TextureInternal.d.ts +2 -0
- package/package.json +1 -1
- package/types/Texture.ts +8 -8
- package/types/native/PredyNativeInternal.ts +5 -2
- package/types/native/RendererInternal.ts +1 -2
- package/types/native/TextureInternal.ts +3 -0
- package/README.md +0 -4
- package/types/native/declare.d.ts +0 -5
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
|
+
* 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
|
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
|
-
|
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({
|
3431
|
+
tex.update({ data: data });
|
3427
3432
|
if (multisampleFBO) {
|
3428
3433
|
gl.bindFramebuffer(gl.FRAMEBUFFER, multisampleFBO);
|
3429
3434
|
var renderBuffer = new GLRenderBuffer(_this.renderer, {
|
@@ -3989,7 +3994,7 @@ var MarsTexture = /** @class */ (function () {
|
|
3989
3994
|
};
|
3990
3995
|
MarsTexture.prototype.uploadCurrentVideoFrame = function () {
|
3991
3996
|
if (this.options.sourceType === TextureSourceType.video && this.options.video && this.internal) {
|
3992
|
-
this.internal.update({
|
3997
|
+
this.internal.update({ video: this.options.video });
|
3993
3998
|
return true;
|
3994
3999
|
}
|
3995
4000
|
return false;
|
@@ -5826,7 +5831,7 @@ var MarsSharedGeometry = /** @class */ (function (_super) {
|
|
5826
5831
|
return MarsSharedGeometry;
|
5827
5832
|
}(MarsGeometry));
|
5828
5833
|
|
5829
|
-
consoleLog('version: ' + "0.1.65-beta.
|
5834
|
+
consoleLog('version: ' + "0.1.65-beta.7");
|
5830
5835
|
|
5831
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 };
|
5832
5837
|
//# sourceMappingURL=index.mjs.map
|