@galacean/engine-core 2.0.0-alpha.52 → 2.0.0-alpha.53
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 +373 -352
- package/dist/main.js.map +1 -1
- package/dist/module.js +373 -353
- package/dist/module.js.map +1 -1
- package/package.json +3 -5
- package/types/physics/Collider.d.ts +1 -3
- package/types/physics/DynamicCollider.d.ts +1 -2
- package/types/physics/PhysicsScene.d.ts +43 -1
- package/types/physics/shape/ColliderShape.d.ts +5 -2
- package/types/shader/Shader.d.ts +11 -2
- package/types/shader/ShaderFactory.d.ts +9 -0
- package/types/shader/ShaderMacroProcessor.d.ts +10 -28
- package/types/shader/ShaderPass.d.ts +0 -2
- package/types/shader/enums/ShaderPreprocessorDirective.d.ts +7 -1
- package/types/shader/index.d.ts +1 -0
- package/types/physics/enums/ColliderShapeChangeFlag.d.ts +0 -8
package/dist/module.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Vector4, MathUtil, Vector2, Matrix, BoundingBox, Rect, Quaternion, Vector3, Matrix3x3, Color, BoundingFrustum, BoundingSphere, Plane, Ray, SphericalHarmonics3, FrustumFace, CollisionUtil, Rand } from '@galacean/engine-math';
|
|
2
|
+
import { normalizeShaderIncludeKey, expandShaderMacros, evaluatePreprocessorExpression, resolvePreprocessorDefinedOperators, expandPreprocessorExpressionMacros, parsePreprocessorExpression } from '@galacean/engine-design';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* The platform (including operating system and hardware) is running on.
|
|
@@ -4396,6 +4397,26 @@ var RenderStateElementKey = /*#__PURE__*/ function(RenderStateElementKey) {
|
|
|
4396
4397
|
return ShaderLanguage;
|
|
4397
4398
|
}({});
|
|
4398
4399
|
|
|
4400
|
+
/**
|
|
4401
|
+
* Directive types for shader preprocessor instructions.
|
|
4402
|
+
*/ var ShaderPreprocessorDirective = /*#__PURE__*/ function(ShaderPreprocessorDirective) {
|
|
4403
|
+
ShaderPreprocessorDirective[ShaderPreprocessorDirective["Text"] = 0] = "Text";
|
|
4404
|
+
ShaderPreprocessorDirective[ShaderPreprocessorDirective["IfDef"] = 1] = "IfDef";
|
|
4405
|
+
ShaderPreprocessorDirective[ShaderPreprocessorDirective["IfNdef"] = 2] = "IfNdef";
|
|
4406
|
+
ShaderPreprocessorDirective[ShaderPreprocessorDirective["IfCmp"] = 3] = "IfCmp";
|
|
4407
|
+
ShaderPreprocessorDirective[ShaderPreprocessorDirective["IfExpr"] = 4] = "IfExpr";
|
|
4408
|
+
ShaderPreprocessorDirective[ShaderPreprocessorDirective["Else"] = 5] = "Else";
|
|
4409
|
+
ShaderPreprocessorDirective[ShaderPreprocessorDirective["Endif"] = 6] = "Endif";
|
|
4410
|
+
ShaderPreprocessorDirective[ShaderPreprocessorDirective["Define"] = 7] = "Define";
|
|
4411
|
+
ShaderPreprocessorDirective[ShaderPreprocessorDirective["DefineVal"] = 8] = "DefineVal";
|
|
4412
|
+
ShaderPreprocessorDirective[ShaderPreprocessorDirective["DefineFunc"] = 9] = "DefineFunc";
|
|
4413
|
+
ShaderPreprocessorDirective[ShaderPreprocessorDirective["Undef"] = 10] = "Undef";
|
|
4414
|
+
/** Activates a declaration: [ownerId, groupId, sourceScope]. */ ShaderPreprocessorDirective[ShaderPreprocessorDirective["Declaration"] = 11] = "Declaration";
|
|
4415
|
+
/** Text retained when any listed declaration is selected and reachable: [text, ...ownerIds]. */ ShaderPreprocessorDirective[ShaderPreprocessorDirective["OwnedText"] = 12] = "OwnedText";
|
|
4416
|
+
/** Declaration dependency: [fromOwnerId, toOwnerId]; owner zero denotes a stage root. */ ShaderPreprocessorDirective[ShaderPreprocessorDirective["Reference"] = 13] = "Reference";
|
|
4417
|
+
return ShaderPreprocessorDirective;
|
|
4418
|
+
}({});
|
|
4419
|
+
|
|
4399
4420
|
/**
|
|
4400
4421
|
* Shader Property type.
|
|
4401
4422
|
*/ var ShaderPropertyType = /*#__PURE__*/ function(ShaderPropertyType) {
|
|
@@ -6897,17 +6918,33 @@ ShaderBlockProperty._nameMap = Object.create(null);
|
|
|
6897
6918
|
* Register a chunk source so `#include` resolves it.
|
|
6898
6919
|
* @param includeName - The path key referenced in `#include "..."`.
|
|
6899
6920
|
* @param includeSource - GLSL chunk source text.
|
|
6921
|
+
* @throws Error when the key is empty, malformed, or already registered after normalization.
|
|
6900
6922
|
*/ ShaderFactory.registerInclude = function registerInclude(includeName, includeSource) {
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6923
|
+
var key = normalizeShaderIncludeKey(includeName);
|
|
6924
|
+
if (Object.prototype.hasOwnProperty.call(ShaderFactory.includeMap, key)) {
|
|
6925
|
+
throw new Error('The shader include "' + key + '" is already registered.');
|
|
6926
|
+
}
|
|
6927
|
+
Object.defineProperty(ShaderFactory.includeMap, key, {
|
|
6928
|
+
value: includeSource,
|
|
6929
|
+
writable: true,
|
|
6930
|
+
enumerable: true,
|
|
6931
|
+
configurable: true
|
|
6932
|
+
});
|
|
6933
|
+
};
|
|
6934
|
+
/**
|
|
6935
|
+
* Remove a registered shader chunk.
|
|
6936
|
+
* @param includeName - The path key passed to `registerInclude`.
|
|
6937
|
+
* @throws Error when the key is empty or malformed.
|
|
6938
|
+
*/ ShaderFactory.unregisterInclude = function unregisterInclude(includeName) {
|
|
6939
|
+
delete ShaderFactory.includeMap[normalizeShaderIncludeKey(includeName)];
|
|
6905
6940
|
};
|
|
6906
6941
|
/**
|
|
6907
6942
|
* Remove a registered shader chunk.
|
|
6908
6943
|
* @param includeName - The path key passed to `registerInclude`.
|
|
6944
|
+
* @deprecated Use `unregisterInclude`.
|
|
6945
|
+
* @throws Error when the key is empty or malformed.
|
|
6909
6946
|
*/ ShaderFactory.unRegisterInclude = function unRegisterInclude(includeName) {
|
|
6910
|
-
|
|
6947
|
+
ShaderFactory.unregisterInclude(includeName);
|
|
6911
6948
|
};
|
|
6912
6949
|
/**
|
|
6913
6950
|
* Convert lower GLSL version to GLSL 300 es.
|
|
@@ -7096,7 +7133,7 @@ ShaderBlockProperty._nameMap = Object.create(null);
|
|
|
7096
7133
|
ShaderFactory.RENDERER_INSTANCE_BLOCK_NAME = "RendererInstanceData";
|
|
7097
7134
|
var _obj;
|
|
7098
7135
|
ShaderFactory.uniformBlockBindingMap = (_obj = {}, _obj[ShaderBlockProperty.getByName(ShaderFactory.RENDERER_INSTANCE_BLOCK_NAME)._uniqueId] = ConstantBufferBindingPoint.RendererInstance, _obj);
|
|
7099
|
-
ShaderFactory.includeMap =
|
|
7136
|
+
ShaderFactory.includeMap = Object.create(null);
|
|
7100
7137
|
ShaderFactory.shaderExtension = [
|
|
7101
7138
|
"GL_EXT_shader_texture_lod",
|
|
7102
7139
|
"GL_OES_standard_derivatives",
|
|
@@ -8016,23 +8053,6 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
|
|
|
8016
8053
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
8017
8054
|
}
|
|
8018
8055
|
|
|
8019
|
-
/**
|
|
8020
|
-
* Directive types for shader preprocessor instructions.
|
|
8021
|
-
*/ var ShaderPreprocessorDirective = /*#__PURE__*/ function(ShaderPreprocessorDirective) {
|
|
8022
|
-
ShaderPreprocessorDirective[ShaderPreprocessorDirective["Text"] = 0] = "Text";
|
|
8023
|
-
ShaderPreprocessorDirective[ShaderPreprocessorDirective["IfDef"] = 1] = "IfDef";
|
|
8024
|
-
ShaderPreprocessorDirective[ShaderPreprocessorDirective["IfNdef"] = 2] = "IfNdef";
|
|
8025
|
-
ShaderPreprocessorDirective[ShaderPreprocessorDirective["IfCmp"] = 3] = "IfCmp";
|
|
8026
|
-
ShaderPreprocessorDirective[ShaderPreprocessorDirective["IfExpr"] = 4] = "IfExpr";
|
|
8027
|
-
ShaderPreprocessorDirective[ShaderPreprocessorDirective["Else"] = 5] = "Else";
|
|
8028
|
-
ShaderPreprocessorDirective[ShaderPreprocessorDirective["Endif"] = 6] = "Endif";
|
|
8029
|
-
ShaderPreprocessorDirective[ShaderPreprocessorDirective["Define"] = 7] = "Define";
|
|
8030
|
-
ShaderPreprocessorDirective[ShaderPreprocessorDirective["DefineVal"] = 8] = "DefineVal";
|
|
8031
|
-
ShaderPreprocessorDirective[ShaderPreprocessorDirective["DefineFunc"] = 9] = "DefineFunc";
|
|
8032
|
-
ShaderPreprocessorDirective[ShaderPreprocessorDirective["Undef"] = 10] = "Undef";
|
|
8033
|
-
return ShaderPreprocessorDirective;
|
|
8034
|
-
}({});
|
|
8035
|
-
|
|
8036
8056
|
/**
|
|
8037
8057
|
* @internal
|
|
8038
8058
|
*/ var ShaderMacroProcessor = /*#__PURE__*/ function() {
|
|
@@ -8041,6 +8061,7 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
|
|
|
8041
8061
|
* Evaluate a flat instruction array with active macros.
|
|
8042
8062
|
* Macros are expanded immediately when text chunks are collected,
|
|
8043
8063
|
* using the current macro state at that point (conforming to GLSL/C99 §6.10 standard).
|
|
8064
|
+
* Declaration ownership filters buffered text after execution; it never skips macro directives.
|
|
8044
8065
|
* @param instructions - Pre-parsed instruction array
|
|
8045
8066
|
* @param macros - Active runtime macros
|
|
8046
8067
|
* @returns Pure GLSL string with all conditionals resolved and macros expanded
|
|
@@ -8048,9 +8069,21 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
|
|
|
8048
8069
|
var valueMacros = ShaderMacroProcessor._valueMacros;
|
|
8049
8070
|
var funcMacros = ShaderMacroProcessor._funcMacros;
|
|
8050
8071
|
var shaderChunks = ShaderMacroProcessor._shaderChunks;
|
|
8072
|
+
var declarationGroups = ShaderMacroProcessor._declarationGroups;
|
|
8073
|
+
var activeDeclarations = ShaderMacroProcessor._activeDeclarations;
|
|
8074
|
+
var ownedChunks = ShaderMacroProcessor._ownedChunks;
|
|
8075
|
+
var references = ShaderMacroProcessor._references;
|
|
8076
|
+
var reachableDeclarations = ShaderMacroProcessor._reachableDeclarations;
|
|
8077
|
+
var pendingDeclarations = ShaderMacroProcessor._pendingDeclarations;
|
|
8051
8078
|
valueMacros.clear();
|
|
8052
8079
|
funcMacros.clear();
|
|
8053
8080
|
shaderChunks.length = 0;
|
|
8081
|
+
declarationGroups.clear();
|
|
8082
|
+
activeDeclarations.clear();
|
|
8083
|
+
ownedChunks.clear();
|
|
8084
|
+
references.clear();
|
|
8085
|
+
reachableDeclarations.clear();
|
|
8086
|
+
pendingDeclarations.length = 0;
|
|
8054
8087
|
for(var _iterator = _create_for_of_iterator_helper_loose(macros), _step; !(_step = _iterator()).done;){
|
|
8055
8088
|
var _step_value = _step.value, name = _step_value[0], value = _step_value[1];
|
|
8056
8089
|
valueMacros.set(name, value);
|
|
@@ -8066,6 +8099,52 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
|
|
|
8066
8099
|
shaderChunks.push(ShaderMacroProcessor._expandChunk(instruction[1], valueMacros, funcMacros));
|
|
8067
8100
|
index++;
|
|
8068
8101
|
break;
|
|
8102
|
+
case ShaderPreprocessorDirective.Declaration:
|
|
8103
|
+
{
|
|
8104
|
+
var ownerId = instruction[1];
|
|
8105
|
+
var groupId = instruction[2];
|
|
8106
|
+
var sourceScope = instruction[3];
|
|
8107
|
+
var group = declarationGroups.get(groupId);
|
|
8108
|
+
if (!group) {
|
|
8109
|
+
group = {
|
|
8110
|
+
sourceScope: sourceScope
|
|
8111
|
+
};
|
|
8112
|
+
declarationGroups.set(groupId, group);
|
|
8113
|
+
} else if (sourceScope > group.sourceScope) {
|
|
8114
|
+
group.sourceScope = sourceScope;
|
|
8115
|
+
}
|
|
8116
|
+
activeDeclarations.set(ownerId, {
|
|
8117
|
+
group: group,
|
|
8118
|
+
sourceScope: sourceScope
|
|
8119
|
+
});
|
|
8120
|
+
index++;
|
|
8121
|
+
break;
|
|
8122
|
+
}
|
|
8123
|
+
case ShaderPreprocessorDirective.OwnedText:
|
|
8124
|
+
{
|
|
8125
|
+
var chunk = {
|
|
8126
|
+
instruction: instruction
|
|
8127
|
+
};
|
|
8128
|
+
ownedChunks.set(shaderChunks.length, chunk);
|
|
8129
|
+
try {
|
|
8130
|
+
shaderChunks.push(ShaderMacroProcessor._expandChunk(instruction[1], valueMacros, funcMacros));
|
|
8131
|
+
} catch (error) {
|
|
8132
|
+
// Ownership may be activated later; discarded bodies must not surface their expansion errors
|
|
8133
|
+
chunk.error = error;
|
|
8134
|
+
shaderChunks.push("");
|
|
8135
|
+
}
|
|
8136
|
+
index++;
|
|
8137
|
+
break;
|
|
8138
|
+
}
|
|
8139
|
+
case ShaderPreprocessorDirective.Reference:
|
|
8140
|
+
{
|
|
8141
|
+
var from = instruction[1];
|
|
8142
|
+
var dependencies = references.get(from);
|
|
8143
|
+
if (!dependencies) references.set(from, dependencies = []);
|
|
8144
|
+
dependencies.push(instruction[2]);
|
|
8145
|
+
index++;
|
|
8146
|
+
break;
|
|
8147
|
+
}
|
|
8069
8148
|
case ShaderPreprocessorDirective.IfDef:
|
|
8070
8149
|
{
|
|
8071
8150
|
var name1 = instruction[1];
|
|
@@ -8097,6 +8176,7 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
|
|
|
8097
8176
|
break;
|
|
8098
8177
|
case ShaderPreprocessorDirective.Define:
|
|
8099
8178
|
valueMacros.set(instruction[1], "");
|
|
8179
|
+
ShaderMacroProcessor._macroFirstCharsDirty = true;
|
|
8100
8180
|
index++;
|
|
8101
8181
|
break;
|
|
8102
8182
|
case ShaderPreprocessorDirective.DefineVal:
|
|
@@ -8115,6 +8195,7 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
|
|
|
8115
8195
|
case ShaderPreprocessorDirective.Undef:
|
|
8116
8196
|
valueMacros.delete(instruction[1]);
|
|
8117
8197
|
funcMacros.delete(instruction[1]);
|
|
8198
|
+
ShaderMacroProcessor._macroFirstCharsDirty = true;
|
|
8118
8199
|
index++;
|
|
8119
8200
|
break;
|
|
8120
8201
|
default:
|
|
@@ -8122,256 +8203,139 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
|
|
|
8122
8203
|
break;
|
|
8123
8204
|
}
|
|
8124
8205
|
}
|
|
8206
|
+
if (ownedChunks.size) {
|
|
8207
|
+
var hasReferences = references.size > 0;
|
|
8208
|
+
if (hasReferences) {
|
|
8209
|
+
// Traverse only selected declarations, so discarded callers cannot retain their dependencies.
|
|
8210
|
+
// Each reached owner is queued once, bounding cycles and diamonds by the encoded graph size.
|
|
8211
|
+
pendingDeclarations.push(0);
|
|
8212
|
+
while(pendingDeclarations.length){
|
|
8213
|
+
var dependencies1 = references.get(pendingDeclarations.pop());
|
|
8214
|
+
if (!dependencies1) continue;
|
|
8215
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(dependencies1), _step1; !(_step1 = _iterator1()).done;){
|
|
8216
|
+
var ownerId1 = _step1.value;
|
|
8217
|
+
if (reachableDeclarations.has(ownerId1)) continue;
|
|
8218
|
+
var active = activeDeclarations.get(ownerId1);
|
|
8219
|
+
if (!active || active.sourceScope !== active.group.sourceScope) continue;
|
|
8220
|
+
reachableDeclarations.add(ownerId1);
|
|
8221
|
+
pendingDeclarations.push(ownerId1);
|
|
8222
|
+
}
|
|
8223
|
+
}
|
|
8224
|
+
}
|
|
8225
|
+
var count = 0;
|
|
8226
|
+
for(var i = 0; i < shaderChunks.length; i++){
|
|
8227
|
+
var owned = ownedChunks.get(i);
|
|
8228
|
+
if (owned) {
|
|
8229
|
+
var instruction1 = owned.instruction;
|
|
8230
|
+
var selected = false;
|
|
8231
|
+
for(var j = 2; j < instruction1.length; j++){
|
|
8232
|
+
var ownerId2 = instruction1[j];
|
|
8233
|
+
var active1 = activeDeclarations.get(ownerId2);
|
|
8234
|
+
if (active1 && active1.sourceScope === active1.group.sourceScope && (!hasReferences || reachableDeclarations.has(ownerId2))) {
|
|
8235
|
+
selected = true;
|
|
8236
|
+
break;
|
|
8237
|
+
}
|
|
8238
|
+
}
|
|
8239
|
+
if (!selected) continue;
|
|
8240
|
+
if ("error" in owned) throw owned.error;
|
|
8241
|
+
}
|
|
8242
|
+
shaderChunks[count++] = shaderChunks[i];
|
|
8243
|
+
}
|
|
8244
|
+
shaderChunks.length = count;
|
|
8245
|
+
}
|
|
8125
8246
|
return ShaderMacroProcessor._concatChunks(shaderChunks);
|
|
8126
8247
|
};
|
|
8127
8248
|
/**
|
|
8128
8249
|
* Expand macros in a single text chunk using the current macro state.
|
|
8129
8250
|
* Returns the chunk as-is if no expandable macros exist.
|
|
8130
8251
|
*/ ShaderMacroProcessor._expandChunk = function _expandChunk(chunk, valueMacros, funcMacros) {
|
|
8131
|
-
|
|
8132
|
-
if (funcMacros.size === 0) {
|
|
8133
|
-
var hasExpandable = false;
|
|
8134
|
-
for(var _iterator = _create_for_of_iterator_helper_loose(valueMacros), _step; !(_step = _iterator()).done;){
|
|
8135
|
-
var _step_value = _step.value, val = _step_value[1];
|
|
8136
|
-
if (val !== "") {
|
|
8137
|
-
hasExpandable = true;
|
|
8138
|
-
break;
|
|
8139
|
-
}
|
|
8140
|
-
}
|
|
8141
|
-
if (!hasExpandable) return chunk;
|
|
8142
|
-
}
|
|
8143
|
-
// Rebuild first-char filter if macros changed
|
|
8252
|
+
if (funcMacros.size === 0 && valueMacros.size === 0) return chunk;
|
|
8144
8253
|
if (ShaderMacroProcessor._macroFirstCharsDirty) {
|
|
8145
8254
|
var macroFirstChars = ShaderMacroProcessor._macroFirstChars;
|
|
8146
8255
|
macroFirstChars.clear();
|
|
8147
|
-
for(var
|
|
8148
|
-
var name =
|
|
8256
|
+
for(var _iterator = _create_for_of_iterator_helper_loose(valueMacros.keys()), _step; !(_step = _iterator()).done;){
|
|
8257
|
+
var name = _step.value;
|
|
8149
8258
|
macroFirstChars.add(name.charCodeAt(0));
|
|
8150
8259
|
}
|
|
8151
|
-
for(var
|
|
8152
|
-
var name1 =
|
|
8260
|
+
for(var _iterator1 = _create_for_of_iterator_helper_loose(funcMacros.keys()), _step1; !(_step1 = _iterator1()).done;){
|
|
8261
|
+
var name1 = _step1.value;
|
|
8153
8262
|
macroFirstChars.add(name1.charCodeAt(0));
|
|
8154
8263
|
}
|
|
8155
8264
|
ShaderMacroProcessor._macroFirstCharsDirty = false;
|
|
8156
8265
|
}
|
|
8266
|
+
// Most chunks contain no active macro names; avoid tokenizing those shader bodies.
|
|
8157
8267
|
var macroFirstChars1 = ShaderMacroProcessor._macroFirstChars;
|
|
8158
|
-
var
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
var
|
|
8165
|
-
if (
|
|
8166
|
-
|
|
8167
|
-
i++;
|
|
8168
|
-
while(i < len && ShaderMacroProcessor._isIdentifierPart(chunk.charCodeAt(i)))i++;
|
|
8169
|
-
// Fast path: first char not in any macro name
|
|
8170
|
-
if (!macroFirstChars1.has(chunk.charCodeAt(start))) {
|
|
8171
|
-
out.push(chunk.substring(start, i));
|
|
8172
|
-
continue;
|
|
8173
|
-
}
|
|
8174
|
-
var name2 = chunk.substring(start, i);
|
|
8175
|
-
// Try function macro
|
|
8176
|
-
var func = funcMacros.get(name2);
|
|
8177
|
-
if (func) {
|
|
8178
|
-
var lookAhead = i;
|
|
8179
|
-
while(lookAhead < len && (chunk.charCodeAt(lookAhead) === 32 /* space */ || chunk.charCodeAt(lookAhead) === 9))lookAhead++;
|
|
8180
|
-
if (lookAhead < len && chunk.charCodeAt(lookAhead) === 40 /* '(' */ ) {
|
|
8181
|
-
var args = ShaderMacroProcessor._parseFuncArgs(chunk, lookAhead);
|
|
8182
|
-
if (args) {
|
|
8183
|
-
i = args.end;
|
|
8184
|
-
var expanded = ShaderMacroProcessor._expandFuncBody(func, args.values);
|
|
8185
|
-
expandedNames.clear();
|
|
8186
|
-
expandedNames.add(name2);
|
|
8187
|
-
out.push(ShaderMacroProcessor._recursiveExpandMacro(expanded, valueMacros, funcMacros, expandedNames));
|
|
8188
|
-
continue;
|
|
8189
|
-
}
|
|
8190
|
-
}
|
|
8191
|
-
}
|
|
8192
|
-
// Try value macro
|
|
8193
|
-
var val1 = valueMacros.get(name2);
|
|
8194
|
-
if (val1 !== undefined && val1 !== "") {
|
|
8195
|
-
expandedNames.clear();
|
|
8196
|
-
expandedNames.add(name2);
|
|
8197
|
-
out.push(ShaderMacroProcessor._recursiveExpandMacro(val1, valueMacros, funcMacros, expandedNames));
|
|
8198
|
-
continue;
|
|
8199
|
-
}
|
|
8200
|
-
out.push(name2);
|
|
8201
|
-
continue;
|
|
8202
|
-
}
|
|
8203
|
-
// Batch collect non-identifier characters
|
|
8204
|
-
var batchStart = i;
|
|
8205
|
-
while(i < len && !ShaderMacroProcessor._isIdentifierStart(chunk.charCodeAt(i)))i++;
|
|
8206
|
-
out.push(chunk.substring(batchStart, i));
|
|
8207
|
-
}
|
|
8208
|
-
return out.join("");
|
|
8209
|
-
};
|
|
8210
|
-
/**
|
|
8211
|
-
* Recursively expand macro substitution results until no more macros remain.
|
|
8212
|
-
* @param macroExpansion - Intermediate text from a macro substitution that may contain further macro references
|
|
8213
|
-
* @param valueMacros - Current value macro definitions
|
|
8214
|
-
* @param funcMacros - Current function macro definitions
|
|
8215
|
-
* @param expandedNames - Macro names already on the expansion chain, prevents circular references (C99 §6.10.3.4)
|
|
8216
|
-
*/ ShaderMacroProcessor._recursiveExpandMacro = function _recursiveExpandMacro(macroExpansion, valueMacros, funcMacros, expandedNames) {
|
|
8217
|
-
if (macroExpansion.length === 0) return macroExpansion;
|
|
8218
|
-
var len = macroExpansion.length;
|
|
8219
|
-
var out = [];
|
|
8220
|
-
var i = 0;
|
|
8221
|
-
while(i < len){
|
|
8222
|
-
var cc = macroExpansion.charCodeAt(i);
|
|
8223
|
-
if (ShaderMacroProcessor._isIdentifierStart(cc)) {
|
|
8224
|
-
var start = i;
|
|
8225
|
-
i++;
|
|
8226
|
-
while(i < len && ShaderMacroProcessor._isIdentifierPart(macroExpansion.charCodeAt(i)))i++;
|
|
8227
|
-
var name = macroExpansion.substring(start, i);
|
|
8228
|
-
// Skip already-expanded names (circular reference prevention)
|
|
8229
|
-
// Skip GL_ prefixed names (reserved GLSL built-ins, charCodes: G=71, L=76, _=95)
|
|
8230
|
-
if (expandedNames.has(name) || name.charCodeAt(0) === 71 && name.charCodeAt(1) === 76 && name.charCodeAt(2) === 95) {
|
|
8231
|
-
out.push(name);
|
|
8232
|
-
continue;
|
|
8233
|
-
}
|
|
8268
|
+
for(var index = 0; index < chunk.length;){
|
|
8269
|
+
var char = chunk.charCodeAt(index++);
|
|
8270
|
+
if (!ShaderMacroProcessor._isIdentifierStart(char)) continue;
|
|
8271
|
+
var start = index - 1;
|
|
8272
|
+
while(index < chunk.length && ShaderMacroProcessor._isIdentifierPart(chunk.charCodeAt(index)))index++;
|
|
8273
|
+
if (!macroFirstChars1.has(char)) continue;
|
|
8274
|
+
var name2 = chunk.slice(start, index);
|
|
8275
|
+
if (!valueMacros.has(name2) && !funcMacros.has(name2)) continue;
|
|
8276
|
+
var expanded = expandShaderMacros(chunk, function(name) {
|
|
8234
8277
|
var func = funcMacros.get(name);
|
|
8235
|
-
if (func) {
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
}
|
|
8247
|
-
}
|
|
8248
|
-
}
|
|
8249
|
-
var val = valueMacros.get(name);
|
|
8250
|
-
if (val !== undefined && val !== "") {
|
|
8251
|
-
expandedNames.add(name);
|
|
8252
|
-
out.push(ShaderMacroProcessor._recursiveExpandMacro(val, valueMacros, funcMacros, expandedNames));
|
|
8253
|
-
expandedNames.delete(name);
|
|
8254
|
-
continue;
|
|
8255
|
-
}
|
|
8256
|
-
out.push(name);
|
|
8257
|
-
continue;
|
|
8258
|
-
}
|
|
8259
|
-
// Batch collect non-identifier characters
|
|
8260
|
-
var batchStart = i;
|
|
8261
|
-
while(i < len && !ShaderMacroProcessor._isIdentifierStart(macroExpansion.charCodeAt(i)))i++;
|
|
8262
|
-
out.push(macroExpansion.substring(batchStart, i));
|
|
8263
|
-
}
|
|
8264
|
-
return out.join("");
|
|
8265
|
-
};
|
|
8266
|
-
/**
|
|
8267
|
-
* Substitute function macro params in body.
|
|
8268
|
-
*/ ShaderMacroProcessor._expandFuncBody = function _expandFuncBody(func, args) {
|
|
8269
|
-
if (func.params.length === 0 || args.length !== func.params.length) return func.body;
|
|
8270
|
-
var result = func.body;
|
|
8271
|
-
for(var i = 0; i < func.params.length; i++){
|
|
8272
|
-
result = ShaderMacroProcessor._replaceWord(result, func.params[i], args[i]);
|
|
8278
|
+
if (func) return {
|
|
8279
|
+
body: func.body,
|
|
8280
|
+
parameters: func.params
|
|
8281
|
+
};
|
|
8282
|
+
var body = valueMacros.get(name);
|
|
8283
|
+
return body === undefined ? undefined : {
|
|
8284
|
+
body: body
|
|
8285
|
+
};
|
|
8286
|
+
});
|
|
8287
|
+
if (expanded.error) throw new Error(expanded.error);
|
|
8288
|
+
return expanded.source;
|
|
8273
8289
|
}
|
|
8274
|
-
return
|
|
8290
|
+
return chunk;
|
|
8275
8291
|
};
|
|
8276
8292
|
/**
|
|
8277
8293
|
* Evaluate a compound condition tree.
|
|
8278
8294
|
*/ ShaderMacroProcessor._evalCondition = function _evalCondition(cond, valueMacros, funcMacros) {
|
|
8279
|
-
|
|
8280
|
-
|
|
8281
|
-
|
|
8282
|
-
|
|
8283
|
-
|
|
8284
|
-
|
|
8285
|
-
|
|
8286
|
-
|
|
8287
|
-
|
|
8288
|
-
|
|
8289
|
-
|
|
8290
|
-
|
|
8291
|
-
|
|
8292
|
-
|
|
8293
|
-
|
|
8294
|
-
|
|
8295
|
-
|
|
8296
|
-
|
|
8297
|
-
|
|
8295
|
+
if (cond.t === "deferred") return ShaderMacroProcessor._evalDeferredCondition(cond.e, valueMacros, funcMacros);
|
|
8296
|
+
return evaluatePreprocessorExpression(cond, ShaderMacroProcessor._expressionContext) !== 0;
|
|
8297
|
+
};
|
|
8298
|
+
ShaderMacroProcessor._evalDeferredCondition = function _evalDeferredCondition(expression, valueMacros, funcMacros) {
|
|
8299
|
+
var withDefinedValues = resolvePreprocessorDefinedOperators(expression, function(name) {
|
|
8300
|
+
return valueMacros.has(name) || funcMacros.has(name);
|
|
8301
|
+
});
|
|
8302
|
+
var expanded = expandPreprocessorExpressionMacros(withDefinedValues, function(name) {
|
|
8303
|
+
var func = funcMacros.get(name);
|
|
8304
|
+
if (func) return {
|
|
8305
|
+
body: func.body,
|
|
8306
|
+
parameters: func.params
|
|
8307
|
+
};
|
|
8308
|
+
var body = valueMacros.get(name);
|
|
8309
|
+
return body === undefined ? undefined : {
|
|
8310
|
+
body: body
|
|
8311
|
+
};
|
|
8312
|
+
});
|
|
8313
|
+
if (expanded.error) throw new Error(expanded.error);
|
|
8314
|
+
var result = parsePreprocessorExpression(expanded.expression);
|
|
8315
|
+
if ("error" in result) {
|
|
8316
|
+
throw new Error("Invalid preprocessor expression after macro expansion: " + result.error.message);
|
|
8298
8317
|
}
|
|
8318
|
+
return evaluatePreprocessorExpression(result.condition, ShaderMacroProcessor._expressionContext) !== 0;
|
|
8299
8319
|
};
|
|
8300
|
-
|
|
8301
|
-
|
|
8302
|
-
|
|
8303
|
-
switch(
|
|
8320
|
+
ShaderMacroProcessor._compareValues = function _compareValues(left, operator, right) {
|
|
8321
|
+
left |= 0;
|
|
8322
|
+
right |= 0;
|
|
8323
|
+
switch(operator){
|
|
8304
8324
|
case "==":
|
|
8305
|
-
return
|
|
8325
|
+
return left === right;
|
|
8306
8326
|
case "!=":
|
|
8307
|
-
return
|
|
8327
|
+
return left !== right;
|
|
8308
8328
|
case ">":
|
|
8309
|
-
return
|
|
8329
|
+
return left > right;
|
|
8310
8330
|
case "<":
|
|
8311
|
-
return
|
|
8331
|
+
return left < right;
|
|
8312
8332
|
case ">=":
|
|
8313
|
-
return
|
|
8333
|
+
return left >= right;
|
|
8314
8334
|
case "<=":
|
|
8315
|
-
return
|
|
8335
|
+
return left <= right;
|
|
8316
8336
|
default:
|
|
8317
|
-
|
|
8318
|
-
}
|
|
8319
|
-
};
|
|
8320
|
-
/**
|
|
8321
|
-
* Parse function macro call arguments.
|
|
8322
|
-
* Returns reusable static result object to avoid allocation.
|
|
8323
|
-
*/ ShaderMacroProcessor._parseFuncArgs = function _parseFuncArgs(text, openParen) {
|
|
8324
|
-
var result = ShaderMacroProcessor._parsedFuncArgs;
|
|
8325
|
-
result.values.length = 0;
|
|
8326
|
-
var level = 1;
|
|
8327
|
-
var argStart = openParen + 1;
|
|
8328
|
-
var k = argStart;
|
|
8329
|
-
var len = text.length;
|
|
8330
|
-
while(k < len && level > 0){
|
|
8331
|
-
var cc = text.charCodeAt(k);
|
|
8332
|
-
if (cc === 40 /* '(' */ ) {
|
|
8333
|
-
level++;
|
|
8334
|
-
} else if (cc === 41 /* ')' */ ) {
|
|
8335
|
-
if (--level === 0) {
|
|
8336
|
-
var arg = text.substring(argStart, k).trim();
|
|
8337
|
-
if (arg.length > 0 || result.values.length > 0) result.values.push(arg);
|
|
8338
|
-
result.end = k + 1;
|
|
8339
|
-
return result;
|
|
8340
|
-
}
|
|
8341
|
-
} else if (cc === 44 /* ',' */ && level === 1) {
|
|
8342
|
-
result.values.push(text.substring(argStart, k).trim());
|
|
8343
|
-
argStart = k + 1;
|
|
8344
|
-
}
|
|
8345
|
-
k++;
|
|
8346
|
-
}
|
|
8347
|
-
return null;
|
|
8348
|
-
};
|
|
8349
|
-
/**
|
|
8350
|
-
* Replace all whole-word occurrences of `word` in `text` with `replacement`.
|
|
8351
|
-
*/ ShaderMacroProcessor._replaceWord = function _replaceWord(text, word, replacement) {
|
|
8352
|
-
var wLen = word.length;
|
|
8353
|
-
var parts = ShaderMacroProcessor._replaceWordParts;
|
|
8354
|
-
parts.length = 0;
|
|
8355
|
-
var start = 0;
|
|
8356
|
-
var idx = text.indexOf(word, start);
|
|
8357
|
-
while(idx !== -1){
|
|
8358
|
-
if (idx > 0 && ShaderMacroProcessor._isIdentifierPart(text.charCodeAt(idx - 1))) {
|
|
8359
|
-
idx = text.indexOf(word, idx + 1);
|
|
8360
|
-
continue;
|
|
8361
|
-
}
|
|
8362
|
-
var afterIdx = idx + wLen;
|
|
8363
|
-
if (afterIdx < text.length && ShaderMacroProcessor._isIdentifierPart(text.charCodeAt(afterIdx))) {
|
|
8364
|
-
idx = text.indexOf(word, idx + 1);
|
|
8365
|
-
continue;
|
|
8366
|
-
}
|
|
8367
|
-
parts.push(text.substring(start, idx));
|
|
8368
|
-
parts.push(replacement);
|
|
8369
|
-
start = afterIdx;
|
|
8370
|
-
idx = text.indexOf(word, start);
|
|
8337
|
+
throw new Error("Unsupported preprocessor comparison operator '" + operator + "'.");
|
|
8371
8338
|
}
|
|
8372
|
-
if (start === 0) return text;
|
|
8373
|
-
parts.push(text.substring(start));
|
|
8374
|
-
return parts.join("");
|
|
8375
8339
|
};
|
|
8376
8340
|
/**
|
|
8377
8341
|
* Concatenate shader chunks with consecutive blank lines collapsed to a single newline.
|
|
@@ -8422,14 +8386,23 @@ function _create_for_of_iterator_helper_loose(o, allowArrayLike) {
|
|
|
8422
8386
|
ShaderMacroProcessor._valueMacros = new Map();
|
|
8423
8387
|
ShaderMacroProcessor._funcMacros = new Map();
|
|
8424
8388
|
ShaderMacroProcessor._shaderChunks = [];
|
|
8389
|
+
ShaderMacroProcessor._declarationGroups = new Map();
|
|
8390
|
+
ShaderMacroProcessor._activeDeclarations = new Map();
|
|
8391
|
+
ShaderMacroProcessor._ownedChunks = new Map();
|
|
8392
|
+
ShaderMacroProcessor._references = new Map();
|
|
8393
|
+
ShaderMacroProcessor._reachableDeclarations = new Set();
|
|
8394
|
+
ShaderMacroProcessor._pendingDeclarations = [];
|
|
8425
8395
|
ShaderMacroProcessor._out = [];
|
|
8426
|
-
ShaderMacroProcessor._expandedNames = new Set();
|
|
8427
8396
|
ShaderMacroProcessor._macroFirstChars = new Set();
|
|
8428
8397
|
ShaderMacroProcessor._macroFirstCharsDirty = true;
|
|
8429
|
-
ShaderMacroProcessor.
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8398
|
+
ShaderMacroProcessor._expressionContext = {
|
|
8399
|
+
resolveIdentifier: function resolveIdentifier(name) {
|
|
8400
|
+
var value = ShaderMacroProcessor._valueMacros.get(name);
|
|
8401
|
+
return value === undefined ? 0 : Number(value) | 0;
|
|
8402
|
+
},
|
|
8403
|
+
isDefined: function isDefined(name) {
|
|
8404
|
+
return ShaderMacroProcessor._valueMacros.has(name) || ShaderMacroProcessor._funcMacros.has(name);
|
|
8405
|
+
}
|
|
8433
8406
|
};
|
|
8434
8407
|
|
|
8435
8408
|
/**
|
|
@@ -9133,7 +9106,6 @@ var precisionStr = "\n #ifdef GL_FRAGMENT_PRECISION_HIGH\n precision hig
|
|
|
9133
9106
|
return ShaderPass;
|
|
9134
9107
|
}(ShaderPart);
|
|
9135
9108
|
/** @internal */ ShaderPass._shaderPassCounter = 0;
|
|
9136
|
-
/** @internal */ ShaderPass._shaderRootPath = "shaders://root/";
|
|
9137
9109
|
ShaderPass._shaderMacroList = [];
|
|
9138
9110
|
ShaderPass._macroMap = new Map();
|
|
9139
9111
|
|
|
@@ -9242,62 +9214,71 @@ ShaderPass._macroMap = new Map();
|
|
|
9242
9214
|
*/ _proto._addReferCount = function _addReferCount(value) {
|
|
9243
9215
|
this._refCount += value;
|
|
9244
9216
|
};
|
|
9245
|
-
Shader.create = function create(nameOrShaderSource, shaderPassesOrSubShadersOrPlatformTarget
|
|
9217
|
+
Shader.create = function create(nameOrShaderSource, shaderPassesOrSubShadersOrPlatformTarget) {
|
|
9218
|
+
if (shaderPassesOrSubShadersOrPlatformTarget == undefined || typeof shaderPassesOrSubShadersOrPlatformTarget === "number") {
|
|
9219
|
+
var platformTarget = typeof shaderPassesOrSubShadersOrPlatformTarget === "number" ? shaderPassesOrSubShadersOrPlatformTarget : ShaderLanguage.GLSLES100;
|
|
9220
|
+
return Shader._createFromSource(nameOrShaderSource, platformTarget);
|
|
9221
|
+
}
|
|
9246
9222
|
var shader;
|
|
9247
9223
|
var shaderMap = Shader._shaderMap;
|
|
9248
|
-
if (
|
|
9249
|
-
|
|
9224
|
+
if (shaderMap[nameOrShaderSource]) {
|
|
9225
|
+
console.error('Shader named "' + nameOrShaderSource + '" already exists.');
|
|
9226
|
+
return;
|
|
9250
9227
|
}
|
|
9251
|
-
if (
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
var shaderSource = shaderCompiler._parseShaderSource(nameOrShaderSource);
|
|
9257
|
-
if (shaderMap[shaderSource.name]) {
|
|
9258
|
-
console.error('Shader named "' + shaderSource.name + '" already exists.');
|
|
9259
|
-
return;
|
|
9260
|
-
}
|
|
9261
|
-
var basePathForIncludeKey = new URL(path != null ? path : "", ShaderPass._shaderRootPath).href;
|
|
9262
|
-
var subShaderList = shaderSource.subShaders.map(function(subShaderSource) {
|
|
9263
|
-
var passList = subShaderSource.passes.map(function(passSource) {
|
|
9264
|
-
if (passSource.isUsePass) {
|
|
9265
|
-
return Shader._resolveUsePass(passSource.name);
|
|
9266
|
-
}
|
|
9267
|
-
var shaderPassSource = Shader._shaderCompiler._parseShaderPass(passSource.contents, passSource.vertexEntry, passSource.fragmentEntry, shaderPassesOrSubShadersOrPlatformTarget, basePathForIncludeKey);
|
|
9268
|
-
if (!shaderPassSource) {
|
|
9269
|
-
throw 'Shader pass "' + shaderSource.name + "." + subShaderSource.name + "." + passSource.name + '" parse failed, please check the shader source code.';
|
|
9270
|
-
}
|
|
9271
|
-
var shaderPass = new ShaderPass(passSource.name, shaderPassSource.vertexShaderInstructions, shaderPassSource.fragmentShaderInstructions, shaderPassesOrSubShadersOrPlatformTarget, passSource.tags);
|
|
9272
|
-
Shader._applyRenderStates(shaderPass, passSource.renderStates.constantMap, passSource.renderStates.variableMap, false);
|
|
9273
|
-
return shaderPass;
|
|
9274
|
-
});
|
|
9275
|
-
return new SubShader(subShaderSource.name, passList, subShaderSource.tags);
|
|
9276
|
-
});
|
|
9277
|
-
shader = new Shader(shaderSource.name, subShaderList);
|
|
9278
|
-
shaderMap[shaderSource.name] = shader;
|
|
9279
|
-
return shader;
|
|
9280
|
-
} else {
|
|
9281
|
-
if (shaderMap[nameOrShaderSource]) {
|
|
9282
|
-
console.error('Shader named "' + nameOrShaderSource + '" already exists.');
|
|
9283
|
-
return;
|
|
9284
|
-
}
|
|
9285
|
-
if (shaderPassesOrSubShadersOrPlatformTarget.length > 0) {
|
|
9286
|
-
if (shaderPassesOrSubShadersOrPlatformTarget[0].constructor === ShaderPass) {
|
|
9287
|
-
shader = new Shader(nameOrShaderSource, [
|
|
9288
|
-
new SubShader("Default", shaderPassesOrSubShadersOrPlatformTarget)
|
|
9289
|
-
]);
|
|
9290
|
-
} else {
|
|
9291
|
-
shader = new Shader(nameOrShaderSource, shaderPassesOrSubShadersOrPlatformTarget.slice());
|
|
9292
|
-
}
|
|
9228
|
+
if (shaderPassesOrSubShadersOrPlatformTarget.length > 0) {
|
|
9229
|
+
if (shaderPassesOrSubShadersOrPlatformTarget[0].constructor === ShaderPass) {
|
|
9230
|
+
shader = new Shader(nameOrShaderSource, [
|
|
9231
|
+
new SubShader("Default", shaderPassesOrSubShadersOrPlatformTarget)
|
|
9232
|
+
]);
|
|
9293
9233
|
} else {
|
|
9294
|
-
|
|
9234
|
+
shader = new Shader(nameOrShaderSource, shaderPassesOrSubShadersOrPlatformTarget.slice());
|
|
9295
9235
|
}
|
|
9236
|
+
} else {
|
|
9237
|
+
throw "SubShader or ShaderPass count must large than 0.";
|
|
9296
9238
|
}
|
|
9297
9239
|
shaderMap[nameOrShaderSource] = shader;
|
|
9298
9240
|
return shader;
|
|
9299
9241
|
};
|
|
9300
9242
|
/**
|
|
9243
|
+
* Creates a shader while retaining loader-owned source location metadata for relative includes.
|
|
9244
|
+
* @param shaderSource - Complete ShaderLab source.
|
|
9245
|
+
* @param platformTarget - Shader backend target.
|
|
9246
|
+
* @param sourceFile - Canonical source location supplied by an asset loader or authoring tool.
|
|
9247
|
+
* @returns The compiled shader, or `undefined` if its name already exists.
|
|
9248
|
+
* @throws When the shader compiler is unavailable or a pass cannot be compiled.
|
|
9249
|
+
* @internal
|
|
9250
|
+
*/ Shader._createFromSource = function _createFromSource(shaderSource, platformTarget, sourceFile) {
|
|
9251
|
+
if (platformTarget === void 0) platformTarget = ShaderLanguage.GLSLES100;
|
|
9252
|
+
var shaderCompiler = Shader._shaderCompiler;
|
|
9253
|
+
if (!shaderCompiler) {
|
|
9254
|
+
throw "ShaderCompiler has not been set up yet.";
|
|
9255
|
+
}
|
|
9256
|
+
var parsedSource = shaderCompiler._parseShaderSource(shaderSource);
|
|
9257
|
+
var shaderMap = Shader._shaderMap;
|
|
9258
|
+
if (shaderMap[parsedSource.name]) {
|
|
9259
|
+
console.error('Shader named "' + parsedSource.name + '" already exists.');
|
|
9260
|
+
return;
|
|
9261
|
+
}
|
|
9262
|
+
var subShaderList = parsedSource.subShaders.map(function(subShaderSource) {
|
|
9263
|
+
var passList = subShaderSource.passes.map(function(passSource) {
|
|
9264
|
+
if (passSource.isUsePass) {
|
|
9265
|
+
return Shader._resolveUsePass(passSource.name);
|
|
9266
|
+
}
|
|
9267
|
+
var shaderPassSource = shaderCompiler._parseShaderPass(passSource.contents, passSource.vertexEntry, passSource.fragmentEntry, platformTarget, sourceFile, passSource.contentScopeStarts);
|
|
9268
|
+
if (!shaderPassSource) {
|
|
9269
|
+
throw 'Shader pass "' + parsedSource.name + "." + subShaderSource.name + "." + passSource.name + '" parse failed, please check the shader source code.';
|
|
9270
|
+
}
|
|
9271
|
+
var shaderPass = new ShaderPass(passSource.name, shaderPassSource.vertexShaderInstructions, shaderPassSource.fragmentShaderInstructions, platformTarget, passSource.tags);
|
|
9272
|
+
Shader._applyRenderStates(shaderPass, passSource.renderStates.constantMap, passSource.renderStates.variableMap, false);
|
|
9273
|
+
return shaderPass;
|
|
9274
|
+
});
|
|
9275
|
+
return new SubShader(subShaderSource.name, passList, subShaderSource.tags);
|
|
9276
|
+
});
|
|
9277
|
+
var shader = new Shader(parsedSource.name, subShaderList);
|
|
9278
|
+
shaderMap[parsedSource.name] = shader;
|
|
9279
|
+
return shader;
|
|
9280
|
+
};
|
|
9281
|
+
/**
|
|
9301
9282
|
* Find a shader by name.
|
|
9302
9283
|
* @param name - Name of the shader
|
|
9303
9284
|
*/ Shader.find = function find(name) {
|
|
@@ -19708,15 +19689,6 @@ var PointerEventType = /*#__PURE__*/ function(PointerEventType) {
|
|
|
19708
19689
|
return CameraClearFlags;
|
|
19709
19690
|
}({});
|
|
19710
19691
|
|
|
19711
|
-
/**
|
|
19712
|
-
* @internal
|
|
19713
|
-
*/ var ColliderShapeChangeFlag = /*#__PURE__*/ function(ColliderShapeChangeFlag) {
|
|
19714
|
-
ColliderShapeChangeFlag[ColliderShapeChangeFlag["Property"] = 1] = "Property";
|
|
19715
|
-
ColliderShapeChangeFlag[ColliderShapeChangeFlag["Count"] = 2] = "Count";
|
|
19716
|
-
ColliderShapeChangeFlag[ColliderShapeChangeFlag["Both"] = 3] = "Both";
|
|
19717
|
-
return ColliderShapeChangeFlag;
|
|
19718
|
-
}({});
|
|
19719
|
-
|
|
19720
19692
|
var Collider = /*#__PURE__*/ function(Component) {
|
|
19721
19693
|
_inherits(Collider, Component);
|
|
19722
19694
|
function Collider(entity) {
|
|
@@ -19738,7 +19710,7 @@ var Collider = /*#__PURE__*/ function(Component) {
|
|
|
19738
19710
|
}
|
|
19739
19711
|
this._addNativeShape(shape);
|
|
19740
19712
|
this._shapes.push(shape);
|
|
19741
|
-
this._handleShapesChanged(
|
|
19713
|
+
this._handleShapesChanged();
|
|
19742
19714
|
}
|
|
19743
19715
|
};
|
|
19744
19716
|
/**
|
|
@@ -19749,7 +19721,7 @@ var Collider = /*#__PURE__*/ function(Component) {
|
|
|
19749
19721
|
if (index !== -1) {
|
|
19750
19722
|
this._shapes.splice(index, 1);
|
|
19751
19723
|
this._removeNativeShape(shape);
|
|
19752
|
-
this._handleShapesChanged(
|
|
19724
|
+
this._handleShapesChanged();
|
|
19753
19725
|
}
|
|
19754
19726
|
};
|
|
19755
19727
|
/**
|
|
@@ -19760,7 +19732,7 @@ var Collider = /*#__PURE__*/ function(Component) {
|
|
|
19760
19732
|
this._removeNativeShape(shapes[i]);
|
|
19761
19733
|
}
|
|
19762
19734
|
shapes.length = 0;
|
|
19763
|
-
this._handleShapesChanged(
|
|
19735
|
+
this._handleShapesChanged();
|
|
19764
19736
|
};
|
|
19765
19737
|
/**
|
|
19766
19738
|
* @internal
|
|
@@ -19798,11 +19770,7 @@ var Collider = /*#__PURE__*/ function(Component) {
|
|
|
19798
19770
|
};
|
|
19799
19771
|
/**
|
|
19800
19772
|
* @internal
|
|
19801
|
-
*/ _proto._handleShapesChanged = function _handleShapesChanged(
|
|
19802
|
-
if (changeType & ColliderShapeChangeFlag.Count) {
|
|
19803
|
-
this._setCollisionLayer();
|
|
19804
|
-
}
|
|
19805
|
-
};
|
|
19773
|
+
*/ _proto._handleShapesChanged = function _handleShapesChanged() {};
|
|
19806
19774
|
/**
|
|
19807
19775
|
* @internal
|
|
19808
19776
|
*/ _proto._setNativeShapeAttached = function _setNativeShapeAttached(shape, attached) {
|
|
@@ -19810,7 +19778,7 @@ var Collider = /*#__PURE__*/ function(Component) {
|
|
|
19810
19778
|
if (nativeShape && shape._isShapeAttached !== attached) {
|
|
19811
19779
|
if (attached) {
|
|
19812
19780
|
nativeShape.setWorldScale(this.entity.transform.lossyWorldScale);
|
|
19813
|
-
this._nativeCollider.addShape(nativeShape);
|
|
19781
|
+
this._nativeCollider.addShape(nativeShape, this._collisionLayerIndex);
|
|
19814
19782
|
} else {
|
|
19815
19783
|
this._nativeCollider.removeShape(nativeShape);
|
|
19816
19784
|
}
|
|
@@ -19821,7 +19789,6 @@ var Collider = /*#__PURE__*/ function(Component) {
|
|
|
19821
19789
|
for(var i = 0, n = this.shapes.length; i < n; i++){
|
|
19822
19790
|
this._addNativeShape(this.shapes[i]);
|
|
19823
19791
|
}
|
|
19824
|
-
this._setCollisionLayer();
|
|
19825
19792
|
};
|
|
19826
19793
|
/**
|
|
19827
19794
|
* @internal
|
|
@@ -19844,9 +19811,6 @@ var Collider = /*#__PURE__*/ function(Component) {
|
|
|
19844
19811
|
this._setNativeShapeAttached(shape, false);
|
|
19845
19812
|
shape._collider = null;
|
|
19846
19813
|
};
|
|
19847
|
-
_proto._setCollisionLayer = function _setCollisionLayer() {
|
|
19848
|
-
this._nativeCollider.setCollisionLayer(this._collisionLayerIndex);
|
|
19849
|
-
};
|
|
19850
19814
|
_create_class(Collider, [
|
|
19851
19815
|
{
|
|
19852
19816
|
key: "shapes",
|
|
@@ -20159,11 +20123,7 @@ __decorate([
|
|
|
20159
20123
|
_inherits(ColliderShape, DataObject);
|
|
20160
20124
|
function ColliderShape() {
|
|
20161
20125
|
var _this;
|
|
20162
|
-
_this = DataObject.call(this) || this, /** @internal */ _this._isShapeAttached = false, _this._isTrigger = false, _this._rotation = new Vector3(), _this._position = new Vector3(), _this._contactOffset = 0.02
|
|
20163
|
-
* @internal
|
|
20164
|
-
* @beta
|
|
20165
|
-
* Whether raycast can select it.
|
|
20166
|
-
*/ _this.isSceneQuery = true;
|
|
20126
|
+
_this = DataObject.call(this) || this, /** @internal */ _this._isShapeAttached = false, _this._isTrigger = false, _this._isSceneQuery = true, _this._rotation = new Vector3(), _this._position = new Vector3(), _this._contactOffset = 0.02;
|
|
20167
20127
|
_this._material = new PhysicsMaterial();
|
|
20168
20128
|
_this._id = ColliderShape._idGenerator++;
|
|
20169
20129
|
_this._setRotation = _this._setRotation.bind(_this);
|
|
@@ -20218,20 +20178,39 @@ __decorate([
|
|
|
20218
20178
|
this._nativeShape.setRotation(this._rotation);
|
|
20219
20179
|
this._nativeShape.setContactOffset(this._contactOffset);
|
|
20220
20180
|
this._nativeShape.setIsTrigger(this._isTrigger);
|
|
20181
|
+
this._nativeShape.setIsSceneQuery(this._isSceneQuery);
|
|
20221
20182
|
this._nativeShape.setMaterial(this._material._nativeMaterial);
|
|
20222
|
-
(_this__collider = this._collider) == null ? void 0 : _this__collider._handleShapesChanged(
|
|
20183
|
+
(_this__collider = this._collider) == null ? void 0 : _this__collider._handleShapesChanged();
|
|
20223
20184
|
};
|
|
20224
20185
|
_proto._setPosition = function _setPosition() {
|
|
20225
20186
|
var _this__nativeShape, _this__collider;
|
|
20226
20187
|
(_this__nativeShape = this._nativeShape) == null ? void 0 : _this__nativeShape.setPosition(this._position);
|
|
20227
|
-
(_this__collider = this._collider) == null ? void 0 : _this__collider._handleShapesChanged(
|
|
20188
|
+
(_this__collider = this._collider) == null ? void 0 : _this__collider._handleShapesChanged();
|
|
20228
20189
|
};
|
|
20229
20190
|
_proto._setRotation = function _setRotation() {
|
|
20230
20191
|
var _this__nativeShape, _this__collider;
|
|
20231
20192
|
(_this__nativeShape = this._nativeShape) == null ? void 0 : _this__nativeShape.setRotation(this._rotation);
|
|
20232
|
-
(_this__collider = this._collider) == null ? void 0 : _this__collider._handleShapesChanged(
|
|
20193
|
+
(_this__collider = this._collider) == null ? void 0 : _this__collider._handleShapesChanged();
|
|
20233
20194
|
};
|
|
20234
20195
|
_create_class(ColliderShape, [
|
|
20196
|
+
{
|
|
20197
|
+
key: "isSceneQuery",
|
|
20198
|
+
get: /**
|
|
20199
|
+
* @internal
|
|
20200
|
+
* @beta
|
|
20201
|
+
* Whether this shape participates in scene queries, including raycasts, shape casts, and overlap queries.
|
|
20202
|
+
* This does not affect collision response.
|
|
20203
|
+
*/ function get() {
|
|
20204
|
+
return this._isSceneQuery;
|
|
20205
|
+
},
|
|
20206
|
+
set: function set(value) {
|
|
20207
|
+
if (this._isSceneQuery !== value) {
|
|
20208
|
+
var _this__nativeShape;
|
|
20209
|
+
this._isSceneQuery = value;
|
|
20210
|
+
(_this__nativeShape = this._nativeShape) == null ? void 0 : _this__nativeShape.setIsSceneQuery(value);
|
|
20211
|
+
}
|
|
20212
|
+
}
|
|
20213
|
+
},
|
|
20235
20214
|
{
|
|
20236
20215
|
key: "collider",
|
|
20237
20216
|
get: /**
|
|
@@ -20631,8 +20610,7 @@ __decorate([
|
|
|
20631
20610
|
};
|
|
20632
20611
|
/**
|
|
20633
20612
|
* @internal
|
|
20634
|
-
*/ _proto._handleShapesChanged = function _handleShapesChanged(
|
|
20635
|
-
Collider.prototype._handleShapesChanged.call(this, changeType);
|
|
20613
|
+
*/ _proto._handleShapesChanged = function _handleShapesChanged() {
|
|
20636
20614
|
if (this._automaticCenterOfMass || this._automaticInertiaTensor) {
|
|
20637
20615
|
this._setMassAndUpdateInertia();
|
|
20638
20616
|
}
|
|
@@ -21148,16 +21126,61 @@ __decorate([
|
|
|
21148
21126
|
hitResult = outHitResult;
|
|
21149
21127
|
}
|
|
21150
21128
|
var normalizedDirection = PhysicsScene._normalizeDirection(ray.direction);
|
|
21151
|
-
var preFilter = this._createPreFilter(layerMask);
|
|
21152
21129
|
var result = false;
|
|
21153
21130
|
if (normalizedDirection) {
|
|
21154
|
-
result = this._nativePhysicsScene.raycast(ray.origin, normalizedDirection, distance,
|
|
21131
|
+
result = this._nativePhysicsScene.raycast(ray.origin, normalizedDirection, distance, layerMask, hitResult ? this._createHitCallback(hitResult) : undefined);
|
|
21155
21132
|
}
|
|
21156
21133
|
if (!result && hitResult) {
|
|
21157
21134
|
this._clearHitResult(hitResult);
|
|
21158
21135
|
}
|
|
21159
21136
|
return result;
|
|
21160
21137
|
};
|
|
21138
|
+
_proto.raycastAll = function raycastAll(ray, distance, layerMask, outHitResults) {
|
|
21139
|
+
var _this = this;
|
|
21140
|
+
if (distance === void 0) distance = Number.MAX_VALUE;
|
|
21141
|
+
if (layerMask === void 0) layerMask = Layer.Everything;
|
|
21142
|
+
if (typeof layerMask !== "number") {
|
|
21143
|
+
outHitResults || (outHitResults = layerMask);
|
|
21144
|
+
layerMask = Layer.Everything;
|
|
21145
|
+
}
|
|
21146
|
+
if (typeof distance !== "number") {
|
|
21147
|
+
outHitResults || (outHitResults = distance);
|
|
21148
|
+
distance = Number.MAX_VALUE;
|
|
21149
|
+
}
|
|
21150
|
+
if (!outHitResults) {
|
|
21151
|
+
return this.raycast(ray, distance, layerMask);
|
|
21152
|
+
}
|
|
21153
|
+
var pool = PhysicsScene._raycastHitPool;
|
|
21154
|
+
var hitCount = 0;
|
|
21155
|
+
var normalizedDirection = PhysicsScene._normalizeDirection(ray.direction);
|
|
21156
|
+
if (distance > 0 && normalizedDirection) {
|
|
21157
|
+
this._nativePhysicsScene.raycastAll(ray.origin, normalizedDirection, distance, layerMask, function(shapeUniqueID, hitDistance, position, normal) {
|
|
21158
|
+
var _outHitResults, _ref;
|
|
21159
|
+
var _pool_pop;
|
|
21160
|
+
var hitResult = (_outHitResults = outHitResults)[_ref = hitCount++] || (_outHitResults[_ref] = (_pool_pop = pool.pop()) != null ? _pool_pop : new HitResult());
|
|
21161
|
+
_this._setHitResult(hitResult, shapeUniqueID, hitDistance, position, normal);
|
|
21162
|
+
});
|
|
21163
|
+
}
|
|
21164
|
+
var length = outHitResults.length;
|
|
21165
|
+
if (hitCount < length) {
|
|
21166
|
+
// Preserve active aliases and recycle each unused object only once
|
|
21167
|
+
var seenHits = PhysicsScene._raycastSeenHits;
|
|
21168
|
+
for(var i = 0; i < hitCount; i++){
|
|
21169
|
+
seenHits.add(outHitResults[i]);
|
|
21170
|
+
}
|
|
21171
|
+
for(var i1 = hitCount; i1 < length; i1++){
|
|
21172
|
+
var hitResult = outHitResults[i1];
|
|
21173
|
+
if (hitResult && !seenHits.has(hitResult)) {
|
|
21174
|
+
seenHits.add(hitResult);
|
|
21175
|
+
this._clearHitResult(hitResult);
|
|
21176
|
+
pool.push(hitResult);
|
|
21177
|
+
}
|
|
21178
|
+
}
|
|
21179
|
+
seenHits.clear();
|
|
21180
|
+
}
|
|
21181
|
+
outHitResults.length = hitCount;
|
|
21182
|
+
return hitCount > 0;
|
|
21183
|
+
};
|
|
21161
21184
|
_proto.boxCast = function boxCast(center, halfExtents, direction, orientationOrDistanceOrResult, distanceOrResult, layerMaskOrResult, outHitResult) {
|
|
21162
21185
|
var hitResult;
|
|
21163
21186
|
var orientation = PhysicsScene._identityQuaternion;
|
|
@@ -21184,10 +21207,9 @@ __decorate([
|
|
|
21184
21207
|
hitResult = outHitResult;
|
|
21185
21208
|
}
|
|
21186
21209
|
var normalizedDirection = PhysicsScene._normalizeDirection(direction);
|
|
21187
|
-
var preFilter = this._createPreFilter(layerMask);
|
|
21188
21210
|
var result = false;
|
|
21189
21211
|
if (normalizedDirection) {
|
|
21190
|
-
result = this._nativePhysicsScene.boxCast(center, orientation, halfExtents, normalizedDirection, distance,
|
|
21212
|
+
result = this._nativePhysicsScene.boxCast(center, orientation, halfExtents, normalizedDirection, distance, layerMask, hitResult ? this._createHitCallback(hitResult) : undefined);
|
|
21191
21213
|
}
|
|
21192
21214
|
if (!result && hitResult) {
|
|
21193
21215
|
this._clearHitResult(hitResult);
|
|
@@ -21213,10 +21235,9 @@ __decorate([
|
|
|
21213
21235
|
hitResult = outHitResult;
|
|
21214
21236
|
}
|
|
21215
21237
|
var normalizedDirection = PhysicsScene._normalizeDirection(direction);
|
|
21216
|
-
var preFilter = this._createPreFilter(layerMask);
|
|
21217
21238
|
var result = false;
|
|
21218
21239
|
if (normalizedDirection) {
|
|
21219
|
-
result = this._nativePhysicsScene.sphereCast(center, radius, normalizedDirection, distance,
|
|
21240
|
+
result = this._nativePhysicsScene.sphereCast(center, radius, normalizedDirection, distance, layerMask, hitResult ? this._createHitCallback(hitResult) : undefined);
|
|
21220
21241
|
}
|
|
21221
21242
|
if (!result && hitResult) {
|
|
21222
21243
|
this._clearHitResult(hitResult);
|
|
@@ -21248,10 +21269,9 @@ __decorate([
|
|
|
21248
21269
|
hitResult = outHitResult;
|
|
21249
21270
|
}
|
|
21250
21271
|
var normalizedDirection = PhysicsScene._normalizeDirection(direction);
|
|
21251
|
-
var preFilter = this._createPreFilter(layerMask);
|
|
21252
21272
|
var result = false;
|
|
21253
21273
|
if (normalizedDirection) {
|
|
21254
|
-
result = this._nativePhysicsScene.capsuleCast(center, radius, height, orientation, normalizedDirection, distance,
|
|
21274
|
+
result = this._nativePhysicsScene.capsuleCast(center, radius, height, orientation, normalizedDirection, distance, layerMask, hitResult ? this._createHitCallback(hitResult) : undefined);
|
|
21255
21275
|
}
|
|
21256
21276
|
if (!result && hitResult) {
|
|
21257
21277
|
this._clearHitResult(hitResult);
|
|
@@ -21270,7 +21290,7 @@ __decorate([
|
|
|
21270
21290
|
if (orientation === void 0) orientation = PhysicsScene._identityQuaternion;
|
|
21271
21291
|
if (layerMask === void 0) layerMask = Layer.Everything;
|
|
21272
21292
|
if (shapes === void 0) shapes = [];
|
|
21273
|
-
var ids = this._nativePhysicsScene.overlapBoxAll(center, orientation, halfExtents,
|
|
21293
|
+
var ids = this._nativePhysicsScene.overlapBoxAll(center, orientation, halfExtents, layerMask);
|
|
21274
21294
|
shapes.length = 0;
|
|
21275
21295
|
for(var i = 0, n = ids.length; i < n; i++){
|
|
21276
21296
|
shapes.push(Engine._physicalObjectsMap[ids[i]]);
|
|
@@ -21287,7 +21307,7 @@ __decorate([
|
|
|
21287
21307
|
*/ _proto.overlapSphereAll = function overlapSphereAll(center, radius, layerMask, shapes) {
|
|
21288
21308
|
if (layerMask === void 0) layerMask = Layer.Everything;
|
|
21289
21309
|
if (shapes === void 0) shapes = [];
|
|
21290
|
-
var ids = this._nativePhysicsScene.overlapSphereAll(center, radius,
|
|
21310
|
+
var ids = this._nativePhysicsScene.overlapSphereAll(center, radius, layerMask);
|
|
21291
21311
|
shapes.length = 0;
|
|
21292
21312
|
for(var i = 0; i < ids.length; i++){
|
|
21293
21313
|
shapes.push(Engine._physicalObjectsMap[ids[i]]);
|
|
@@ -21307,7 +21327,7 @@ __decorate([
|
|
|
21307
21327
|
if (orientation === void 0) orientation = PhysicsScene._identityQuaternion;
|
|
21308
21328
|
if (layerMask === void 0) layerMask = Layer.Everything;
|
|
21309
21329
|
if (shapes === void 0) shapes = [];
|
|
21310
|
-
var ids = this._nativePhysicsScene.overlapCapsuleAll(center, radius, height, orientation,
|
|
21330
|
+
var ids = this._nativePhysicsScene.overlapCapsuleAll(center, radius, height, orientation, layerMask);
|
|
21311
21331
|
shapes.length = 0;
|
|
21312
21332
|
for(var i = 0; i < ids.length; i++){
|
|
21313
21333
|
shapes.push(Engine._physicalObjectsMap[ids[i]]);
|
|
@@ -21404,6 +21424,8 @@ __decorate([
|
|
|
21404
21424
|
* @internal
|
|
21405
21425
|
*/ _proto._gc = function _gc() {
|
|
21406
21426
|
var _this__nativePhysicsScene;
|
|
21427
|
+
PhysicsScene._raycastHitPool.length = 0;
|
|
21428
|
+
PhysicsScene._raycastSeenHits.clear();
|
|
21407
21429
|
this._colliders.garbageCollection();
|
|
21408
21430
|
(_this__nativePhysicsScene = this._nativePhysicsScene) == null ? void 0 : _this__nativePhysicsScene.gc();
|
|
21409
21431
|
};
|
|
@@ -21411,6 +21433,8 @@ __decorate([
|
|
|
21411
21433
|
* @internal
|
|
21412
21434
|
*/ _proto._destroy = function _destroy() {
|
|
21413
21435
|
var _this__nativePhysicsScene;
|
|
21436
|
+
PhysicsScene._raycastHitPool.length = 0;
|
|
21437
|
+
PhysicsScene._raycastSeenHits.clear();
|
|
21414
21438
|
(_this__nativePhysicsScene = this._nativePhysicsScene) == null ? void 0 : _this__nativePhysicsScene.destroy();
|
|
21415
21439
|
};
|
|
21416
21440
|
_proto._dispatchEvents = function _dispatchEvents(events) {
|
|
@@ -21502,24 +21526,20 @@ __decorate([
|
|
|
21502
21526
|
_proto._setGravity = function _setGravity() {
|
|
21503
21527
|
this._nativePhysicsScene.setGravity(this._gravity);
|
|
21504
21528
|
};
|
|
21505
|
-
_proto._createPreFilter = function _createPreFilter(mask) {
|
|
21506
|
-
return function(obj) {
|
|
21507
|
-
var shape = Engine._physicalObjectsMap[obj];
|
|
21508
|
-
if (!shape) {
|
|
21509
|
-
return false;
|
|
21510
|
-
}
|
|
21511
|
-
return (shape.collider.collisionLayer & mask) !== 0 && shape.isSceneQuery;
|
|
21512
|
-
};
|
|
21513
|
-
};
|
|
21514
21529
|
_proto._createHitCallback = function _createHitCallback(outHitResult) {
|
|
21530
|
+
var _this = this;
|
|
21515
21531
|
return function(shapeUniqueID, distance, position, normal) {
|
|
21516
|
-
outHitResult
|
|
21517
|
-
outHitResult.shape = Engine._physicalObjectsMap[shapeUniqueID];
|
|
21518
|
-
outHitResult.distance = distance;
|
|
21519
|
-
outHitResult.point.copyFrom(position);
|
|
21520
|
-
outHitResult.normal.copyFrom(normal);
|
|
21532
|
+
_this._setHitResult(outHitResult, shapeUniqueID, distance, position, normal);
|
|
21521
21533
|
};
|
|
21522
21534
|
};
|
|
21535
|
+
_proto._setHitResult = function _setHitResult(outHitResult, shapeUniqueID, distance, position, normal) {
|
|
21536
|
+
var shape = Engine._physicalObjectsMap[shapeUniqueID];
|
|
21537
|
+
outHitResult.entity = shape.collider.entity;
|
|
21538
|
+
outHitResult.shape = shape;
|
|
21539
|
+
outHitResult.distance = distance;
|
|
21540
|
+
outHitResult.point.copyFrom(position);
|
|
21541
|
+
outHitResult.normal.copyFrom(normal);
|
|
21542
|
+
};
|
|
21523
21543
|
_proto._clearHitResult = function _clearHitResult(hitResult) {
|
|
21524
21544
|
hitResult.entity = null;
|
|
21525
21545
|
hitResult.shape = null;
|
|
@@ -21563,6 +21583,8 @@ __decorate([
|
|
|
21563
21583
|
PhysicsScene._collision = new Collision();
|
|
21564
21584
|
PhysicsScene._identityQuaternion = new Quaternion(0, 0, 0, 1);
|
|
21565
21585
|
PhysicsScene._tempDirection = new Vector3();
|
|
21586
|
+
PhysicsScene._raycastHitPool = [];
|
|
21587
|
+
PhysicsScene._raycastSeenHits = new Set();
|
|
21566
21588
|
PhysicsScene._scriptIndexSetter = function(element, index) {
|
|
21567
21589
|
element._entityScriptsIndex = index;
|
|
21568
21590
|
};
|
|
@@ -27658,8 +27680,6 @@ var OverlayCamera = function OverlayCamera() {
|
|
|
27658
27680
|
// shader-compiler defaults to an empty map and stays free of any direct
|
|
27659
27681
|
// ShaderFactory dependency, so the binding has to be wired here at the
|
|
27660
27682
|
// runtime boundary.
|
|
27661
|
-
// @ts-ignore — `_setIncludeMap` is shader-compiler @internal; `includeMap`
|
|
27662
|
-
// is `ShaderFactory` @internal. Both intentionally cross-package wired.
|
|
27663
27683
|
shaderCompiler._setIncludeMap(ShaderFactory.includeMap);
|
|
27664
27684
|
Shader._shaderCompiler = shaderCompiler;
|
|
27665
27685
|
}
|
|
@@ -43359,5 +43379,5 @@ __decorate([
|
|
|
43359
43379
|
return Polyfill;
|
|
43360
43380
|
}();
|
|
43361
43381
|
|
|
43362
|
-
export { AmbientLight, AmbientOcclusion, AmbientOcclusionQuality, AnimationArrayCurve, AnimationBoolCurve, AnimationClip, AnimationClipCurveBinding, AnimationColorCurve, AnimationCurve, AnimationEvent, AnimationFloatArrayCurve, AnimationFloatCurve, AnimationQuaternionCurve, AnimationRectCurve, AnimationRefCurve, AnimationStringCurve, AnimationVector2Curve, AnimationVector3Curve, AnimationVector4Curve, Animator, AnimatorCondition, AnimatorConditionMode, AnimatorController, AnimatorControllerLayer, AnimatorControllerParameter, AnimatorCullingMode, AnimatorLayerBlendingMode, AnimatorLayerMask, AnimatorState, AnimatorStateInstance, AnimatorStateMachine, AnimatorStateTransition, AntiAliasing, AssetPromise, AssetType, AudioClip, AudioManager, AudioSource, Background, BackgroundMode, BackgroundTextureFillMode, BaseMaterial, BasicRenderPipeline, BlendFactor, BlendMode, BlendOperation, BlendShape, BlendShapeFrame, BlinnPhongMaterial, Blitter, BloomDownScaleMode, BloomEffect, BoolUpdateFlag, BoxColliderShape, BoxShape, Buffer, BufferAsset, BufferBindFlag, BufferMesh, BufferUsage, BufferUtil, Burst, Camera, CameraClearFlags, CameraModifyFlags, CameraType, Canvas, CapsuleColliderShape, CharRenderInfo, CharacterController, CircleShape, ClearableObjectPool, Collider, ColliderShape, ColliderShapeUpAxis, Collision, CollisionDetectionMode, ColorOverLifetimeModule, ColorWriteMask, CompareFunction, Component, ConeEmitType, ConeShape, ContactPoint, ContentRestorer, ControllerCollisionFlag, ControllerNonWalkableMode, CubeProbe, CullMode, CurveKey, CustomDataModule, DataObject, DataType, DependentMode, DepthTextureMode, DiffuseMode, DirectLight, DisorderedArray, Downsampling, DynamicCollider, DynamicColliderConstraints, EmissionModule, Engine, EngineEventType, EngineObject, Entity, EntityModifyFlags, EventDispatcher, FinalPass, FixedJoint, FogMode, Font, FontStyle, GLCapabilityType, GradientAlphaKey, GradientColorKey, HemisphereShape, HingeJoint, HitResult, IndexBufferBinding, IndexFormat, InheritVelocityModule, InputManager, InterpolationType, JSONAsset, Joint, JointLimits, JointMotor, Keyframe, Keys, Layer, LayerPathMask, Light, LimitVelocityOverLifetimeModule, Loader, Logger, MSAASamples, MainModule, Material, Mesh, MeshColliderShape, MeshColliderShapeCookingFlag, MeshRenderer, MeshShape, MeshTopology, ModelMesh, NoiseModule, OverflowMode, PBRMaterial, ParticleCompositeCurve, ParticleCompositeGradient, ParticleCurve, ParticleCurveMode, ParticleGenerator, ParticleGradient, ParticleGradientMode, ParticleInheritVelocityMode, ParticleMaterial, ParticleRenderMode, ParticleRenderer, ParticleScaleMode, ParticleShapeArcMode, ParticleShapeType, ParticleSimulationSpace, ParticleStopMode, ParticleSubEmitterInheritProperty, ParticleSubEmitterType, PhysicsMaterial, PhysicsMaterialCombineMode, PhysicsScene, PipelineStage, PlaneColliderShape, Platform, PointLight, Pointer, PointerButton, PointerEventData, PointerEventEmitter, PointerPhase, Polyfill, PostProcess, PostProcessEffect, PostProcessEffectBoolParameter, PostProcessEffectColorParameter, PostProcessEffectEnumParameter, PostProcessEffectFloatParameter, PostProcessEffectParameter, PostProcessEffectTextureParameter, PostProcessEffectVector2Parameter, PostProcessEffectVector3Parameter, PostProcessEffectVector4Parameter, PostProcessManager, PostProcessPass, PostProcessPassEvent, PostProcessUberPass, Primitive, PrimitiveMesh, Probe, ReferResource, RefractionMode, RenderBufferDepthFormat, RenderElement, RenderFace, RenderQueue, RenderQueueFlags, RenderQueueType, RenderStateElementKey, RenderTarget, Renderer, RendererUpdateFlags, RenderingStatistics, ReplacementFailureStrategy, ResourceManager, ReturnableObjectPool, RotationOverLifetimeModule, SafeLoopArray, Scene, SceneManager, Script, SetDataOptions, Shader, ShaderData, ShaderDataGroup, ShaderFactory, ShaderLanguage, ShaderMacro, ShaderMacroCollection, ShaderPass, ShaderProperty, ShaderPropertyType, ShaderTagKey, ShadowCascadesMode, ShadowResolution, ShadowType, Signal, SimpleSpriteAssembler, SizeOverLifetimeModule, Skin, SkinnedMeshRenderer, Sky, SkyBoxMaterial, SkyProceduralMaterial, SlicedSpriteAssembler, SphereColliderShape, SphereShape, SpotLight, SpringJoint, Sprite, SpriteAtlas, SpriteDrawMode, SpriteMask, SpriteMaskInteraction, SpriteMaskLayer, SpriteModifyFlags, SpriteRenderer, SpriteTileMode, StateMachineScript, StaticCollider, StencilOperation, SubEmitter, SubEmittersModule, SubFont, SubMesh, SubPrimitive, SubShader, SunMode, SystemInfo, TextAsset, TextHorizontalAlignment, TextRenderer, TextUtils, TextVerticalAlignment, Texture, Texture2D, Texture2DArray, TextureCoordinate, TextureCube, TextureCubeFace, TextureDepthCompareFunction, TextureFilterMode, TextureFormat, TextureSheetAnimationModule, TextureUsage, TextureUtils, TextureWrapMode, TiledSpriteAssembler, Time, TonemappingEffect, TonemappingMode, TrailMaterial, TrailRenderer, TrailTextureMode, Transform, TransformModifyFlags, UnlitMaterial, Utils, VelocityOverLifetimeModule, VertexAttribute, VertexBufferBinding, VertexElement, VertexElementFormat, VertexMergeBatcher, WrapMode, XRManager, assignmentClone, deepClone, dependentComponents, ignoreClone, registerPointerEventEmitter, request, resourceLoader };
|
|
43382
|
+
export { AmbientLight, AmbientOcclusion, AmbientOcclusionQuality, AnimationArrayCurve, AnimationBoolCurve, AnimationClip, AnimationClipCurveBinding, AnimationColorCurve, AnimationCurve, AnimationEvent, AnimationFloatArrayCurve, AnimationFloatCurve, AnimationQuaternionCurve, AnimationRectCurve, AnimationRefCurve, AnimationStringCurve, AnimationVector2Curve, AnimationVector3Curve, AnimationVector4Curve, Animator, AnimatorCondition, AnimatorConditionMode, AnimatorController, AnimatorControllerLayer, AnimatorControllerParameter, AnimatorCullingMode, AnimatorLayerBlendingMode, AnimatorLayerMask, AnimatorState, AnimatorStateInstance, AnimatorStateMachine, AnimatorStateTransition, AntiAliasing, AssetPromise, AssetType, AudioClip, AudioManager, AudioSource, Background, BackgroundMode, BackgroundTextureFillMode, BaseMaterial, BasicRenderPipeline, BlendFactor, BlendMode, BlendOperation, BlendShape, BlendShapeFrame, BlinnPhongMaterial, Blitter, BloomDownScaleMode, BloomEffect, BoolUpdateFlag, BoxColliderShape, BoxShape, Buffer, BufferAsset, BufferBindFlag, BufferMesh, BufferUsage, BufferUtil, Burst, Camera, CameraClearFlags, CameraModifyFlags, CameraType, Canvas, CapsuleColliderShape, CharRenderInfo, CharacterController, CircleShape, ClearableObjectPool, Collider, ColliderShape, ColliderShapeUpAxis, Collision, CollisionDetectionMode, ColorOverLifetimeModule, ColorWriteMask, CompareFunction, Component, ConeEmitType, ConeShape, ContactPoint, ContentRestorer, ControllerCollisionFlag, ControllerNonWalkableMode, CubeProbe, CullMode, CurveKey, CustomDataModule, DataObject, DataType, DependentMode, DepthTextureMode, DiffuseMode, DirectLight, DisorderedArray, Downsampling, DynamicCollider, DynamicColliderConstraints, EmissionModule, Engine, EngineEventType, EngineObject, Entity, EntityModifyFlags, EventDispatcher, FinalPass, FixedJoint, FogMode, Font, FontStyle, GLCapabilityType, GradientAlphaKey, GradientColorKey, HemisphereShape, HingeJoint, HitResult, IndexBufferBinding, IndexFormat, InheritVelocityModule, InputManager, InterpolationType, JSONAsset, Joint, JointLimits, JointMotor, Keyframe, Keys, Layer, LayerPathMask, Light, LimitVelocityOverLifetimeModule, Loader, Logger, MSAASamples, MainModule, Material, Mesh, MeshColliderShape, MeshColliderShapeCookingFlag, MeshRenderer, MeshShape, MeshTopology, ModelMesh, NoiseModule, OverflowMode, PBRMaterial, ParticleCompositeCurve, ParticleCompositeGradient, ParticleCurve, ParticleCurveMode, ParticleGenerator, ParticleGradient, ParticleGradientMode, ParticleInheritVelocityMode, ParticleMaterial, ParticleRenderMode, ParticleRenderer, ParticleScaleMode, ParticleShapeArcMode, ParticleShapeType, ParticleSimulationSpace, ParticleStopMode, ParticleSubEmitterInheritProperty, ParticleSubEmitterType, PhysicsMaterial, PhysicsMaterialCombineMode, PhysicsScene, PipelineStage, PlaneColliderShape, Platform, PointLight, Pointer, PointerButton, PointerEventData, PointerEventEmitter, PointerPhase, Polyfill, PostProcess, PostProcessEffect, PostProcessEffectBoolParameter, PostProcessEffectColorParameter, PostProcessEffectEnumParameter, PostProcessEffectFloatParameter, PostProcessEffectParameter, PostProcessEffectTextureParameter, PostProcessEffectVector2Parameter, PostProcessEffectVector3Parameter, PostProcessEffectVector4Parameter, PostProcessManager, PostProcessPass, PostProcessPassEvent, PostProcessUberPass, Primitive, PrimitiveMesh, Probe, ReferResource, RefractionMode, RenderBufferDepthFormat, RenderElement, RenderFace, RenderQueue, RenderQueueFlags, RenderQueueType, RenderStateElementKey, RenderTarget, Renderer, RendererUpdateFlags, RenderingStatistics, ReplacementFailureStrategy, ResourceManager, ReturnableObjectPool, RotationOverLifetimeModule, SafeLoopArray, Scene, SceneManager, Script, SetDataOptions, Shader, ShaderData, ShaderDataGroup, ShaderFactory, ShaderLanguage, ShaderMacro, ShaderMacroCollection, ShaderPass, ShaderPreprocessorDirective, ShaderProperty, ShaderPropertyType, ShaderTagKey, ShadowCascadesMode, ShadowResolution, ShadowType, Signal, SimpleSpriteAssembler, SizeOverLifetimeModule, Skin, SkinnedMeshRenderer, Sky, SkyBoxMaterial, SkyProceduralMaterial, SlicedSpriteAssembler, SphereColliderShape, SphereShape, SpotLight, SpringJoint, Sprite, SpriteAtlas, SpriteDrawMode, SpriteMask, SpriteMaskInteraction, SpriteMaskLayer, SpriteModifyFlags, SpriteRenderer, SpriteTileMode, StateMachineScript, StaticCollider, StencilOperation, SubEmitter, SubEmittersModule, SubFont, SubMesh, SubPrimitive, SubShader, SunMode, SystemInfo, TextAsset, TextHorizontalAlignment, TextRenderer, TextUtils, TextVerticalAlignment, Texture, Texture2D, Texture2DArray, TextureCoordinate, TextureCube, TextureCubeFace, TextureDepthCompareFunction, TextureFilterMode, TextureFormat, TextureSheetAnimationModule, TextureUsage, TextureUtils, TextureWrapMode, TiledSpriteAssembler, Time, TonemappingEffect, TonemappingMode, TrailMaterial, TrailRenderer, TrailTextureMode, Transform, TransformModifyFlags, UnlitMaterial, Utils, VelocityOverLifetimeModule, VertexAttribute, VertexBufferBinding, VertexElement, VertexElementFormat, VertexMergeBatcher, WrapMode, XRManager, assignmentClone, deepClone, dependentComponents, ignoreClone, registerPointerEventEmitter, request, resourceLoader };
|
|
43363
43383
|
//# sourceMappingURL=module.js.map
|