@luma.gl/engine
Advanced tools
Comparing version 9.0.0 to 9.0.3
@@ -36,4 +36,4 @@ import type { TypedArray, RenderPipelineProps, RenderPipelineParameters } from '@luma.gl/core'; | ||
constantAttributes?: Record<string, TypedArray>; | ||
/** Some applications intentionally supply unused attributes */ | ||
ignoreUnknownAttributes?: boolean; | ||
/** Some applications intentionally supply unused attributes and bindings, and want to disable warnings */ | ||
disableWarnings?: boolean; | ||
/** @internal For use with {@link TransformFeedback}, WebGL only. */ | ||
@@ -175,3 +175,3 @@ varyings?: string[]; | ||
setAttributes(buffers: Record<string, Buffer>, options?: { | ||
ignoreUnknownAttributes?: boolean; | ||
disableWarnings?: boolean; | ||
}): void; | ||
@@ -186,3 +186,5 @@ /** | ||
*/ | ||
setConstantAttributes(attributes: Record<string, TypedArray>): void; | ||
setConstantAttributes(attributes: Record<string, TypedArray>, options?: { | ||
disableWarnings?: boolean; | ||
}): void; | ||
/** | ||
@@ -189,0 +191,0 @@ * Sets individual uniforms |
@@ -48,3 +48,3 @@ // luma.gl | ||
debugShaders: undefined, | ||
ignoreUnknownAttributes: undefined | ||
disableWarnings: undefined | ||
}; | ||
@@ -171,6 +171,2 @@ device; | ||
} | ||
// @ts-expect-error | ||
if (props.indices) { | ||
throw new Error('Model.props.indices removed. Use props.indexBuffer'); | ||
} | ||
if (props.indexBuffer) { | ||
@@ -181,3 +177,3 @@ this.setIndexBuffer(props.indexBuffer); | ||
this.setAttributes(props.attributes, { | ||
ignoreUnknownAttributes: props.ignoreUnknownAttributes | ||
disableWarnings: props.disableWarnings | ||
}); | ||
@@ -249,3 +245,3 @@ } | ||
// Any caching needs to be done inside the pipeline functions | ||
this.pipeline.setBindings(this.bindings); | ||
this.pipeline.setBindings(this.bindings, { disableWarnings: this.props.disableWarnings }); | ||
if (!isObjectEmpty(this.uniforms)) { | ||
@@ -419,3 +415,3 @@ this.pipeline.setUniformsWebGL(this.uniforms); | ||
} | ||
if (!set && (options?.ignoreUnknownAttributes || this.props.ignoreUnknownAttributes)) { | ||
if (!set && !(options?.disableWarnings || this.props.disableWarnings)) { | ||
log.warn(`Model(${this.id}): Ignoring buffer "${buffer.id}" for unknown attribute "${bufferName}"`)(); | ||
@@ -434,3 +430,3 @@ } | ||
*/ | ||
setConstantAttributes(attributes) { | ||
setConstantAttributes(attributes, options) { | ||
for (const [attributeName, value] of Object.entries(attributes)) { | ||
@@ -441,3 +437,3 @@ const attributeInfo = this._attributeInfos[attributeName]; | ||
} | ||
else { | ||
else if (!(options?.disableWarnings || this.props.disableWarnings)) { | ||
log.warn(`Model "${this.id}: Ignoring constant supplied for unknown attribute "${attributeName}"`)(); | ||
@@ -504,5 +500,5 @@ } | ||
this.vertexCount = gpuGeometry.vertexCount; | ||
this.setIndexBuffer(gpuGeometry.indices); | ||
this.setAttributes(gpuGeometry.attributes, { ignoreUnknownAttributes: true }); | ||
this.setAttributes(attributes, { ignoreUnknownAttributes: this.props.ignoreUnknownAttributes }); | ||
this.setIndexBuffer(gpuGeometry.indices || null); | ||
this.setAttributes(gpuGeometry.attributes, { disableWarnings: true }); | ||
this.setAttributes(attributes, { disableWarnings: this.props.disableWarnings }); | ||
this.setNeedsRedraw('geometry attributes'); | ||
@@ -509,0 +505,0 @@ } |
{ | ||
"name": "@luma.gl/engine", | ||
"version": "9.0.0", | ||
"version": "9.0.3", | ||
"description": "3D Engine Components for luma.gl", | ||
@@ -43,6 +43,6 @@ "type": "module", | ||
"peerDependencies": { | ||
"@luma.gl/core": "^9.0.0-beta" | ||
"@luma.gl/core": "^9.0.0" | ||
}, | ||
"dependencies": { | ||
"@luma.gl/shadertools": "9.0.0", | ||
"@luma.gl/shadertools": "9.0.3", | ||
"@math.gl/core": "^4.0.0", | ||
@@ -52,3 +52,3 @@ "@probe.gl/log": "^4.0.2", | ||
}, | ||
"gitHead": "a87ee4e72dbfcb9e4786aa823b9ac516f0031723" | ||
"gitHead": "543e03b2d4bd865ac86cc8927611b91cc3e0393c" | ||
} |
@@ -58,5 +58,6 @@ // luma.gl | ||
constantAttributes?: Record<string, TypedArray>; | ||
/** Some applications intentionally supply unused attributes */ | ||
ignoreUnknownAttributes?: boolean; | ||
/** Some applications intentionally supply unused attributes and bindings, and want to disable warnings */ | ||
disableWarnings?: boolean; | ||
/** @internal For use with {@link TransformFeedback}, WebGL only. */ | ||
@@ -113,4 +114,4 @@ varyings?: string[]; | ||
debugShaders: undefined, | ||
ignoreUnknownAttributes: undefined | ||
debugShaders: undefined!, | ||
disableWarnings: undefined! | ||
}; | ||
@@ -270,6 +271,2 @@ | ||
} | ||
// @ts-expect-error | ||
if (props.indices) { | ||
throw new Error('Model.props.indices removed. Use props.indexBuffer'); | ||
} | ||
if (props.indexBuffer) { | ||
@@ -280,3 +277,3 @@ this.setIndexBuffer(props.indexBuffer); | ||
this.setAttributes(props.attributes, { | ||
ignoreUnknownAttributes: props.ignoreUnknownAttributes | ||
disableWarnings: props.disableWarnings | ||
}); | ||
@@ -357,3 +354,3 @@ } | ||
// Any caching needs to be done inside the pipeline functions | ||
this.pipeline.setBindings(this.bindings); | ||
this.pipeline.setBindings(this.bindings, {disableWarnings: this.props.disableWarnings}); | ||
if (!isObjectEmpty(this.uniforms)) { | ||
@@ -525,6 +522,3 @@ this.pipeline.setUniformsWebGL(this.uniforms); | ||
*/ | ||
setAttributes( | ||
buffers: Record<string, Buffer>, | ||
options?: {ignoreUnknownAttributes?: boolean} | ||
): void { | ||
setAttributes(buffers: Record<string, Buffer>, options?: {disableWarnings?: boolean}): void { | ||
if (buffers.indices) { | ||
@@ -554,3 +548,3 @@ log.warn( | ||
} | ||
if (!set && (options?.ignoreUnknownAttributes || this.props.ignoreUnknownAttributes)) { | ||
if (!set && !(options?.disableWarnings || this.props.disableWarnings)) { | ||
log.warn( | ||
@@ -572,3 +566,6 @@ `Model(${this.id}): Ignoring buffer "${buffer.id}" for unknown attribute "${bufferName}"` | ||
*/ | ||
setConstantAttributes(attributes: Record<string, TypedArray>): void { | ||
setConstantAttributes( | ||
attributes: Record<string, TypedArray>, | ||
options?: {disableWarnings?: boolean} | ||
): void { | ||
for (const [attributeName, value] of Object.entries(attributes)) { | ||
@@ -578,3 +575,3 @@ const attributeInfo = this._attributeInfos[attributeName]; | ||
this.vertexArray.setConstantWebGL(attributeInfo.location, value); | ||
} else { | ||
} else if (!(options?.disableWarnings || this.props.disableWarnings)) { | ||
log.warn( | ||
@@ -650,5 +647,5 @@ `Model "${this.id}: Ignoring constant supplied for unknown attribute "${attributeName}"` | ||
this.vertexCount = gpuGeometry.vertexCount; | ||
this.setIndexBuffer(gpuGeometry.indices); | ||
this.setAttributes(gpuGeometry.attributes, {ignoreUnknownAttributes: true}); | ||
this.setAttributes(attributes, {ignoreUnknownAttributes: this.props.ignoreUnknownAttributes}); | ||
this.setIndexBuffer(gpuGeometry.indices || null); | ||
this.setAttributes(gpuGeometry.attributes, {disableWarnings: true}); | ||
this.setAttributes(attributes, {disableWarnings: this.props.disableWarnings}); | ||
@@ -655,0 +652,0 @@ this.setNeedsRedraw('geometry attributes'); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1141627
143
22292
+ Added@luma.gl/shadertools@9.0.3(transitive)
- Removed@luma.gl/shadertools@9.0.0(transitive)
Updated@luma.gl/shadertools@9.0.3