@luma.gl/engine 9.0.8 → 9.0.10
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/dist.dev.js +26 -13
- package/dist/dist.min.js +6 -6
- package/dist/index.cjs +26 -13
- package/dist/index.cjs.map +2 -2
- package/dist/model/model.d.ts +17 -9
- package/dist/model/model.d.ts.map +1 -1
- package/dist/model/model.js +29 -13
- package/package.json +3 -3
- package/src/model/model.ts +38 -17
package/dist/dist.dev.js
CHANGED
|
@@ -6992,10 +6992,12 @@ void main() {
|
|
|
6992
6992
|
/** Buffer layout */
|
|
6993
6993
|
bufferLayout;
|
|
6994
6994
|
// Dynamic properties
|
|
6995
|
+
/** Use instanced rendering */
|
|
6996
|
+
isInstanced = void 0;
|
|
6997
|
+
/** instance count. `undefined` means not instanced */
|
|
6998
|
+
instanceCount = 0;
|
|
6995
6999
|
/** Vertex count */
|
|
6996
7000
|
vertexCount;
|
|
6997
|
-
/** instance count */
|
|
6998
|
-
instanceCount = 0;
|
|
6999
7001
|
/** Index buffer */
|
|
7000
7002
|
indexBuffer = null;
|
|
7001
7003
|
/** Buffer-valued attributes */
|
|
@@ -7077,12 +7079,15 @@ void main() {
|
|
|
7077
7079
|
if (this._gpuGeometry) {
|
|
7078
7080
|
this._setGeometryAttributes(this._gpuGeometry);
|
|
7079
7081
|
}
|
|
7080
|
-
if (props.
|
|
7081
|
-
this.
|
|
7082
|
+
if (props.isInstanced) {
|
|
7083
|
+
this.isInstanced = props.isInstanced;
|
|
7082
7084
|
}
|
|
7083
7085
|
if (props.instanceCount) {
|
|
7084
7086
|
this.setInstanceCount(props.instanceCount);
|
|
7085
7087
|
}
|
|
7088
|
+
if (props.vertexCount) {
|
|
7089
|
+
this.setVertexCount(props.vertexCount);
|
|
7090
|
+
}
|
|
7086
7091
|
if (props.indexBuffer) {
|
|
7087
7092
|
this.setIndexBuffer(props.indexBuffer);
|
|
7088
7093
|
}
|
|
@@ -7151,6 +7156,7 @@ void main() {
|
|
|
7151
7156
|
drawSuccess = this.pipeline.draw({
|
|
7152
7157
|
renderPass,
|
|
7153
7158
|
vertexArray: this.vertexArray,
|
|
7159
|
+
isInstanced: this.isInstanced,
|
|
7154
7160
|
vertexCount: this.vertexCount,
|
|
7155
7161
|
instanceCount: this.instanceCount,
|
|
7156
7162
|
indexCount,
|
|
@@ -7228,22 +7234,26 @@ void main() {
|
|
|
7228
7234
|
}
|
|
7229
7235
|
}
|
|
7230
7236
|
// Update dynamic fields
|
|
7231
|
-
/**
|
|
7232
|
-
* Updates the vertex count (used in draw calls)
|
|
7233
|
-
* @note Any attributes with stepMode=vertex need to be at least this big
|
|
7234
|
-
*/
|
|
7235
|
-
setVertexCount(vertexCount) {
|
|
7236
|
-
this.vertexCount = vertexCount;
|
|
7237
|
-
this.setNeedsRedraw("vertexCount");
|
|
7238
|
-
}
|
|
7239
7237
|
/**
|
|
7240
7238
|
* Updates the instance count (used in draw calls)
|
|
7241
7239
|
* @note Any attributes with stepMode=instance need to be at least this big
|
|
7242
7240
|
*/
|
|
7243
7241
|
setInstanceCount(instanceCount) {
|
|
7244
7242
|
this.instanceCount = instanceCount;
|
|
7243
|
+
if (this.isInstanced === void 0 && instanceCount > 0) {
|
|
7244
|
+
this.isInstanced = true;
|
|
7245
|
+
}
|
|
7245
7246
|
this.setNeedsRedraw("instanceCount");
|
|
7246
7247
|
}
|
|
7248
|
+
/**
|
|
7249
|
+
* Updates the vertex count (used in draw calls)
|
|
7250
|
+
* @note Any attributes with stepMode=vertex need to be at least this big
|
|
7251
|
+
*/
|
|
7252
|
+
setVertexCount(vertexCount) {
|
|
7253
|
+
this.vertexCount = vertexCount;
|
|
7254
|
+
this.setNeedsRedraw("vertexCount");
|
|
7255
|
+
}
|
|
7256
|
+
/** Set the shader inputs */
|
|
7247
7257
|
setShaderInputs(shaderInputs) {
|
|
7248
7258
|
this.shaderInputs = shaderInputs;
|
|
7249
7259
|
this._uniformStore = new import_core10.UniformStore(this.shaderInputs.modules);
|
|
@@ -7253,6 +7263,7 @@ void main() {
|
|
|
7253
7263
|
}
|
|
7254
7264
|
this.setNeedsRedraw("shaderInputs");
|
|
7255
7265
|
}
|
|
7266
|
+
/** Update uniform buffers from the model's shader inputs */
|
|
7256
7267
|
updateShaderInputs() {
|
|
7257
7268
|
this._uniformStore.setUniforms(this.shaderInputs.getUniformValues());
|
|
7258
7269
|
this.setNeedsRedraw("shaderInputs");
|
|
@@ -7352,7 +7363,6 @@ void main() {
|
|
|
7352
7363
|
* @deprecated Updates shader module settings (which results in uniforms being set)
|
|
7353
7364
|
*/
|
|
7354
7365
|
updateModuleSettings(props) {
|
|
7355
|
-
import_core11.log.warn("Model.updateModuleSettings is deprecated. Use Model.shaderInputs.setProps()")();
|
|
7356
7366
|
const { bindings, uniforms } = (0, import_core11.splitUniformsAndBindings)(this._getModuleUniforms(props));
|
|
7357
7367
|
Object.assign(this.bindings, bindings);
|
|
7358
7368
|
Object.assign(this.uniforms, uniforms);
|
|
@@ -7533,6 +7543,9 @@ void main() {
|
|
|
7533
7543
|
attributes: {},
|
|
7534
7544
|
constantAttributes: {},
|
|
7535
7545
|
varyings: [],
|
|
7546
|
+
isInstanced: void 0,
|
|
7547
|
+
instanceCount: 0,
|
|
7548
|
+
vertexCount: 0,
|
|
7536
7549
|
shaderInputs: void 0,
|
|
7537
7550
|
pipelineFactory: void 0,
|
|
7538
7551
|
shaderFactory: void 0,
|