@galacean/engine-core 1.2.0-beta.1 → 1.2.0-beta.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/dist/main.js +136 -120
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +136 -120
- package/dist/module.js +136 -120
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/Utils.d.ts +0 -1
- package/types/base/Constant.d.ts +1 -0
- package/types/shaderlib/ShaderFactory.d.ts +2 -0
- package/types/Deprecated.d.ts +0 -101
- package/types/RenderPipeline/RenderPass.d.ts +0 -55
- package/types/renderingHardwareInterface/IHardwareRenderer.d.ts +0 -6
- package/types/texture/enums/PixelFormat.d.ts +0 -73
package/dist/module.js
CHANGED
|
@@ -623,7 +623,7 @@ var Utils = /*#__PURE__*/ function() {
|
|
|
623
623
|
if (Utils.isBase64Url(relativeUrl)) {
|
|
624
624
|
return relativeUrl;
|
|
625
625
|
}
|
|
626
|
-
return relativeUrl ?
|
|
626
|
+
return relativeUrl ? new URL(relativeUrl, baseUrl).href : baseUrl;
|
|
627
627
|
};
|
|
628
628
|
/**
|
|
629
629
|
* @internal
|
|
@@ -766,14 +766,6 @@ var Utils = /*#__PURE__*/ function() {
|
|
|
766
766
|
});
|
|
767
767
|
return result;
|
|
768
768
|
};
|
|
769
|
-
Utils._formatRelativePath = function _formatRelativePath(path) {
|
|
770
|
-
// For example input is "a/b", "/a/b", "./a/b", "./a/./b", "./a/../a/b", output is "a/b"
|
|
771
|
-
return path.split("/").filter(Boolean).reduce(function(acc, cur) {
|
|
772
|
-
if (cur === "..") acc.pop();
|
|
773
|
-
else if (cur !== ".") acc.push(cur);
|
|
774
|
-
return acc;
|
|
775
|
-
}, []).join("/");
|
|
776
|
-
};
|
|
777
769
|
Utils._insertionSort = function _insertionSort(a, from, to, compareFunc) {
|
|
778
770
|
for(var i = from + 1; i < to; i++){
|
|
779
771
|
var j = void 0;
|
|
@@ -1663,6 +1655,7 @@ var GLCapabilityType;
|
|
|
1663
1655
|
GLCapabilityType["colorBufferHalfFloat"] = "EXT_color_buffer_half_float";
|
|
1664
1656
|
GLCapabilityType["textureFilterAnisotropic"] = "EXT_texture_filter_anisotropic";
|
|
1665
1657
|
GLCapabilityType["blendMinMax"] = "EXT_blend_minmax";
|
|
1658
|
+
GLCapabilityType["fragDepth"] = "EXT_frag_depth";
|
|
1666
1659
|
GLCapabilityType["astc"] = "WEBGL_compressed_texture_astc";
|
|
1667
1660
|
GLCapabilityType["astc_webkit"] = "WEBKIT_WEBGL_compressed_texture_astc";
|
|
1668
1661
|
GLCapabilityType["etc"] = "WEBGL_compressed_texture_etc";
|
|
@@ -3426,23 +3419,34 @@ var ShaderFactory = /*#__PURE__*/ function() {
|
|
|
3426
3419
|
* @param shader - code
|
|
3427
3420
|
* @param isFrag - Whether it is a fragment shader.
|
|
3428
3421
|
* */ ShaderFactory.convertTo300 = function convertTo300(shader, isFrag) {
|
|
3429
|
-
/** replace attribute and in */ shader = shader.replace(/\battribute\b/g, "in");
|
|
3430
3422
|
shader = shader.replace(/\bvarying\b/g, isFrag ? "in" : "out");
|
|
3431
|
-
|
|
3432
|
-
shader = shader.replace(/\
|
|
3423
|
+
shader = shader.replace(/\btexture(2D|Cube)\b/g, "texture");
|
|
3424
|
+
shader = shader.replace(/\btexture2DProj\b/g, "textureProj");
|
|
3433
3425
|
if (isFrag) {
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3426
|
+
shader = shader.replace(/\btexture(2D|Cube)LodEXT\b/g, "textureLod");
|
|
3427
|
+
shader = shader.replace(/\btexture(2D|Cube)GradEXT\b/g, "textureGrad");
|
|
3428
|
+
shader = shader.replace(/\btexture2DProjLodEXT\b/g, "textureProjLod");
|
|
3429
|
+
shader = shader.replace(/\btexture2DProjGradEXT\b/g, "textureProjGrad");
|
|
3430
|
+
shader = shader.replace(/\bgl_FragDepthEXT\b/g, "gl_FragDepth");
|
|
3431
|
+
if (!ShaderFactory._has300Output(shader)) {
|
|
3432
|
+
var isMRT = /\bgl_FragData\[.+?\]/g.test(shader);
|
|
3433
|
+
if (isMRT) {
|
|
3434
|
+
shader = shader.replace(/\bgl_FragColor\b/g, "gl_FragData[0]");
|
|
3435
|
+
var result = shader.match(/\bgl_FragData\[.+?\]/g);
|
|
3436
|
+
shader = this._replaceMRTShader(shader, result);
|
|
3437
|
+
} else {
|
|
3438
|
+
shader = shader.replace(/void\s+?main\s*\(/g, "out vec4 glFragColor;\nvoid main(");
|
|
3439
|
+
shader = shader.replace(/\bgl_FragColor\b/g, "glFragColor");
|
|
3440
|
+
}
|
|
3442
3441
|
}
|
|
3442
|
+
} else {
|
|
3443
|
+
shader = shader.replace(/\battribute\b/g, "in");
|
|
3443
3444
|
}
|
|
3444
3445
|
return shader;
|
|
3445
3446
|
};
|
|
3447
|
+
ShaderFactory._has300Output = function _has300Output(fragmentShader) {
|
|
3448
|
+
return ShaderFactory._has300OutInFragReg.test(fragmentShader);
|
|
3449
|
+
};
|
|
3446
3450
|
ShaderFactory._replaceMRTShader = function _replaceMRTShader(shader, result) {
|
|
3447
3451
|
var declaration = "";
|
|
3448
3452
|
var mrtIndexSet = new Set();
|
|
@@ -3464,11 +3468,16 @@ var ShaderFactory = /*#__PURE__*/ function() {
|
|
|
3464
3468
|
/** @internal */ ShaderFactory._shaderExtension = [
|
|
3465
3469
|
"GL_EXT_shader_texture_lod",
|
|
3466
3470
|
"GL_OES_standard_derivatives",
|
|
3467
|
-
"GL_EXT_draw_buffers"
|
|
3471
|
+
"GL_EXT_draw_buffers",
|
|
3472
|
+
"GL_EXT_frag_depth"
|
|
3468
3473
|
].map(function(e) {
|
|
3469
3474
|
return "#extension " + e + " : enable\n";
|
|
3470
3475
|
}).join("");
|
|
3471
3476
|
})();
|
|
3477
|
+
(function() {
|
|
3478
|
+
ShaderFactory._has300OutInFragReg = /\bout\s+(?:\w+\s+)?(?:vec4)\s+(?:\w+)\s*;/ // [layout(location = 0)] out [highp] vec4 [color];
|
|
3479
|
+
;
|
|
3480
|
+
})();
|
|
3472
3481
|
|
|
3473
3482
|
/**
|
|
3474
3483
|
* Shader tag key.
|
|
@@ -3759,6 +3768,10 @@ var ShaderFactory = /*#__PURE__*/ function() {
|
|
|
3759
3768
|
this.materialUniformBlock = new ShaderUniformBlock();
|
|
3760
3769
|
this.otherUniformBlock = new ShaderUniformBlock();
|
|
3761
3770
|
/** @internal */ this._uploadRenderCount = -1;
|
|
3771
|
+
/** @internal */ this._uploadSceneId = -1;
|
|
3772
|
+
/** @internal */ this._uploadCameraId = -1;
|
|
3773
|
+
/** @internal */ this._uploadRendererId = -1;
|
|
3774
|
+
/** @internal */ this._uploadMaterialId = -1;
|
|
3762
3775
|
this.attributeLocation = Object.create(null);
|
|
3763
3776
|
this._activeTextureUint = 0;
|
|
3764
3777
|
this._engine = engine;
|
|
@@ -11440,10 +11453,8 @@ var Basic2DBatcher = /*#__PURE__*/ function() {
|
|
|
11440
11453
|
var vertexStride = this.createVertexElements(vertexElements);
|
|
11441
11454
|
// vertices
|
|
11442
11455
|
var vertexBuffer = this._vertexBuffers[index] = new Buffer(engine, BufferBindFlag.VertexBuffer, MAX_VERTEX_COUNT * vertexStride, BufferUsage.Dynamic);
|
|
11443
|
-
vertexBuffer.isGCIgnored = true;
|
|
11444
11456
|
// indices
|
|
11445
11457
|
var indiceBuffer = this._indiceBuffers[index] = new Buffer(engine, BufferBindFlag.IndexBuffer, MAX_VERTEX_COUNT * 6, BufferUsage.Dynamic);
|
|
11446
|
-
indiceBuffer.isGCIgnored = true;
|
|
11447
11458
|
mesh.setVertexBufferBinding(vertexBuffer, vertexStride);
|
|
11448
11459
|
mesh.setIndexBufferBinding(indiceBuffer, IndexFormat.UInt16);
|
|
11449
11460
|
mesh.setVertexElements(vertexElements);
|
|
@@ -15089,6 +15100,7 @@ var BaseMaterial = /*#__PURE__*/ function(Material1) {
|
|
|
15089
15100
|
1
|
|
15090
15101
|
]); // left-top
|
|
15091
15102
|
var blitMaterial = new Material(engine, Shader.find("blit"));
|
|
15103
|
+
blitMaterial._addReferCount(1);
|
|
15092
15104
|
blitMaterial.renderState.depthState.enabled = false;
|
|
15093
15105
|
blitMaterial.renderState.depthState.writeEnabled = false;
|
|
15094
15106
|
this.blitMesh = this._createBlitMesh(engine, vertices);
|
|
@@ -15788,6 +15800,9 @@ var ComponentCloner = /*#__PURE__*/ function() {
|
|
|
15788
15800
|
projectionParams.set(flipProjection ? -1 : 1, virtualCamera.nearClipPlane, virtualCamera.farClipPlane, 0);
|
|
15789
15801
|
shaderData.setVector4(RenderContext._cameraProjectionProperty, projectionParams);
|
|
15790
15802
|
};
|
|
15803
|
+
_proto.garbageCollection = function garbageCollection() {
|
|
15804
|
+
this.camera = null;
|
|
15805
|
+
};
|
|
15791
15806
|
return RenderContext;
|
|
15792
15807
|
}();
|
|
15793
15808
|
(function() {
|
|
@@ -19446,7 +19461,8 @@ __decorate([
|
|
|
19446
19461
|
/** @internal */ this._upList = new DisorderedArray();
|
|
19447
19462
|
/** @internal */ this._downList = new DisorderedArray();
|
|
19448
19463
|
this._nativeEvents = [];
|
|
19449
|
-
|
|
19464
|
+
// Temporary solution for mini program, window does not exist
|
|
19465
|
+
if (typeof Window !== "undefined" && _instanceof(target, Window)) {
|
|
19450
19466
|
throw "Do not set window as target because window cannot listen to pointer leave event.";
|
|
19451
19467
|
}
|
|
19452
19468
|
this._engine = engine;
|
|
@@ -19920,66 +19936,85 @@ __decorate([
|
|
|
19920
19936
|
|
|
19921
19937
|
/**
|
|
19922
19938
|
* @internal
|
|
19923
|
-
*/ var ParticleBufferUtils =
|
|
19924
|
-
|
|
19925
|
-
|
|
19926
|
-
|
|
19927
|
-
|
|
19928
|
-
|
|
19929
|
-
|
|
19930
|
-
|
|
19931
|
-
|
|
19932
|
-
|
|
19933
|
-
|
|
19934
|
-
|
|
19935
|
-
|
|
19936
|
-
|
|
19937
|
-
|
|
19938
|
-
|
|
19939
|
-
|
|
19940
|
-
|
|
19941
|
-
|
|
19942
|
-
|
|
19943
|
-
|
|
19944
|
-
|
|
19945
|
-
|
|
19946
|
-
|
|
19947
|
-
|
|
19948
|
-
|
|
19949
|
-
|
|
19950
|
-
|
|
19951
|
-
|
|
19952
|
-
|
|
19953
|
-
|
|
19954
|
-
|
|
19955
|
-
|
|
19956
|
-
|
|
19957
|
-
|
|
19958
|
-
|
|
19959
|
-
|
|
19960
|
-
|
|
19961
|
-
|
|
19962
|
-
|
|
19963
|
-
|
|
19964
|
-
|
|
19965
|
-
|
|
19966
|
-
|
|
19967
|
-
|
|
19968
|
-
|
|
19969
|
-
|
|
19970
|
-
|
|
19971
|
-
|
|
19972
|
-
|
|
19973
|
-
|
|
19974
|
-
|
|
19975
|
-
|
|
19976
|
-
|
|
19977
|
-
|
|
19978
|
-
|
|
19979
|
-
|
|
19980
|
-
|
|
19981
|
-
|
|
19982
|
-
|
|
19939
|
+
*/ var ParticleBufferUtils = function ParticleBufferUtils(engine) {
|
|
19940
|
+
this.billboardVertexElement = new VertexElement(ParticleBillboardVertexAttribute.cornerTextureCoordinate, 0, VertexElementFormat.Vector4, 0);
|
|
19941
|
+
this.instanceVertexElements = [
|
|
19942
|
+
new VertexElement(ParticleInstanceVertexAttribute.ShapePositionStartLifeTime, 0, VertexElementFormat.Vector4, 1, 1),
|
|
19943
|
+
new VertexElement(ParticleInstanceVertexAttribute.DirectionTime, 16, VertexElementFormat.Vector4, 1, 1),
|
|
19944
|
+
new VertexElement(ParticleInstanceVertexAttribute.StartColor, 32, VertexElementFormat.Vector4, 1, 1),
|
|
19945
|
+
new VertexElement(ParticleInstanceVertexAttribute.StartSize, 48, VertexElementFormat.Vector3, 1, 1),
|
|
19946
|
+
new VertexElement(ParticleInstanceVertexAttribute.StartRotation0, 60, VertexElementFormat.Vector3, 1, 1),
|
|
19947
|
+
new VertexElement(ParticleInstanceVertexAttribute.StartSpeed, 72, VertexElementFormat.Float, 1, 1),
|
|
19948
|
+
new VertexElement(ParticleInstanceVertexAttribute.Random0, 76, VertexElementFormat.Vector4, 1, 1),
|
|
19949
|
+
new VertexElement(ParticleInstanceVertexAttribute.Random1, 92, VertexElementFormat.Vector4, 1, 1),
|
|
19950
|
+
new VertexElement(ParticleInstanceVertexAttribute.SimulationWorldPosition, 108, VertexElementFormat.Vector3, 1, 1),
|
|
19951
|
+
new VertexElement(ParticleInstanceVertexAttribute.SimulationWorldRotation, 120, VertexElementFormat.Vector4, 1, 1),
|
|
19952
|
+
new VertexElement(ParticleInstanceVertexAttribute.SimulationUV, 136, VertexElementFormat.Vector4, 1, 1)
|
|
19953
|
+
];
|
|
19954
|
+
this.instanceVertexStride = 152;
|
|
19955
|
+
this.instanceVertexFloatStride = this.instanceVertexStride / 4;
|
|
19956
|
+
this.startLifeTimeOffset = 3;
|
|
19957
|
+
this.timeOffset = 7;
|
|
19958
|
+
this.simulationUVOffset = 34;
|
|
19959
|
+
this.billboardIndexCount = 6;
|
|
19960
|
+
var stride = 16;
|
|
19961
|
+
var billboardGeometryBuffer = new Buffer(engine, BufferBindFlag.VertexBuffer, stride * 4, BufferUsage.Static, false);
|
|
19962
|
+
billboardGeometryBuffer.isGCIgnored = true;
|
|
19963
|
+
this.billboardVertexBufferBinding = new VertexBufferBinding(billboardGeometryBuffer, stride);
|
|
19964
|
+
var indexBuffer = new Buffer(engine, BufferBindFlag.IndexBuffer, this.billboardIndexCount, BufferUsage.Static, false);
|
|
19965
|
+
indexBuffer.isGCIgnored = true;
|
|
19966
|
+
this.billboardIndexBufferBinding = new IndexBufferBinding(indexBuffer, IndexFormat.UInt8);
|
|
19967
|
+
var billboardGeometryData = new Float32Array([
|
|
19968
|
+
-0.5,
|
|
19969
|
+
-0.5,
|
|
19970
|
+
0,
|
|
19971
|
+
1,
|
|
19972
|
+
0.5,
|
|
19973
|
+
-0.5,
|
|
19974
|
+
1,
|
|
19975
|
+
1,
|
|
19976
|
+
0.5,
|
|
19977
|
+
0.5,
|
|
19978
|
+
1,
|
|
19979
|
+
0,
|
|
19980
|
+
-0.5,
|
|
19981
|
+
0.5,
|
|
19982
|
+
0,
|
|
19983
|
+
0
|
|
19984
|
+
]);
|
|
19985
|
+
var indexData = new Uint8Array([
|
|
19986
|
+
0,
|
|
19987
|
+
2,
|
|
19988
|
+
3,
|
|
19989
|
+
0,
|
|
19990
|
+
1,
|
|
19991
|
+
2
|
|
19992
|
+
]);
|
|
19993
|
+
billboardGeometryBuffer.setData(billboardGeometryData);
|
|
19994
|
+
indexBuffer.setData(indexData);
|
|
19995
|
+
// Register content restorer
|
|
19996
|
+
engine.resourceManager.addContentRestorer(new /*#__PURE__*/ (function(ContentRestorer) {
|
|
19997
|
+
_inherits(_class, ContentRestorer);
|
|
19998
|
+
function _class() {
|
|
19999
|
+
return ContentRestorer.call(this, billboardGeometryBuffer);
|
|
20000
|
+
}
|
|
20001
|
+
var _proto = _class.prototype;
|
|
20002
|
+
_proto.restoreContent = function restoreContent() {
|
|
20003
|
+
billboardGeometryBuffer.setData(billboardGeometryData);
|
|
20004
|
+
};
|
|
20005
|
+
return _class;
|
|
20006
|
+
}(ContentRestorer))());
|
|
20007
|
+
engine.resourceManager.addContentRestorer(new /*#__PURE__*/ (function(ContentRestorer) {
|
|
20008
|
+
_inherits(_class, ContentRestorer);
|
|
20009
|
+
function _class() {
|
|
20010
|
+
return ContentRestorer.call(this, indexBuffer);
|
|
20011
|
+
}
|
|
20012
|
+
var _proto = _class.prototype;
|
|
20013
|
+
_proto.restoreContent = function restoreContent() {
|
|
20014
|
+
};
|
|
20015
|
+
return _class;
|
|
20016
|
+
}(ContentRestorer))());
|
|
20017
|
+
};
|
|
19983
20018
|
|
|
19984
20019
|
var blitFs = "#define GLSLIFY 1\nuniform mediump sampler2D renderer_BlitTexture;\n#ifdef HAS_TEX_LOD\nuniform float renderer_BlitMipLevel;\n#endif\nvarying vec2 v_uv;void main(){\n#ifdef HAS_TEX_LOD\ngl_FragColor=texture2DLodEXT(renderer_BlitTexture,v_uv,renderer_BlitMipLevel);\n#else\ngl_FragColor=texture2D(renderer_BlitTexture,v_uv);\n#endif\n}"; // eslint-disable-line
|
|
19985
20020
|
|
|
@@ -20681,7 +20716,6 @@ ShaderPool.init();
|
|
|
20681
20716
|
resourceManager._restoreGraphicResources();
|
|
20682
20717
|
console.log("Graphic resource restored.");
|
|
20683
20718
|
// Restore resources content
|
|
20684
|
-
this._particleBufferUtils.setBufferData();
|
|
20685
20719
|
resourceManager._restoreResourcesContent().then(function() {
|
|
20686
20720
|
console.log("Graphic resource content restored.\n\n" + "Device restored.");
|
|
20687
20721
|
_this.dispatch("devicerestored", _this);
|
|
@@ -20696,6 +20730,7 @@ ShaderPool.init();
|
|
|
20696
20730
|
this._spriteRenderDataPool.garbageCollection();
|
|
20697
20731
|
this._spriteMaskRenderDataPool.garbageCollection();
|
|
20698
20732
|
this._textRenderDataPool.garbageCollection();
|
|
20733
|
+
this._renderContext.garbageCollection();
|
|
20699
20734
|
};
|
|
20700
20735
|
_create_class(Engine, [
|
|
20701
20736
|
{
|
|
@@ -21053,7 +21088,6 @@ ShaderPool.init();
|
|
|
21053
21088
|
};
|
|
21054
21089
|
_proto._createPlane = function _createPlane(engine) {
|
|
21055
21090
|
var mesh = new ModelMesh(engine);
|
|
21056
|
-
mesh.isGCIgnored = true;
|
|
21057
21091
|
var indices = new Uint8Array([
|
|
21058
21092
|
1,
|
|
21059
21093
|
2,
|
|
@@ -23038,22 +23072,6 @@ __decorate([
|
|
|
23038
23072
|
maskManager.postRender(renderer);
|
|
23039
23073
|
}
|
|
23040
23074
|
};
|
|
23041
|
-
_proto.destroy = function destroy() {
|
|
23042
|
-
this._batchedQueue = null;
|
|
23043
|
-
var _this = this, meshes = _this._meshes, vertexBuffers = _this._vertexBuffers, indiceBuffers = _this._indiceBuffers;
|
|
23044
|
-
for(var i = 0, n = meshes.length; i < n; ++i){
|
|
23045
|
-
meshes[i].destroy();
|
|
23046
|
-
}
|
|
23047
|
-
this._meshes = null;
|
|
23048
|
-
for(var i1 = 0, n1 = vertexBuffers.length; i1 < n1; ++i1){
|
|
23049
|
-
vertexBuffers[i1].destroy();
|
|
23050
|
-
}
|
|
23051
|
-
this._vertexBuffers = null;
|
|
23052
|
-
for(var i2 = 0, n2 = indiceBuffers.length; i2 < n2; ++i2){
|
|
23053
|
-
indiceBuffers[i2].destroy();
|
|
23054
|
-
}
|
|
23055
|
-
this._indiceBuffers = null;
|
|
23056
|
-
};
|
|
23057
23075
|
return SpriteBatcher;
|
|
23058
23076
|
}(Basic2DBatcher);
|
|
23059
23077
|
(function() {
|
|
@@ -23079,11 +23097,10 @@ __decorate([
|
|
|
23079
23097
|
if (elements.length === 0) {
|
|
23080
23098
|
return;
|
|
23081
23099
|
}
|
|
23082
|
-
var engine = camera.engine,
|
|
23100
|
+
var engine = camera.engine, cameraId = camera.instanceId, cameraData = camera.shaderData;
|
|
23101
|
+
var _camera_scene = camera.scene, sceneData = _camera_scene.shaderData, sceneId = _camera_scene.instanceId;
|
|
23083
23102
|
var renderCount = engine._renderCount;
|
|
23084
23103
|
var rhi = engine._hardwareRenderer;
|
|
23085
|
-
var sceneData = scene.shaderData;
|
|
23086
|
-
var cameraData = camera.shaderData;
|
|
23087
23104
|
var pipelineStageKey = RenderContext.pipelineStageKey;
|
|
23088
23105
|
var renderQueueType = this._renderQueueType;
|
|
23089
23106
|
for(var i = 0, n = elements.length; i < n; i++){
|
|
@@ -23095,9 +23112,8 @@ __decorate([
|
|
|
23095
23112
|
var primitive = data.primitive;
|
|
23096
23113
|
var renderer = data.component;
|
|
23097
23114
|
var material = data.material;
|
|
23098
|
-
var rendererData = renderer.shaderData;
|
|
23099
|
-
var materialData = material.shaderData;
|
|
23100
|
-
var renderStates = material.renderStates;
|
|
23115
|
+
var rendererData = renderer.shaderData, rendererId = renderer.instanceId;
|
|
23116
|
+
var materialData = material.shaderData, materialId = material.instanceId, renderStates = material.renderStates;
|
|
23101
23117
|
// union render global macro and material self macro.
|
|
23102
23118
|
ShaderMacroCollection.unionCollection(renderer._globalShaderMacro, materialData._macroCollection, compileMacros);
|
|
23103
23119
|
for(var j = 0, m = shaderPasses.length; j < m; j++){
|
|
@@ -23123,33 +23139,33 @@ __decorate([
|
|
|
23123
23139
|
program.uploadAll(program.materialUniformBlock, materialData);
|
|
23124
23140
|
// UnGroup textures should upload default value, texture uint maybe change by logic of texture bind.
|
|
23125
23141
|
program.uploadUnGroupTextures();
|
|
23126
|
-
program.
|
|
23127
|
-
program.
|
|
23128
|
-
program.
|
|
23129
|
-
program.
|
|
23142
|
+
program._uploadSceneId = sceneId;
|
|
23143
|
+
program._uploadCameraId = cameraId;
|
|
23144
|
+
program._uploadRendererId = rendererId;
|
|
23145
|
+
program._uploadMaterialId = materialId;
|
|
23130
23146
|
program._uploadRenderCount = renderCount;
|
|
23131
23147
|
} else {
|
|
23132
|
-
if (program.
|
|
23148
|
+
if (program._uploadSceneId !== sceneId) {
|
|
23133
23149
|
program.uploadAll(program.sceneUniformBlock, sceneData);
|
|
23134
|
-
program.
|
|
23150
|
+
program._uploadSceneId = sceneId;
|
|
23135
23151
|
} else if (switchProgram) {
|
|
23136
23152
|
program.uploadTextures(program.sceneUniformBlock, sceneData);
|
|
23137
23153
|
}
|
|
23138
|
-
if (program.
|
|
23154
|
+
if (program._uploadCameraId !== cameraId) {
|
|
23139
23155
|
program.uploadAll(program.cameraUniformBlock, cameraData);
|
|
23140
|
-
program.
|
|
23156
|
+
program._uploadCameraId = cameraId;
|
|
23141
23157
|
} else if (switchProgram) {
|
|
23142
23158
|
program.uploadTextures(program.cameraUniformBlock, cameraData);
|
|
23143
23159
|
}
|
|
23144
|
-
if (program.
|
|
23160
|
+
if (program._uploadRendererId !== rendererId) {
|
|
23145
23161
|
program.uploadAll(program.rendererUniformBlock, rendererData);
|
|
23146
|
-
program.
|
|
23162
|
+
program._uploadRendererId = rendererId;
|
|
23147
23163
|
} else if (switchProgram) {
|
|
23148
23164
|
program.uploadTextures(program.rendererUniformBlock, rendererData);
|
|
23149
23165
|
}
|
|
23150
|
-
if (program.
|
|
23166
|
+
if (program._uploadMaterialId !== materialId) {
|
|
23151
23167
|
program.uploadAll(program.materialUniformBlock, materialData);
|
|
23152
|
-
program.
|
|
23168
|
+
program._uploadMaterialId = materialId;
|
|
23153
23169
|
} else if (switchProgram) {
|
|
23154
23170
|
program.uploadTextures(program.materialUniformBlock, materialData);
|
|
23155
23171
|
}
|