{ "version": 3, "sources": ["index.js", "simple-mesh-layer/simple-mesh-layer.js", "utils/matrix.js", "simple-mesh-layer/simple-mesh-layer-vertex.glsl.js", "simple-mesh-layer/simple-mesh-layer-fragment.glsl.js", "scenegraph-layer/scenegraph-layer.js", "scenegraph-layer/gltf-utils.js", "scenegraph-layer/scenegraph-layer-vertex.glsl.js", "scenegraph-layer/scenegraph-layer-fragment.glsl.js"], "sourcesContent": ["// Copyright (c) 2015 - 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n/* eslint-disable max-len */\n// TODO - v9 - restore when luma.gl/gltf module is available again\nexport { default as SimpleMeshLayer } from \"./simple-mesh-layer/simple-mesh-layer.js\";\nexport { default as ScenegraphLayer } from \"./scenegraph-layer/scenegraph-layer.js\";\n", "// Note: This file will either be moved back to deck.gl or reformatted to web-monorepo standards\n// Disabling lint temporarily to facilitate copying code in and out of this repo\n/* eslint-disable */\n// Copyright (c) 2015 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nimport { Layer, project32, phongLighting, picking, log } from '@deck.gl/core';\nimport { Texture } from '@luma.gl/core';\nimport { Model, Geometry } from '@luma.gl/engine';\nimport { MATRIX_ATTRIBUTES, shouldComposeModelMatrix } from \"../utils/matrix.js\";\nimport vs from \"./simple-mesh-layer-vertex.glsl.js\";\nimport fs from \"./simple-mesh-layer-fragment.glsl.js\";\nimport { getMeshBoundingBox } from '@loaders.gl/schema';\nfunction normalizeGeometryAttributes(attributes) {\n const positionAttribute = attributes.positions || attributes.POSITION;\n log.assert(positionAttribute, 'no \"postions\" or \"POSITION\" attribute in mesh');\n const vertexCount = positionAttribute.value.length / positionAttribute.size;\n let colorAttribute = attributes.COLOR_0 || attributes.colors;\n if (!colorAttribute) {\n colorAttribute = { size: 3, value: new Float32Array(vertexCount * 3).fill(1) };\n }\n let normalAttribute = attributes.NORMAL || attributes.normals;\n if (!normalAttribute) {\n normalAttribute = { size: 3, value: new Float32Array(vertexCount * 3).fill(0) };\n }\n let texCoordAttribute = attributes.TEXCOORD_0 || attributes.texCoords;\n if (!texCoordAttribute) {\n texCoordAttribute = { size: 2, value: new Float32Array(vertexCount * 2).fill(0) };\n }\n return {\n positions: positionAttribute,\n colors: colorAttribute,\n normals: normalAttribute,\n texCoords: texCoordAttribute\n };\n}\n/*\n * Convert mesh data into geometry\n * @returns {Geometry} geometry\n */\nfunction getGeometry(data) {\n if (data instanceof Geometry) {\n // @ts-expect-error data.attributes is readonly\n data.attributes = normalizeGeometryAttributes(data.attributes);\n return data;\n }\n else if (data.attributes) {\n return new Geometry({\n ...data,\n topology: 'triangle-list',\n attributes: normalizeGeometryAttributes(data.attributes)\n });\n }\n else {\n return new Geometry({\n topology: 'triangle-list',\n attributes: normalizeGeometryAttributes(data)\n });\n }\n}\nconst DEFAULT_COLOR = [0, 0, 0, 255];\nconst defaultProps = {\n mesh: { type: 'object', value: null, async: true },\n texture: { type: 'image', value: null, async: true },\n sizeScale: { type: 'number', value: 1, min: 0 },\n // _instanced is a hack to use world position instead of meter offsets in mesh\n // TODO - formalize API\n _instanced: true,\n // NOTE(Tarek): Quick and dirty wireframe. Just draws\n // the same mesh with LINE_STRIPS. Won't follow edges\n // of the original mesh.\n wireframe: false,\n // Optional material for 'lighting' shader module\n material: true,\n getPosition: { type: 'accessor', value: (x) => x.position },\n getColor: { type: 'accessor', value: DEFAULT_COLOR },\n // yaw, pitch and roll are in degrees\n // https://en.wikipedia.org/wiki/Euler_angles\n // [pitch, yaw, roll]\n getOrientation: { type: 'accessor', value: [0, 0, 0] },\n getScale: { type: 'accessor', value: [1, 1, 1] },\n getTranslation: { type: 'accessor', value: [0, 0, 0] },\n // 4x4 matrix\n getTransformMatrix: { type: 'accessor', value: [] },\n textureParameters: { type: 'object', ignore: true, value: null }\n};\n/** Render a number of instances of an arbitrary 3D geometry. */\nclass SimpleMeshLayer extends Layer {\n getShaders() {\n return super.getShaders({\n vs,\n fs,\n modules: [project32, phongLighting, picking]\n });\n }\n getBounds() {\n if (this.props._instanced) {\n return super.getBounds();\n }\n let result = this.state.positionBounds;\n if (result) {\n return result;\n }\n const { mesh } = this.props;\n if (!mesh) {\n return null;\n }\n // @ts-ignore Detect if mesh is generated by loaders.gl\n result = mesh.header?.boundingBox;\n if (!result) {\n // Otherwise, calculate bounding box from positions\n const { attributes } = getGeometry(mesh);\n attributes.POSITION = attributes.POSITION || attributes.positions;\n //@ts-expect-error\n result = getMeshBoundingBox(attributes);\n }\n this.state.positionBounds = result;\n return result;\n }\n initializeState() {\n const attributeManager = this.getAttributeManager();\n // attributeManager is always defined in a primitive layer\n attributeManager.addInstanced({\n instancePositions: {\n transition: true,\n type: 'float64',\n fp64: this.use64bitPositions(),\n size: 3,\n accessor: 'getPosition'\n },\n instanceColors: {\n type: 'unorm8',\n transition: true,\n size: this.props.colorFormat.length,\n accessor: 'getColor',\n defaultValue: [0, 0, 0, 255]\n },\n instanceModelMatrix: MATRIX_ATTRIBUTES\n });\n this.setState({\n // Avoid luma.gl's missing uniform warning\n // TODO - add feature to luma.gl to specify ignored uniforms?\n emptyTexture: this.context.device.createTexture({\n data: new Uint8Array(4),\n width: 1,\n height: 1\n })\n });\n }\n updateState(params) {\n super.updateState(params);\n const { props, oldProps, changeFlags } = params;\n if (props.mesh !== oldProps.mesh || changeFlags.extensionsChanged) {\n this.state.positionBounds = null;\n this.state.model?.destroy();\n if (props.mesh) {\n this.state.model = this.getModel(props.mesh);\n const attributes = props.mesh.attributes || props.mesh;\n this.setState({\n hasNormals: Boolean(attributes.NORMAL || attributes.normals)\n });\n }\n // attributeManager is always defined in a primitive layer\n this.getAttributeManager().invalidateAll();\n }\n if (props.texture !== oldProps.texture && props.texture instanceof Texture) {\n this.setTexture(props.texture);\n }\n if (this.state.model) {\n this.state.model.setTopology(this.props.wireframe ? 'line-strip' : 'triangle-list');\n }\n }\n finalizeState(context) {\n super.finalizeState(context);\n this.state.emptyTexture.delete();\n }\n draw({ uniforms }) {\n const { model } = this.state;\n if (!model) {\n return;\n }\n const { viewport, renderPass } = this.context;\n const { sizeScale, coordinateSystem, _instanced } = this.props;\n model.setUniforms(uniforms);\n model.setUniforms({\n sizeScale,\n composeModelMatrix: !_instanced || shouldComposeModelMatrix(viewport, coordinateSystem),\n flatShading: !this.state.hasNormals\n });\n model.draw(renderPass);\n }\n get isLoaded() {\n return Boolean(this.state?.model && super.isLoaded);\n }\n getModel(mesh) {\n const model = new Model(this.context.device, {\n ...this.getShaders(),\n id: this.props.id,\n bufferLayout: this.getAttributeManager().getBufferLayouts(),\n geometry: getGeometry(mesh),\n isInstanced: true\n });\n const { texture } = this.props;\n const { emptyTexture } = this.state;\n model.setBindings({\n sampler: texture || emptyTexture\n });\n model.setUniforms({\n hasTexture: Boolean(texture)\n });\n return model;\n }\n setTexture(texture) {\n const { emptyTexture, model } = this.state;\n // props.mesh may not be ready at this time.\n // The sampler will be set when `getModel` is called\n if (model) {\n model.setBindings({\n sampler: texture || emptyTexture\n });\n model.setUniforms({\n hasTexture: Boolean(texture)\n });\n }\n }\n}\nSimpleMeshLayer.defaultProps = defaultProps;\nSimpleMeshLayer.layerName = 'SimpleMeshLayer';\nexport default SimpleMeshLayer;\n", "import { COORDINATE_SYSTEM, createIterable } from '@deck.gl/core';\n/* eslint-disable max-statements, complexity, camelcase */\nconst RADIAN_PER_DEGREE = Math.PI / 180;\nconst modelMatrix = new Float32Array(16);\nconst valueArray = new Float32Array(12);\nfunction calculateTransformMatrix(targetMatrix, orientation, scale) {\n const pitch = orientation[0] * RADIAN_PER_DEGREE;\n const yaw = orientation[1] * RADIAN_PER_DEGREE;\n const roll = orientation[2] * RADIAN_PER_DEGREE;\n const sr = Math.sin(roll);\n const sp = Math.sin(pitch);\n const sw = Math.sin(yaw);\n const cr = Math.cos(roll);\n const cp = Math.cos(pitch);\n const cw = Math.cos(yaw);\n const scx = scale[0];\n const scy = scale[1];\n const scz = scale[2];\n targetMatrix[0] = scx * cw * cp; // 0,0\n targetMatrix[1] = scx * sw * cp; // 1,0\n targetMatrix[2] = scx * -sp; // 2,0\n targetMatrix[3] = scy * (-sw * cr + cw * sp * sr); // 0,1\n targetMatrix[4] = scy * (cw * cr + sw * sp * sr); // 1,1\n targetMatrix[5] = scy * cp * sr; // 2,1\n targetMatrix[6] = scz * (sw * sr + cw * sp * cr); // 0,2\n targetMatrix[7] = scz * (-cw * sr + sw * sp * cr); // 1,2\n targetMatrix[8] = scz * cp * cr; // 2,2\n}\nfunction getExtendedMat3FromMat4(mat4) {\n mat4[0] = mat4[0];\n mat4[1] = mat4[1];\n mat4[2] = mat4[2];\n mat4[3] = mat4[4];\n mat4[4] = mat4[5];\n mat4[5] = mat4[6];\n mat4[6] = mat4[8];\n mat4[7] = mat4[9];\n mat4[8] = mat4[10];\n mat4[9] = mat4[12];\n mat4[10] = mat4[13];\n mat4[11] = mat4[14];\n return mat4.subarray(0, 12);\n}\nexport const MATRIX_ATTRIBUTES = {\n size: 12,\n accessor: ['getOrientation', 'getScale', 'getTranslation', 'getTransformMatrix'],\n shaderAttributes: {\n instanceModelMatrixCol0: {\n size: 3,\n elementOffset: 0\n },\n instanceModelMatrixCol1: {\n size: 3,\n elementOffset: 3\n },\n instanceModelMatrixCol2: {\n size: 3,\n elementOffset: 6\n },\n instanceTranslation: {\n size: 3,\n elementOffset: 9\n }\n },\n update(attribute, { startRow, endRow }) {\n // @ts-expect-error: \"this\" will be bound to a layer when this function is called\n const { data, getOrientation, getScale, getTranslation, getTransformMatrix } = this.props;\n const arrayMatrix = Array.isArray(getTransformMatrix);\n const constantMatrix = arrayMatrix && getTransformMatrix.length === 16;\n const constantScale = Array.isArray(getScale);\n const constantOrientation = Array.isArray(getOrientation);\n const constantTranslation = Array.isArray(getTranslation);\n const hasMatrix = constantMatrix || (!arrayMatrix && Boolean(getTransformMatrix(data[0])));\n if (hasMatrix) {\n attribute.constant = constantMatrix;\n }\n else {\n attribute.constant = constantOrientation && constantScale && constantTranslation;\n }\n const instanceModelMatrixData = attribute.value;\n if (attribute.constant) {\n let matrix;\n if (hasMatrix) {\n modelMatrix.set(getTransformMatrix);\n matrix = getExtendedMat3FromMat4(modelMatrix);\n }\n else {\n matrix = valueArray;\n const orientation = getOrientation;\n const scale = getScale;\n calculateTransformMatrix(matrix, orientation, scale);\n matrix.set(getTranslation, 9);\n }\n attribute.value = new Float32Array(matrix);\n }\n else {\n let i = startRow * attribute.size;\n const { iterable, objectInfo } = createIterable(data, startRow, endRow);\n for (const object of iterable) {\n objectInfo.index++;\n let matrix;\n if (hasMatrix) {\n modelMatrix.set(constantMatrix ? getTransformMatrix : getTransformMatrix(object, objectInfo));\n matrix = getExtendedMat3FromMat4(modelMatrix);\n }\n else {\n matrix = valueArray;\n const orientation = constantOrientation\n ? getOrientation\n : getOrientation(object, objectInfo);\n const scale = constantScale ? getScale : getScale(object, objectInfo);\n calculateTransformMatrix(matrix, orientation, scale);\n matrix.set(constantTranslation ? getTranslation : getTranslation(object, objectInfo), 9);\n }\n instanceModelMatrixData[i++] = matrix[0];\n instanceModelMatrixData[i++] = matrix[1];\n instanceModelMatrixData[i++] = matrix[2];\n instanceModelMatrixData[i++] = matrix[3];\n instanceModelMatrixData[i++] = matrix[4];\n instanceModelMatrixData[i++] = matrix[5];\n instanceModelMatrixData[i++] = matrix[6];\n instanceModelMatrixData[i++] = matrix[7];\n instanceModelMatrixData[i++] = matrix[8];\n instanceModelMatrixData[i++] = matrix[9];\n instanceModelMatrixData[i++] = matrix[10];\n instanceModelMatrixData[i++] = matrix[11];\n }\n }\n }\n};\n// only apply composeModelMatrix when in cartesian or meter_offsets coordinate system\n// with `composeModelMatrix` enabled, the rotation part of the layer's modelMatrix will be composed to instance's transformations\n// since rotating latitude and longitude can not provide meaningful results, hence `composeModelMatrix` is disabled\n// when in LNGLAT and LNGLAT_OFFSET coordinates.\nexport function shouldComposeModelMatrix(viewport, coordinateSystem) {\n return (coordinateSystem === COORDINATE_SYSTEM.CARTESIAN ||\n coordinateSystem === COORDINATE_SYSTEM.METER_OFFSETS ||\n (coordinateSystem === COORDINATE_SYSTEM.DEFAULT && !viewport.isGeospatial));\n}\n", "export default `#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin vec3 instanceModelMatrixCol0;\nin vec3 instanceModelMatrixCol1;\nin vec3 instanceModelMatrixCol2;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\ngeometry.uv = texCoords;\ngeometry.pickingColor = instancePickingColors;\nvTexCoord = texCoords;\ncameraPosition = project_uCameraPosition;\nvColor = vec4(colors * instanceColors.rgb, instanceColors.a);\nmat3 instanceModelMatrix = mat3(instanceModelMatrixCol0, instanceModelMatrixCol1, instanceModelMatrixCol2);\nvec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\nif (composeModelMatrix) {\nDECKGL_FILTER_SIZE(pos, geometry);\nnormals_commonspace = project_normal(instanceModelMatrix * normals);\ngeometry.worldPosition += pos;\ngl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\ngeometry.position = position_commonspace;\n}\nelse {\npos = project_size(pos);\nDECKGL_FILTER_SIZE(pos, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\ngeometry.position = position_commonspace;\nnormals_commonspace = project_normal(instanceModelMatrix * normals);\n}\ngeometry.normal = normals_commonspace;\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n`;\n", "export default `#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\nprecision highp float;\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = vTexCoord;\nvec3 normal;\nif (flatShading) {\nnormal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n} else {\nnormal = normals_commonspace;\n}\nvec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\nDECKGL_FILTER_COLOR(color, geometry);\nvec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\nfragColor = vec4(lightColor, color.a * opacity);\n}\n`;\n", "// Copyright (c) 2019 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\nimport { Layer, project32, picking, log } from '@deck.gl/core';\nimport { pbr } from '@luma.gl/shadertools';\nimport { ScenegraphNode, GroupNode, ModelNode } from '@luma.gl/engine';\nimport { createScenegraphsFromGLTF } from '@luma.gl/gltf';\nimport { GLTFLoader, postProcessGLTF } from '@loaders.gl/gltf';\nimport { waitForGLTFAssets } from \"./gltf-utils.js\";\nimport { MATRIX_ATTRIBUTES, shouldComposeModelMatrix } from \"../utils/matrix.js\";\nimport vs from \"./scenegraph-layer-vertex.glsl.js\";\nimport fs from \"./scenegraph-layer-fragment.glsl.js\";\nconst DEFAULT_COLOR = [255, 255, 255, 255];\nconst defaultProps = {\n scenegraph: { type: 'object', value: null, async: true },\n getScene: gltf => {\n if (gltf && gltf.scenes) {\n // gltf post processor replaces `gltf.scene` number with the scene `object`\n return typeof gltf.scene === 'object' ? gltf.scene : gltf.scenes[gltf.scene || 0];\n }\n return gltf;\n },\n getAnimator: scenegraph => scenegraph && scenegraph.animator,\n _animations: null,\n sizeScale: { type: 'number', value: 1, min: 0 },\n sizeMinPixels: { type: 'number', min: 0, value: 0 },\n sizeMaxPixels: { type: 'number', min: 0, value: Number.MAX_SAFE_INTEGER },\n getPosition: { type: 'accessor', value: (x) => x.position },\n getColor: { type: 'accessor', value: DEFAULT_COLOR },\n // flat or pbr\n _lighting: 'flat',\n // _lighting must be pbr for this to work\n _imageBasedLightingEnvironment: undefined,\n // yaw, pitch and roll are in degrees\n // https://en.wikipedia.org/wiki/Euler_angles\n // [pitch, yaw, roll]\n getOrientation: { type: 'accessor', value: [0, 0, 0] },\n getScale: { type: 'accessor', value: [1, 1, 1] },\n getTranslation: { type: 'accessor', value: [0, 0, 0] },\n // 4x4 matrix\n getTransformMatrix: { type: 'accessor', value: [] },\n loaders: [GLTFLoader]\n};\n/** Render a number of instances of a complete glTF scenegraph. */\nclass ScenegraphLayer extends Layer {\n getShaders() {\n const modules = [project32, picking];\n if (this.props._lighting === 'pbr') {\n modules.push(pbr);\n }\n return super.getShaders({ vs, fs, modules });\n }\n initializeState() {\n const attributeManager = this.getAttributeManager();\n // attributeManager is always defined for primitive layers\n attributeManager.addInstanced({\n instancePositions: {\n size: 3,\n type: 'float64',\n fp64: this.use64bitPositions(),\n accessor: 'getPosition',\n transition: true\n },\n instanceColors: {\n type: 'unorm8',\n size: this.props.colorFormat.length,\n accessor: 'getColor',\n defaultValue: DEFAULT_COLOR,\n transition: true\n },\n instanceModelMatrix: MATRIX_ATTRIBUTES\n });\n }\n updateState(params) {\n super.updateState(params);\n const { props, oldProps } = params;\n if (props.scenegraph !== oldProps.scenegraph) {\n this._updateScenegraph();\n }\n else if (props._animations !== oldProps._animations) {\n this._applyAnimationsProp(this.state.animator, props._animations);\n }\n }\n finalizeState(context) {\n super.finalizeState(context);\n this.state.scenegraph?.destroy();\n }\n get isLoaded() {\n return Boolean(this.state?.scenegraph && super.isLoaded);\n }\n _updateScenegraph() {\n const props = this.props;\n const { device } = this.context;\n let scenegraphData = null;\n if (props.scenegraph instanceof ScenegraphNode) {\n // Signature 1: props.scenegraph is a proper luma.gl Scenegraph\n scenegraphData = { scenes: [props.scenegraph] };\n }\n else if (props.scenegraph && typeof props.scenegraph === 'object') {\n // Converts loaders.gl gltf to luma.gl scenegraph using the undocumented @luma.gl/experimental function\n const gltf = props.scenegraph;\n // Tiles3DLoader already processes GLTF\n const processedGLTF = gltf.json ? postProcessGLTF(gltf) : gltf;\n const gltfObjects = createScenegraphsFromGLTF(device, processedGLTF, this._getModelOptions());\n scenegraphData = { gltf: processedGLTF, ...gltfObjects };\n waitForGLTFAssets(gltfObjects)\n .then(() => {\n this.setNeedsRedraw();\n })\n .catch(ex => {\n this.raiseError(ex, 'loading glTF');\n });\n }\n const options = { layer: this, device: this.context.device };\n const scenegraph = props.getScene(scenegraphData, options);\n const animator = props.getAnimator(scenegraphData, options);\n if (scenegraph instanceof GroupNode) {\n this.state.scenegraph?.destroy();\n this._applyAnimationsProp(animator, props._animations);\n const models = [];\n scenegraph.traverse(node => {\n if (node instanceof ModelNode) {\n models.push(node.model);\n }\n });\n this.setState({ scenegraph, animator, models });\n this.getAttributeManager().invalidateAll();\n }\n else if (scenegraph !== null) {\n log.warn('invalid scenegraph:', scenegraph)();\n }\n }\n _applyAnimationsProp(animator, animationsProp) {\n if (!animator || !animationsProp) {\n return;\n }\n const animations = animator.getAnimations();\n // sort() to ensure '*' comes first so that other values can override\n Object.keys(animationsProp)\n .sort()\n .forEach(key => {\n // Key can be:\n // - number for index number\n // - name for animation name\n // - * to affect all animations\n const value = animationsProp[key];\n if (key === '*') {\n animations.forEach(animation => {\n Object.assign(animation, value);\n });\n }\n else if (Number.isFinite(Number(key))) {\n const number = Number(key);\n if (number >= 0 && number < animations.length) {\n Object.assign(animations[number], value);\n }\n else {\n log.warn(`animation ${key} not found`)();\n }\n }\n else {\n const findResult = animations.find(({ name }) => name === key);\n if (findResult) {\n Object.assign(findResult, value);\n }\n else {\n log.warn(`animation ${key} not found`)();\n }\n }\n });\n }\n _getModelOptions() {\n const { _imageBasedLightingEnvironment } = this.props;\n let env;\n if (_imageBasedLightingEnvironment) {\n if (typeof _imageBasedLightingEnvironment === 'function') {\n env = _imageBasedLightingEnvironment({ gl: this.context.gl, layer: this });\n }\n else {\n env = _imageBasedLightingEnvironment;\n }\n }\n return {\n imageBasedLightingEnvironment: env,\n modelOptions: {\n id: this.props.id,\n isInstanced: true,\n bufferLayout: this.getAttributeManager().getBufferLayouts(),\n ...this.getShaders()\n },\n // tangents are not supported\n useTangents: false\n };\n }\n draw({ context }) {\n if (!this.state.scenegraph)\n return;\n if (this.props._animations && this.state.animator) {\n this.state.animator.animate(context.timeline.getTime());\n this.setNeedsRedraw();\n }\n const { viewport, renderPass } = this.context;\n const { sizeScale, sizeMinPixels, sizeMaxPixels, opacity, coordinateSystem } = this.props;\n const numInstances = this.getNumInstances();\n this.state.scenegraph.traverse((node, { worldMatrix }) => {\n if (node instanceof ModelNode) {\n const { model } = node;\n model.setInstanceCount(numInstances);\n model.setUniforms({\n sizeScale,\n opacity,\n sizeMinPixels,\n sizeMaxPixels,\n composeModelMatrix: shouldComposeModelMatrix(viewport, coordinateSystem),\n sceneModelMatrix: worldMatrix,\n // Needed for PBR (TODO: find better way to get it)\n // eslint-disable-next-line camelcase\n u_Camera: model.uniforms.project_uCameraPosition\n });\n model.draw(renderPass);\n }\n });\n }\n}\nScenegraphLayer.defaultProps = defaultProps;\nScenegraphLayer.layerName = 'ScenegraphLayer';\nexport default ScenegraphLayer;\n", "export async function waitForGLTFAssets(gltfObjects) {\n const remaining = [];\n gltfObjects.scenes.forEach(scene => {\n scene.traverse((modelNode) => {\n // TODO v9 getUnforms() was removed, hack it with props.uniforms\n Object.values(modelNode.model.uniforms).forEach((uniform) => {\n if (uniform.loaded === false) {\n remaining.push(uniform);\n }\n });\n });\n });\n return await waitWhileCondition(() => remaining.some(uniform => !uniform.loaded));\n}\nasync function waitWhileCondition(condition) {\n while (condition()) {\n await new Promise(resolve => requestAnimationFrame(resolve));\n }\n}\n", "export default `\\\n#version 300 es\n#define SHADER_NAME scenegraph-layer-vertex-shader\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin vec3 instanceModelMatrixCol0;\nin vec3 instanceModelMatrixCol1;\nin vec3 instanceModelMatrixCol2;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec3 positions;\n#ifdef HAS_UV\nin vec2 texCoords;\n#endif\n#ifdef MODULE_PBR\n#ifdef HAS_NORMALS\nin vec3 normals;\n#endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n#ifdef HAS_UV\nout vec2 vTEXCOORD_0;\n#endif\n#endif\nvoid main(void) {\n#if defined(HAS_UV) && !defined(MODULE_PBR)\nvTEXCOORD_0 = texCoords;\ngeometry.uv = texCoords;\n#endif\ngeometry.worldPosition = instancePositions;\ngeometry.pickingColor = instancePickingColors;\nmat3 instanceModelMatrix = mat3(instanceModelMatrixCol0, instanceModelMatrixCol1, instanceModelMatrixCol2);\nvec3 normal = vec3(0.0, 0.0, 1.0);\n#ifdef MODULE_PBR\n#ifdef HAS_NORMALS\nnormal = instanceModelMatrix * (sceneModelMatrix * vec4(normals, 0.0)).xyz;\n#endif\n#endif\nfloat originalSize = project_size_to_pixel(sizeScale);\nfloat clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\nvec3 pos = (instanceModelMatrix * (sceneModelMatrix * vec4(positions, 1.0)).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\nif(composeModelMatrix) {\nDECKGL_FILTER_SIZE(pos, geometry);\ngeometry.normal = project_normal(normal);\ngeometry.worldPosition += pos;\ngl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n}\nelse {\npos = project_size(pos);\nDECKGL_FILTER_SIZE(pos, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\ngeometry.normal = project_normal(normal);\n}\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n#ifdef MODULE_PBR\npbr_vPosition = geometry.position.xyz;\n#ifdef HAS_NORMALS\npbr_vNormal = geometry.normal;\n#endif\n#ifdef HAS_UV\npbr_vUV = texCoords;\n#else\npbr_vUV = vec2(0., 0.);\n#endif\ngeometry.uv = pbr_vUV;\n#endif\nvColor = instanceColors;\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n`;\n", "export default `\\\n#version 300 es\n#define SHADER_NAME scenegraph-layer-fragment-shader\nuniform float opacity;\nin vec4 vColor;\nout vec4 fragColor;\n#ifndef MODULE_PBR\n#if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\nin vec2 vTEXCOORD_0;\nuniform sampler2D u_BaseColorSampler;\n#endif\n#endif\nvoid main(void) {\n#ifdef MODULE_PBR\nfragColor = vColor * pbr_filterColor(vec4(0));\ngeometry.uv = pbr_vUV;\n#else\n#if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\nfragColor = vColor * texture(u_BaseColorSampler, vTEXCOORD_0);\ngeometry.uv = vTEXCOORD_0;\n#else\nfragColor = vColor;\n#endif\n#endif\nfragColor.a *= opacity;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