@babylonjs/core 6.4.1 → 6.5.0
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/Engines/WebGPU/webgpuDrawContext.js +1 -1
- package/Engines/WebGPU/webgpuDrawContext.js.map +1 -1
- package/Engines/thinEngine.js +2 -2
- package/Engines/thinEngine.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +14 -2
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +1 -0
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Materials/Node/Blocks/curveBlock.d.ts +97 -0
- package/Materials/Node/Blocks/curveBlock.js +287 -0
- package/Materials/Node/Blocks/curveBlock.js.map +1 -0
- package/Materials/Node/Blocks/index.d.ts +1 -0
- package/Materials/Node/Blocks/index.js +1 -0
- package/Materials/Node/Blocks/index.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js +5 -3
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/materialDefines.js +1 -0
- package/Materials/materialDefines.js.map +1 -1
- package/Meshes/WebGPU/webgpuDataBuffer.d.ts +1 -1
- package/Meshes/WebGPU/webgpuDataBuffer.js +2 -1
- package/Meshes/WebGPU/webgpuDataBuffer.js.map +1 -1
- package/Meshes/mesh.js +10 -8
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/transformNode.js +4 -0
- package/Meshes/transformNode.js.map +1 -1
- package/Rendering/prePassRenderer.d.ts +4 -0
- package/Rendering/prePassRenderer.js +14 -1
- package/Rendering/prePassRenderer.js.map +1 -1
- package/package.json +1 -1
- package/scene.js +13 -0
- package/scene.js.map +1 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { NodeMaterialBlock } from "../nodeMaterialBlock";
|
|
2
|
+
import type { NodeMaterialBuildState } from "../nodeMaterialBuildState";
|
|
3
|
+
import type { NodeMaterialConnectionPoint } from "../nodeMaterialBlockConnectionPoint";
|
|
4
|
+
import type { Scene } from "../../../scene";
|
|
5
|
+
/**
|
|
6
|
+
* Types of curves supported by the Curve block
|
|
7
|
+
*/
|
|
8
|
+
export declare enum CurveBlockTypes {
|
|
9
|
+
/** EaseInSine */
|
|
10
|
+
EaseInSine = 0,
|
|
11
|
+
/** EaseOutSine */
|
|
12
|
+
EaseOutSine = 1,
|
|
13
|
+
/** EaseInOutSine */
|
|
14
|
+
EaseInOutSine = 2,
|
|
15
|
+
/** EaseInQuad */
|
|
16
|
+
EaseInQuad = 3,
|
|
17
|
+
/** EaseOutQuad */
|
|
18
|
+
EaseOutQuad = 4,
|
|
19
|
+
/** EaseInOutQuad */
|
|
20
|
+
EaseInOutQuad = 5,
|
|
21
|
+
/** EaseInCubic */
|
|
22
|
+
EaseInCubic = 6,
|
|
23
|
+
/** EaseOutCubic */
|
|
24
|
+
EaseOutCubic = 7,
|
|
25
|
+
/** EaseInOutCubic */
|
|
26
|
+
EaseInOutCubic = 8,
|
|
27
|
+
/** EaseInQuart */
|
|
28
|
+
EaseInQuart = 9,
|
|
29
|
+
/** EaseOutQuart */
|
|
30
|
+
EaseOutQuart = 10,
|
|
31
|
+
/** EaseInOutQuart */
|
|
32
|
+
EaseInOutQuart = 11,
|
|
33
|
+
/** EaseInQuint */
|
|
34
|
+
EaseInQuint = 12,
|
|
35
|
+
/** EaseOutQuint */
|
|
36
|
+
EaseOutQuint = 13,
|
|
37
|
+
/** EaseInOutQuint */
|
|
38
|
+
EaseInOutQuint = 14,
|
|
39
|
+
/** EaseInExpo */
|
|
40
|
+
EaseInExpo = 15,
|
|
41
|
+
/** EaseOutExpo */
|
|
42
|
+
EaseOutExpo = 16,
|
|
43
|
+
/** EaseInOutExpo */
|
|
44
|
+
EaseInOutExpo = 17,
|
|
45
|
+
/** EaseInCirc */
|
|
46
|
+
EaseInCirc = 18,
|
|
47
|
+
/** EaseOutCirc */
|
|
48
|
+
EaseOutCirc = 19,
|
|
49
|
+
/** EaseInOutCirc */
|
|
50
|
+
EaseInOutCirc = 20,
|
|
51
|
+
/** EaseInBack */
|
|
52
|
+
EaseInBack = 21,
|
|
53
|
+
/** EaseOutBack */
|
|
54
|
+
EaseOutBack = 22,
|
|
55
|
+
/** EaseInOutBack */
|
|
56
|
+
EaseInOutBack = 23,
|
|
57
|
+
/** EaseInElastic */
|
|
58
|
+
EaseInElastic = 24,
|
|
59
|
+
/** EaseOutElastic */
|
|
60
|
+
EaseOutElastic = 25,
|
|
61
|
+
/** EaseInOutElastic */
|
|
62
|
+
EaseInOutElastic = 26
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Block used to apply curve operation
|
|
66
|
+
*/
|
|
67
|
+
export declare class CurveBlock extends NodeMaterialBlock {
|
|
68
|
+
/**
|
|
69
|
+
* Gets or sets the type of the curve applied by the block
|
|
70
|
+
*/
|
|
71
|
+
type: CurveBlockTypes;
|
|
72
|
+
/**
|
|
73
|
+
* Creates a new CurveBlock
|
|
74
|
+
* @param name defines the block name
|
|
75
|
+
*/
|
|
76
|
+
constructor(name: string);
|
|
77
|
+
/**
|
|
78
|
+
* Gets the current class name
|
|
79
|
+
* @returns the class name
|
|
80
|
+
*/
|
|
81
|
+
getClassName(): string;
|
|
82
|
+
/**
|
|
83
|
+
* Gets the input component
|
|
84
|
+
*/
|
|
85
|
+
get input(): NodeMaterialConnectionPoint;
|
|
86
|
+
/**
|
|
87
|
+
* Gets the output component
|
|
88
|
+
*/
|
|
89
|
+
get output(): NodeMaterialConnectionPoint;
|
|
90
|
+
private _duplicateEntry;
|
|
91
|
+
private _duplicateEntryDirect;
|
|
92
|
+
private _duplicateVector;
|
|
93
|
+
protected _buildBlock(state: NodeMaterialBuildState): this;
|
|
94
|
+
serialize(): any;
|
|
95
|
+
_deserialize(serializationObject: any, scene: Scene, rootUrl: string): void;
|
|
96
|
+
protected _dumpPropertiesCode(): string;
|
|
97
|
+
}
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { NodeMaterialBlock } from "../nodeMaterialBlock.js";
|
|
2
|
+
import { NodeMaterialBlockConnectionPointTypes } from "../Enums/nodeMaterialBlockConnectionPointTypes.js";
|
|
3
|
+
import { NodeMaterialBlockTargets } from "../Enums/nodeMaterialBlockTargets.js";
|
|
4
|
+
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
5
|
+
/**
|
|
6
|
+
* Types of curves supported by the Curve block
|
|
7
|
+
*/
|
|
8
|
+
export var CurveBlockTypes;
|
|
9
|
+
(function (CurveBlockTypes) {
|
|
10
|
+
/** EaseInSine */
|
|
11
|
+
CurveBlockTypes[CurveBlockTypes["EaseInSine"] = 0] = "EaseInSine";
|
|
12
|
+
/** EaseOutSine */
|
|
13
|
+
CurveBlockTypes[CurveBlockTypes["EaseOutSine"] = 1] = "EaseOutSine";
|
|
14
|
+
/** EaseInOutSine */
|
|
15
|
+
CurveBlockTypes[CurveBlockTypes["EaseInOutSine"] = 2] = "EaseInOutSine";
|
|
16
|
+
/** EaseInQuad */
|
|
17
|
+
CurveBlockTypes[CurveBlockTypes["EaseInQuad"] = 3] = "EaseInQuad";
|
|
18
|
+
/** EaseOutQuad */
|
|
19
|
+
CurveBlockTypes[CurveBlockTypes["EaseOutQuad"] = 4] = "EaseOutQuad";
|
|
20
|
+
/** EaseInOutQuad */
|
|
21
|
+
CurveBlockTypes[CurveBlockTypes["EaseInOutQuad"] = 5] = "EaseInOutQuad";
|
|
22
|
+
/** EaseInCubic */
|
|
23
|
+
CurveBlockTypes[CurveBlockTypes["EaseInCubic"] = 6] = "EaseInCubic";
|
|
24
|
+
/** EaseOutCubic */
|
|
25
|
+
CurveBlockTypes[CurveBlockTypes["EaseOutCubic"] = 7] = "EaseOutCubic";
|
|
26
|
+
/** EaseInOutCubic */
|
|
27
|
+
CurveBlockTypes[CurveBlockTypes["EaseInOutCubic"] = 8] = "EaseInOutCubic";
|
|
28
|
+
/** EaseInQuart */
|
|
29
|
+
CurveBlockTypes[CurveBlockTypes["EaseInQuart"] = 9] = "EaseInQuart";
|
|
30
|
+
/** EaseOutQuart */
|
|
31
|
+
CurveBlockTypes[CurveBlockTypes["EaseOutQuart"] = 10] = "EaseOutQuart";
|
|
32
|
+
/** EaseInOutQuart */
|
|
33
|
+
CurveBlockTypes[CurveBlockTypes["EaseInOutQuart"] = 11] = "EaseInOutQuart";
|
|
34
|
+
/** EaseInQuint */
|
|
35
|
+
CurveBlockTypes[CurveBlockTypes["EaseInQuint"] = 12] = "EaseInQuint";
|
|
36
|
+
/** EaseOutQuint */
|
|
37
|
+
CurveBlockTypes[CurveBlockTypes["EaseOutQuint"] = 13] = "EaseOutQuint";
|
|
38
|
+
/** EaseInOutQuint */
|
|
39
|
+
CurveBlockTypes[CurveBlockTypes["EaseInOutQuint"] = 14] = "EaseInOutQuint";
|
|
40
|
+
/** EaseInExpo */
|
|
41
|
+
CurveBlockTypes[CurveBlockTypes["EaseInExpo"] = 15] = "EaseInExpo";
|
|
42
|
+
/** EaseOutExpo */
|
|
43
|
+
CurveBlockTypes[CurveBlockTypes["EaseOutExpo"] = 16] = "EaseOutExpo";
|
|
44
|
+
/** EaseInOutExpo */
|
|
45
|
+
CurveBlockTypes[CurveBlockTypes["EaseInOutExpo"] = 17] = "EaseInOutExpo";
|
|
46
|
+
/** EaseInCirc */
|
|
47
|
+
CurveBlockTypes[CurveBlockTypes["EaseInCirc"] = 18] = "EaseInCirc";
|
|
48
|
+
/** EaseOutCirc */
|
|
49
|
+
CurveBlockTypes[CurveBlockTypes["EaseOutCirc"] = 19] = "EaseOutCirc";
|
|
50
|
+
/** EaseInOutCirc */
|
|
51
|
+
CurveBlockTypes[CurveBlockTypes["EaseInOutCirc"] = 20] = "EaseInOutCirc";
|
|
52
|
+
/** EaseInBack */
|
|
53
|
+
CurveBlockTypes[CurveBlockTypes["EaseInBack"] = 21] = "EaseInBack";
|
|
54
|
+
/** EaseOutBack */
|
|
55
|
+
CurveBlockTypes[CurveBlockTypes["EaseOutBack"] = 22] = "EaseOutBack";
|
|
56
|
+
/** EaseInOutBack */
|
|
57
|
+
CurveBlockTypes[CurveBlockTypes["EaseInOutBack"] = 23] = "EaseInOutBack";
|
|
58
|
+
/** EaseInElastic */
|
|
59
|
+
CurveBlockTypes[CurveBlockTypes["EaseInElastic"] = 24] = "EaseInElastic";
|
|
60
|
+
/** EaseOutElastic */
|
|
61
|
+
CurveBlockTypes[CurveBlockTypes["EaseOutElastic"] = 25] = "EaseOutElastic";
|
|
62
|
+
/** EaseInOutElastic */
|
|
63
|
+
CurveBlockTypes[CurveBlockTypes["EaseInOutElastic"] = 26] = "EaseInOutElastic";
|
|
64
|
+
})(CurveBlockTypes || (CurveBlockTypes = {}));
|
|
65
|
+
/**
|
|
66
|
+
* Block used to apply curve operation
|
|
67
|
+
*/
|
|
68
|
+
export class CurveBlock extends NodeMaterialBlock {
|
|
69
|
+
/**
|
|
70
|
+
* Creates a new CurveBlock
|
|
71
|
+
* @param name defines the block name
|
|
72
|
+
*/
|
|
73
|
+
constructor(name) {
|
|
74
|
+
super(name, NodeMaterialBlockTargets.Neutral);
|
|
75
|
+
/**
|
|
76
|
+
* Gets or sets the type of the curve applied by the block
|
|
77
|
+
*/
|
|
78
|
+
this.type = CurveBlockTypes.EaseInOutSine;
|
|
79
|
+
this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect);
|
|
80
|
+
this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
|
|
81
|
+
this._outputs[0]._typeConnectionSource = this._inputs[0];
|
|
82
|
+
this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);
|
|
83
|
+
this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Object);
|
|
84
|
+
this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Int);
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Gets the current class name
|
|
88
|
+
* @returns the class name
|
|
89
|
+
*/
|
|
90
|
+
getClassName() {
|
|
91
|
+
return "CurveBlock";
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Gets the input component
|
|
95
|
+
*/
|
|
96
|
+
get input() {
|
|
97
|
+
return this._inputs[0];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Gets the output component
|
|
101
|
+
*/
|
|
102
|
+
get output() {
|
|
103
|
+
return this._outputs[0];
|
|
104
|
+
}
|
|
105
|
+
_duplicateEntry(entry, component) {
|
|
106
|
+
return `ret.${component} = ${entry.replace(/VAL/g, "v." + component)}`;
|
|
107
|
+
}
|
|
108
|
+
_duplicateEntryDirect(entry) {
|
|
109
|
+
return `return ${entry.replace(/VAL/g, "v")}`;
|
|
110
|
+
}
|
|
111
|
+
_duplicateVector(entry, inputType) {
|
|
112
|
+
if (inputType === "float") {
|
|
113
|
+
return this._duplicateEntryDirect(entry);
|
|
114
|
+
}
|
|
115
|
+
const size = parseInt(inputType.replace("vec", ""));
|
|
116
|
+
let code = `
|
|
117
|
+
vec${size} ret = vec${size}(0.0);
|
|
118
|
+
`;
|
|
119
|
+
for (let i = 1; i <= size; i++) {
|
|
120
|
+
code += this._duplicateEntry(entry, i === 1 ? "x" : i === 2 ? "y" : i === 3 ? "z" : "w") + ";\r\n";
|
|
121
|
+
}
|
|
122
|
+
code += "return ret;\r\n";
|
|
123
|
+
return code;
|
|
124
|
+
}
|
|
125
|
+
_buildBlock(state) {
|
|
126
|
+
super._buildBlock(state);
|
|
127
|
+
const output = this._outputs[0];
|
|
128
|
+
let registeredFunction = "";
|
|
129
|
+
let registeredFunctionName = "";
|
|
130
|
+
let inputType = "";
|
|
131
|
+
switch (this.input.type) {
|
|
132
|
+
case NodeMaterialBlockConnectionPointTypes.Float:
|
|
133
|
+
inputType = "float";
|
|
134
|
+
break;
|
|
135
|
+
case NodeMaterialBlockConnectionPointTypes.Vector2:
|
|
136
|
+
inputType = "vec2";
|
|
137
|
+
break;
|
|
138
|
+
case NodeMaterialBlockConnectionPointTypes.Vector3:
|
|
139
|
+
case NodeMaterialBlockConnectionPointTypes.Color3:
|
|
140
|
+
inputType = "vec3";
|
|
141
|
+
break;
|
|
142
|
+
case NodeMaterialBlockConnectionPointTypes.Vector4:
|
|
143
|
+
case NodeMaterialBlockConnectionPointTypes.Color4:
|
|
144
|
+
inputType = "vec4";
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
registeredFunctionName = CurveBlockTypes[this.type] + "_" + inputType;
|
|
148
|
+
switch (this.type) {
|
|
149
|
+
case CurveBlockTypes.EaseInSine:
|
|
150
|
+
registeredFunction = `return 1.0 - cos((v * 3.1415) / 2.0)`;
|
|
151
|
+
break;
|
|
152
|
+
case CurveBlockTypes.EaseOutSine:
|
|
153
|
+
registeredFunction = `return sin((v * 3.1415) / 2.0)`;
|
|
154
|
+
break;
|
|
155
|
+
case CurveBlockTypes.EaseInOutSine:
|
|
156
|
+
registeredFunction = `return -(cos(v * 3.1415) - 1.0) / 2.0`;
|
|
157
|
+
break;
|
|
158
|
+
case CurveBlockTypes.EaseInQuad:
|
|
159
|
+
registeredFunction = `return v * v`;
|
|
160
|
+
break;
|
|
161
|
+
case CurveBlockTypes.EaseOutQuad:
|
|
162
|
+
registeredFunction = `return (1.0 - v) * (1.0 - v)`;
|
|
163
|
+
break;
|
|
164
|
+
case CurveBlockTypes.EaseInOutQuad: {
|
|
165
|
+
const entry = "VAL < 0.5 ? 2.0 * VAL * VAL : 1.0 - pow(-2.0 * VAL + 2.0, 2.0) / 2.0";
|
|
166
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
167
|
+
break;
|
|
168
|
+
}
|
|
169
|
+
case CurveBlockTypes.EaseInCubic:
|
|
170
|
+
registeredFunction = `return v * v * v`;
|
|
171
|
+
break;
|
|
172
|
+
case CurveBlockTypes.EaseOutCubic: {
|
|
173
|
+
const entry = "1.0 - pow(1.0 - VAL, 3.0)";
|
|
174
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
case CurveBlockTypes.EaseInOutCubic: {
|
|
178
|
+
const entry = "VAL < 0.5 ? 4.0 * VAL * VAL * VAL : 1.0 - pow(-2.0 * VAL + 2.0, 3.0) / 2.0";
|
|
179
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
case CurveBlockTypes.EaseInQuart:
|
|
183
|
+
registeredFunction = `return v * v * v * v`;
|
|
184
|
+
break;
|
|
185
|
+
case CurveBlockTypes.EaseOutQuart: {
|
|
186
|
+
const entry = "1.0 - pow(1.0 - VAL, 4.0)";
|
|
187
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
case CurveBlockTypes.EaseInOutQuart: {
|
|
191
|
+
const entry = "VAL < 0.5 ? 8.0 * VAL * VAL * VAL * VAL : 1.0 - pow(-2.0 * VAL + 2.0, 4.0) / 2.0";
|
|
192
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
case CurveBlockTypes.EaseInQuint:
|
|
196
|
+
registeredFunction = `return v * v * v * v * v`;
|
|
197
|
+
break;
|
|
198
|
+
case CurveBlockTypes.EaseOutQuint: {
|
|
199
|
+
const entry = "1.0 - pow(1.0 - VAL, 5.0)";
|
|
200
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
201
|
+
break;
|
|
202
|
+
}
|
|
203
|
+
case CurveBlockTypes.EaseInOutQuint: {
|
|
204
|
+
const entry = "VAL < 0.5 ? 16.0 * VAL * VAL * VAL * VAL * VAL : 1.0 - pow(-2.0 * VAL + 2.0, 5.0) / 2.0";
|
|
205
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
208
|
+
case CurveBlockTypes.EaseInExpo: {
|
|
209
|
+
const entry = "VAL == 0.0 ? 0.0 : pow(2.0, 10.0 * VAL - 10.0)";
|
|
210
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
211
|
+
break;
|
|
212
|
+
}
|
|
213
|
+
case CurveBlockTypes.EaseOutExpo: {
|
|
214
|
+
const entry = "VAL == 1.0 ? 1.0 : 1.0 - pow(2.0, -10.0 * VAL)";
|
|
215
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
216
|
+
break;
|
|
217
|
+
}
|
|
218
|
+
case CurveBlockTypes.EaseInOutExpo: {
|
|
219
|
+
const entry = "VAL == 0.0 ? 0.0 : VAL == 1.0 ? 1.0 : VAL < 0.5 ? pow(2.0, 20.0 * VAL - 10.0) / 2.0 : (2.0 - pow(2.0, -20.0 * VAL + 10.0)) / 2.0";
|
|
220
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
case CurveBlockTypes.EaseInCirc: {
|
|
224
|
+
const entry = "1.0 - sqrt(1.0 - pow(VAL, 2.0))";
|
|
225
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
case CurveBlockTypes.EaseOutCirc: {
|
|
229
|
+
const entry = "sqrt(1.0 - pow(VAL - 1.0, 2.0))";
|
|
230
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
case CurveBlockTypes.EaseInOutCirc: {
|
|
234
|
+
const entry = "VAL < 0.5 ? (1.0 - sqrt(1.0 - pow(2.0 * VAL, 2.0))) / 2.0 : (sqrt(1.0 - pow(-2.0 * VAL + 2.0, 2.0)) + 1.0) / 2.0";
|
|
235
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
236
|
+
break;
|
|
237
|
+
}
|
|
238
|
+
case CurveBlockTypes.EaseInBack: {
|
|
239
|
+
registeredFunction = "return 2.70158 * v * v * v - 1.70158 * v * v";
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
case CurveBlockTypes.EaseOutBack: {
|
|
243
|
+
const entry = "2.70158 * pow(VAL - 1.0, 3.0) + 1.70158 * pow(VAL - 1.0, 2.0)";
|
|
244
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
case CurveBlockTypes.EaseInOutBack: {
|
|
248
|
+
const entry = "VAL < 0.5 ? (pow(2.0 * VAL, 2.0) * ((3.5949095) * 2.0 * VAL - 2.5949095)) / 2.0 : (pow(2.0 * VAL - 2.0, 2.0) * (3.5949095 * (VAL * 2.0 - 2.0) + 3.5949095) + 2.0) / 2.0";
|
|
249
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
case CurveBlockTypes.EaseInElastic: {
|
|
253
|
+
const entry = "VAL == 0.0 ? 0.0 : VAL == 1.0 ? 1.0 : -pow(2.0, 10.0 * VAL - 10.0) * sin((VAL * 10.0 - 10.75) * ((2.0 * 3.1415) / 3.0))";
|
|
254
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
case CurveBlockTypes.EaseOutElastic: {
|
|
258
|
+
const entry = "VAL == 0.0 ? 0.0 : VAL == 1.0 ? 1.0 : pow(2.0, -10.0 * VAL) * sin((VAL * 10.0 - 0.75) * ((2.0 * 3.1415) / 3.0)) + 1.0";
|
|
259
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
case CurveBlockTypes.EaseInOutElastic: {
|
|
263
|
+
const entry = "VAL == 0.0 ? 0.0 : VAL == 1.0 ? 1.0 : VAL < 0.5 ? -(pow(2.0, 20.0 * VAL - 10.0) * sin((20.0 * VAL - 11.125) * ((2.0 * 3.1415) / 4.5))) / 2.0 : (pow(2.0, -20.0 * VAL + 10.0) * sin((20.0 * VAL - 11.125) * ((2.0 * 3.1415) / 4.5))) / 2.0 + 1.0";
|
|
264
|
+
registeredFunction = this._duplicateVector(entry, inputType);
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
state._emitFunction(registeredFunctionName, `${inputType} ${registeredFunctionName}(${inputType} v) {${registeredFunction};}\r\n`, "");
|
|
269
|
+
state.compilationString += this._declareOutput(output, state) + ` = ${registeredFunctionName}(${this.input.associatedVariableName});\r\n`;
|
|
270
|
+
return this;
|
|
271
|
+
}
|
|
272
|
+
serialize() {
|
|
273
|
+
const serializationObject = super.serialize();
|
|
274
|
+
serializationObject.curveType = this.type;
|
|
275
|
+
return serializationObject;
|
|
276
|
+
}
|
|
277
|
+
_deserialize(serializationObject, scene, rootUrl) {
|
|
278
|
+
super._deserialize(serializationObject, scene, rootUrl);
|
|
279
|
+
this.type = serializationObject.curveType;
|
|
280
|
+
}
|
|
281
|
+
_dumpPropertiesCode() {
|
|
282
|
+
const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.type = BABYLON.CurveBlockTypes.${CurveBlockTypes[this.type]};\r\n`;
|
|
283
|
+
return codeString;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
RegisterClass("BABYLON.CurveBlock", CurveBlock);
|
|
287
|
+
//# sourceMappingURL=curveBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curveBlock.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/Node/Blocks/curveBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD;;GAEG;AACH,MAAM,CAAN,IAAY,eAuDX;AAvDD,WAAY,eAAe;IACvB,iBAAiB;IACjB,iEAAU,CAAA;IACV,kBAAkB;IAClB,mEAAW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ourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport type { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport type { Scene } from \"../../../scene\";\r\n\r\n/**\r\n * Types of curves supported by the Curve block\r\n */\r\nexport enum CurveBlockTypes {\r\n /** EaseInSine */\r\n EaseInSine,\r\n /** EaseOutSine */\r\n EaseOutSine,\r\n /** EaseInOutSine */\r\n EaseInOutSine,\r\n /** EaseInQuad */\r\n EaseInQuad,\r\n /** EaseOutQuad */\r\n EaseOutQuad,\r\n /** EaseInOutQuad */\r\n EaseInOutQuad,\r\n /** EaseInCubic */\r\n EaseInCubic,\r\n /** EaseOutCubic */\r\n EaseOutCubic,\r\n /** EaseInOutCubic */\r\n EaseInOutCubic,\r\n /** EaseInQuart */\r\n EaseInQuart,\r\n /** EaseOutQuart */\r\n EaseOutQuart,\r\n /** EaseInOutQuart */\r\n EaseInOutQuart,\r\n /** EaseInQuint */\r\n EaseInQuint,\r\n /** EaseOutQuint */\r\n EaseOutQuint,\r\n /** EaseInOutQuint */\r\n EaseInOutQuint,\r\n /** EaseInExpo */\r\n EaseInExpo,\r\n /** EaseOutExpo */\r\n EaseOutExpo,\r\n /** EaseInOutExpo */\r\n EaseInOutExpo,\r\n /** EaseInCirc */\r\n EaseInCirc,\r\n /** EaseOutCirc */\r\n EaseOutCirc,\r\n /** EaseInOutCirc */\r\n EaseInOutCirc,\r\n /** EaseInBack */\r\n EaseInBack,\r\n /** EaseOutBack */\r\n EaseOutBack,\r\n /** EaseInOutBack */\r\n EaseInOutBack,\r\n /** EaseInElastic */\r\n EaseInElastic,\r\n /** EaseOutElastic */\r\n EaseOutElastic,\r\n /** EaseInOutElastic */\r\n EaseInOutElastic,\r\n}\r\n\r\n/**\r\n * Block used to apply curve operation\r\n */\r\nexport class CurveBlock extends NodeMaterialBlock {\r\n /**\r\n * Gets or sets the type of the curve applied by the block\r\n */\r\n public type = CurveBlockTypes.EaseInOutSine;\r\n\r\n /**\r\n * Creates a new CurveBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\"input\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Object);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Int);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"CurveBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n private _duplicateEntry(entry: string, component: string) {\r\n return `ret.${component} = ${entry.replace(/VAL/g, \"v.\" + component)}`;\r\n }\r\n\r\n private _duplicateEntryDirect(entry: string) {\r\n return `return ${entry.replace(/VAL/g, \"v\")}`;\r\n }\r\n\r\n private _duplicateVector(entry: string, inputType: string) {\r\n if (inputType === \"float\") {\r\n return this._duplicateEntryDirect(entry);\r\n }\r\n\r\n const size = parseInt(inputType.replace(\"vec\", \"\"));\r\n let code = `\r\n vec${size} ret = vec${size}(0.0);\r\n `;\r\n\r\n for (let i = 1; i <= size; i++) {\r\n code += this._duplicateEntry(entry, i === 1 ? \"x\" : i === 2 ? \"y\" : i === 3 ? \"z\" : \"w\") + \";\\r\\n\";\r\n }\r\n\r\n code += \"return ret;\\r\\n\";\r\n return code;\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const output = this._outputs[0];\r\n let registeredFunction = \"\";\r\n let registeredFunctionName = \"\";\r\n\r\n let inputType = \"\";\r\n\r\n switch (this.input.type) {\r\n case NodeMaterialBlockConnectionPointTypes.Float:\r\n inputType = \"float\";\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector2:\r\n inputType = \"vec2\";\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector3:\r\n case NodeMaterialBlockConnectionPointTypes.Color3:\r\n inputType = \"vec3\";\r\n break;\r\n case NodeMaterialBlockConnectionPointTypes.Vector4:\r\n case NodeMaterialBlockConnectionPointTypes.Color4:\r\n inputType = \"vec4\";\r\n break;\r\n }\r\n\r\n registeredFunctionName = CurveBlockTypes[this.type] + \"_\" + inputType;\r\n\r\n switch (this.type) {\r\n case CurveBlockTypes.EaseInSine:\r\n registeredFunction = `return 1.0 - cos((v * 3.1415) / 2.0)`;\r\n break;\r\n case CurveBlockTypes.EaseOutSine:\r\n registeredFunction = `return sin((v * 3.1415) / 2.0)`;\r\n break;\r\n case CurveBlockTypes.EaseInOutSine:\r\n registeredFunction = `return -(cos(v * 3.1415) - 1.0) / 2.0`;\r\n break;\r\n case CurveBlockTypes.EaseInQuad:\r\n registeredFunction = `return v * v`;\r\n break;\r\n case CurveBlockTypes.EaseOutQuad:\r\n registeredFunction = `return (1.0 - v) * (1.0 - v)`;\r\n break;\r\n case CurveBlockTypes.EaseInOutQuad: {\r\n const entry = \"VAL < 0.5 ? 2.0 * VAL * VAL : 1.0 - pow(-2.0 * VAL + 2.0, 2.0) / 2.0\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseInCubic:\r\n registeredFunction = `return v * v * v`;\r\n break;\r\n case CurveBlockTypes.EaseOutCubic: {\r\n const entry = \"1.0 - pow(1.0 - VAL, 3.0)\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseInOutCubic: {\r\n const entry = \"VAL < 0.5 ? 4.0 * VAL * VAL * VAL : 1.0 - pow(-2.0 * VAL + 2.0, 3.0) / 2.0\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseInQuart:\r\n registeredFunction = `return v * v * v * v`;\r\n break;\r\n case CurveBlockTypes.EaseOutQuart: {\r\n const entry = \"1.0 - pow(1.0 - VAL, 4.0)\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseInOutQuart: {\r\n const entry = \"VAL < 0.5 ? 8.0 * VAL * VAL * VAL * VAL : 1.0 - pow(-2.0 * VAL + 2.0, 4.0) / 2.0\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseInQuint:\r\n registeredFunction = `return v * v * v * v * v`;\r\n break;\r\n case CurveBlockTypes.EaseOutQuint: {\r\n const entry = \"1.0 - pow(1.0 - VAL, 5.0)\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseInOutQuint: {\r\n const entry = \"VAL < 0.5 ? 16.0 * VAL * VAL * VAL * VAL * VAL : 1.0 - pow(-2.0 * VAL + 2.0, 5.0) / 2.0\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseInExpo: {\r\n const entry = \"VAL == 0.0 ? 0.0 : pow(2.0, 10.0 * VAL - 10.0)\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseOutExpo: {\r\n const entry = \"VAL == 1.0 ? 1.0 : 1.0 - pow(2.0, -10.0 * VAL)\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseInOutExpo: {\r\n const entry = \"VAL == 0.0 ? 0.0 : VAL == 1.0 ? 1.0 : VAL < 0.5 ? pow(2.0, 20.0 * VAL - 10.0) / 2.0 : (2.0 - pow(2.0, -20.0 * VAL + 10.0)) / 2.0\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseInCirc: {\r\n const entry = \"1.0 - sqrt(1.0 - pow(VAL, 2.0))\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseOutCirc: {\r\n const entry = \"sqrt(1.0 - pow(VAL - 1.0, 2.0))\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseInOutCirc: {\r\n const entry = \"VAL < 0.5 ? (1.0 - sqrt(1.0 - pow(2.0 * VAL, 2.0))) / 2.0 : (sqrt(1.0 - pow(-2.0 * VAL + 2.0, 2.0)) + 1.0) / 2.0\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseInBack: {\r\n registeredFunction = \"return 2.70158 * v * v * v - 1.70158 * v * v\";\r\n break;\r\n }\r\n case CurveBlockTypes.EaseOutBack: {\r\n const entry = \"2.70158 * pow(VAL - 1.0, 3.0) + 1.70158 * pow(VAL - 1.0, 2.0)\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseInOutBack: {\r\n const entry =\r\n \"VAL < 0.5 ? (pow(2.0 * VAL, 2.0) * ((3.5949095) * 2.0 * VAL - 2.5949095)) / 2.0 : (pow(2.0 * VAL - 2.0, 2.0) * (3.5949095 * (VAL * 2.0 - 2.0) + 3.5949095) + 2.0) / 2.0\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseInElastic: {\r\n const entry = \"VAL == 0.0 ? 0.0 : VAL == 1.0 ? 1.0 : -pow(2.0, 10.0 * VAL - 10.0) * sin((VAL * 10.0 - 10.75) * ((2.0 * 3.1415) / 3.0))\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseOutElastic: {\r\n const entry = \"VAL == 0.0 ? 0.0 : VAL == 1.0 ? 1.0 : pow(2.0, -10.0 * VAL) * sin((VAL * 10.0 - 0.75) * ((2.0 * 3.1415) / 3.0)) + 1.0\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n case CurveBlockTypes.EaseInOutElastic: {\r\n const entry =\r\n \"VAL == 0.0 ? 0.0 : VAL == 1.0 ? 1.0 : VAL < 0.5 ? -(pow(2.0, 20.0 * VAL - 10.0) * sin((20.0 * VAL - 11.125) * ((2.0 * 3.1415) / 4.5))) / 2.0 : (pow(2.0, -20.0 * VAL + 10.0) * sin((20.0 * VAL - 11.125) * ((2.0 * 3.1415) / 4.5))) / 2.0 + 1.0\";\r\n registeredFunction = this._duplicateVector(entry, inputType);\r\n break;\r\n }\r\n }\r\n\r\n state._emitFunction(registeredFunctionName, `${inputType} ${registeredFunctionName}(${inputType} v) {${registeredFunction};}\\r\\n`, \"\");\r\n\r\n state.compilationString += this._declareOutput(output, state) + ` = ${registeredFunctionName}(${this.input.associatedVariableName});\\r\\n`;\r\n\r\n return this;\r\n }\r\n\r\n public serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.curveType = this.type;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any, scene: Scene, rootUrl: string) {\r\n super._deserialize(serializationObject, scene, rootUrl);\r\n\r\n this.type = serializationObject.curveType;\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n const codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.type = BABYLON.CurveBlockTypes.${CurveBlockTypes[this.type]};\\r\\n`;\r\n return codeString;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.CurveBlock\", CurveBlock);\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/Node/Blocks/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./Vertex/index\";\r\nexport * from \"./Fragment/index\";\r\nexport * from \"./Dual/index\";\r\nexport * from \"./Input/index\";\r\nexport * from \"./multiplyBlock\";\r\nexport * from \"./addBlock\";\r\nexport * from \"./scaleBlock\";\r\nexport * from \"./clampBlock\";\r\nexport * from \"./crossBlock\";\r\nexport * from \"./customBlock\";\r\nexport * from \"./dotBlock\";\r\nexport * from \"./transformBlock\";\r\nexport * from \"./remapBlock\";\r\nexport * from \"./normalizeBlock\";\r\nexport * from \"./trigonometryBlock\";\r\nexport * from \"./colorMergerBlock\";\r\nexport * from \"./vectorMergerBlock\";\r\nexport * from \"./colorSplitterBlock\";\r\nexport * from \"./vectorSplitterBlock\";\r\nexport * from \"./lerpBlock\";\r\nexport * from \"./divideBlock\";\r\nexport * from \"./subtractBlock\";\r\nexport * from \"./stepBlock\";\r\nexport * from \"./oneMinusBlock\";\r\nexport * from \"./viewDirectionBlock\";\r\nexport * from \"./fresnelBlock\";\r\nexport * from \"./maxBlock\";\r\nexport * from \"./minBlock\";\r\nexport * from \"./distanceBlock\";\r\nexport * from \"./lengthBlock\";\r\nexport * from \"./negateBlock\";\r\nexport * from \"./powBlock\";\r\nexport * from \"./randomNumberBlock\";\r\nexport * from \"./arcTan2Block\";\r\nexport * from \"./smoothStepBlock\";\r\nexport * from \"./reciprocalBlock\";\r\nexport * from \"./replaceColorBlock\";\r\nexport * from \"./posterizeBlock\";\r\nexport * from \"./waveBlock\";\r\nexport * from \"./gradientBlock\";\r\nexport * from \"./nLerpBlock\";\r\nexport * from \"./worleyNoise3DBlock\";\r\nexport * from \"./simplexPerlin3DBlock\";\r\nexport * from \"./normalBlendBlock\";\r\nexport * from \"./rotate2dBlock\";\r\nexport * from \"./reflectBlock\";\r\nexport * from \"./refractBlock\";\r\nexport * from \"./desaturateBlock\";\r\nexport * from \"./PBR/index\";\r\nexport * from \"./Particle/index\";\r\nexport * from \"./modBlock\";\r\nexport * from \"./matrixBuilderBlock\";\r\nexport * from \"./conditionalBlock\";\r\nexport * from \"./cloudBlock\";\r\nexport * from \"./voronoiNoiseBlock\";\r\nexport * from \"./elbowBlock\";\r\nexport * from \"./triPlanarBlock\";\r\nexport * from \"./biPlanarBlock\";\r\nexport * from \"./matrixDeterminantBlock\";\r\nexport * from \"./matrixTransposeBlock\";\r\nexport * from \"./meshAttributeExistsBlock\";\r\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../lts/core/generated/Materials/Node/Blocks/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,e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kB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC","sourcesContent":["/* eslint-disable import/no-internal-modules */\r\nexport * from \"./Vertex/index\";\r\nexport * from \"./Fragment/index\";\r\nexport * from \"./Dual/index\";\r\nexport * from \"./Input/index\";\r\nexport * from \"./multiplyBlock\";\r\nexport * from \"./addBlock\";\r\nexport * from \"./scaleBlock\";\r\nexport * from \"./clampBlock\";\r\nexport * from \"./crossBlock\";\r\nexport * from \"./customBlock\";\r\nexport * from \"./dotBlock\";\r\nexport * from \"./transformBlock\";\r\nexport * from \"./remapBlock\";\r\nexport * from \"./normalizeBlock\";\r\nexport * from \"./trigonometryBlock\";\r\nexport * from \"./colorMergerBlock\";\r\nexport * from \"./vectorMergerBlock\";\r\nexport * from \"./colorSplitterBlock\";\r\nexport * from \"./vectorSplitterBlock\";\r\nexport * from \"./lerpBlock\";\r\nexport * from \"./divideBlock\";\r\nexport * from \"./subtractBlock\";\r\nexport * from \"./stepBlock\";\r\nexport * from \"./oneMinusBlock\";\r\nexport * from \"./viewDirectionBlock\";\r\nexport * from \"./fresnelBlock\";\r\nexport * from \"./maxBlock\";\r\nexport * from \"./minBlock\";\r\nexport * from \"./distanceBlock\";\r\nexport * from \"./lengthBlock\";\r\nexport * from \"./negateBlock\";\r\nexport * from \"./powBlock\";\r\nexport * from \"./randomNumberBlock\";\r\nexport * from \"./arcTan2Block\";\r\nexport * from \"./smoothStepBlock\";\r\nexport * from \"./reciprocalBlock\";\r\nexport * from \"./replaceColorBlock\";\r\nexport * from \"./posterizeBlock\";\r\nexport * from \"./waveBlock\";\r\nexport * from \"./gradientBlock\";\r\nexport * from \"./nLerpBlock\";\r\nexport * from \"./worleyNoise3DBlock\";\r\nexport * from \"./simplexPerlin3DBlock\";\r\nexport * from \"./normalBlendBlock\";\r\nexport * from \"./rotate2dBlock\";\r\nexport * from \"./reflectBlock\";\r\nexport * from \"./refractBlock\";\r\nexport * from \"./desaturateBlock\";\r\nexport * from \"./PBR/index\";\r\nexport * from \"./Particle/index\";\r\nexport * from \"./modBlock\";\r\nexport * from \"./matrixBuilderBlock\";\r\nexport * from \"./conditionalBlock\";\r\nexport * from \"./cloudBlock\";\r\nexport * from \"./voronoiNoiseBlock\";\r\nexport * from \"./elbowBlock\";\r\nexport * from \"./triPlanarBlock\";\r\nexport * from \"./biPlanarBlock\";\r\nexport * from \"./matrixDeterminantBlock\";\r\nexport * from \"./matrixTransposeBlock\";\r\nexport * from \"./meshAttributeExistsBlock\";\r\nexport * from \"./curveBlock\";\r\n"]}
|
|
@@ -339,7 +339,7 @@ export class RenderTargetTexture extends Texture {
|
|
|
339
339
|
this._renderPassIds[i] = engine.createRenderPassId(`RenderTargetTexture - ${this.name}#${i}`);
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
_processSizeParameter(size) {
|
|
342
|
+
_processSizeParameter(size, createRenderPassIds = true) {
|
|
343
343
|
if (size.ratio) {
|
|
344
344
|
this._sizeRatio = size.ratio;
|
|
345
345
|
const engine = this._getEngine();
|
|
@@ -351,7 +351,9 @@ export class RenderTargetTexture extends Texture {
|
|
|
351
351
|
else {
|
|
352
352
|
this._size = size;
|
|
353
353
|
}
|
|
354
|
-
|
|
354
|
+
if (createRenderPassIds) {
|
|
355
|
+
this._createRenderPassId();
|
|
356
|
+
}
|
|
355
357
|
}
|
|
356
358
|
/**
|
|
357
359
|
* Define the number of samples to use in case of MSAA.
|
|
@@ -531,7 +533,7 @@ export class RenderTargetTexture extends Texture {
|
|
|
531
533
|
if (!scene) {
|
|
532
534
|
return;
|
|
533
535
|
}
|
|
534
|
-
this._processSizeParameter(size);
|
|
536
|
+
this._processSizeParameter(size, false);
|
|
535
537
|
if (wasCube) {
|
|
536
538
|
this._renderTarget = scene.getEngine().createRenderTargetCubeTexture(this.getRenderSize(), this._renderTargetOptions);
|
|
537
539
|
}
|