UNPKG

@luma.gl/engine

Version:

3D Engine Components for luma.gl

21 lines 779 B
// luma.gl // SPDX-License-Identifier: MIT // Copyright (c) vis.gl contributors import { isNumericArray } from '@math.gl/types'; export function isUniformValue(value) { return isNumericArray(value) || typeof value === 'number' || typeof value === 'boolean'; } export function splitUniformsAndBindings(uniforms, uniformTypes = {}) { const result = { bindings: {}, uniforms: {} }; Object.keys(uniforms).forEach(name => { const uniform = uniforms[name]; if (Object.prototype.hasOwnProperty.call(uniformTypes, name) || isUniformValue(uniform)) { result.uniforms[name] = uniform; } else { result.bindings[name] = uniform; } }); return result; } //# sourceMappingURL=split-uniforms-and-bindings.js.map