{"version":3,"file":"index.umd.cjs","sources":["../src/core/utils/BufferAttributeUtils.js","../src/core/utils/mergeGeometries.js","../src/core/utils/GeometryPreparationUtils.js","../src/utils/bufferToHash.js","../src/core/utils/MeshDiff.js","../src/core/utils/convertToStaticGeometry.js","../src/core/utils/BakedGeometry.js","../src/core/utils/StaticGeometryGenerator.js","../src/core/PathTracingSceneGenerator.js","../src/materials/MaterialBase.js","../src/materials/fullscreen/BlendMaterial.js","../src/shader/rand/sobol.glsl.js","../src/utils/SobolNumberMapGenerator.js","../src/objects/PhysicalCamera.js","../src/uniforms/PhysicalCameraUniform.js","../src/utils/TextureUtils.js","../src/uniforms/EquirectHdrInfoUniform.js","../src/uniforms/LightsInfoUniformStruct.js","../src/uniforms/FloatAttributeTextureArray.js","../src/uniforms/AttributesTextureArray.js","../src/core/utils/sceneUpdateUtils.js","../src/uniforms/MaterialsTexture.js","../src/uniforms/RenderTarget2DArray.js","../src/uniforms/stratified/StratifiedSampler.js","../src/uniforms/stratified/StratifiedSamplerCombined.js","../src/uniforms/StratifiedSamplesTexture.js","../src/textures/blueNoise/utils.js","../src/textures/blueNoise/BlueNoiseSamples.js","../src/textures/blueNoise/BlueNoiseGenerator.js","../src/textures/BlueNoiseTexture.js","../src/shader/structs/camera_struct.glsl.js","../src/shader/structs/equirect_struct.glsl.js","../src/shader/structs/lights_struct.glsl.js","../src/shader/structs/material_struct.glsl.js","../src/shader/structs/surface_record_struct.glsl.js","../src/shader/sampling/equirect_sampling_functions.glsl.js","../src/shader/sampling/light_sampling_functions.glsl.js","../src/shader/sampling/shape_sampling_functions.glsl.js","../src/shader/common/fresnel_functions.glsl.js","../src/shader/common/math_functions.glsl.js","../src/shader/common/shape_intersection_functions.glsl.js","../src/shader/common/texture_sample_functions.glsl.js","../src/shader/common/util_functions.glsl.js","../src/shader/rand/pcg.glsl.js","../src/shader/rand/stratified.glsl.js","../src/shader/bsdf/bsdf_functions.glsl.js","../src/shader/bsdf/fog_functions.glsl.js","../src/shader/bsdf/ggx_functions.glsl.js","../src/shader/bsdf/iridescence_functions.glsl.js","../src/shader/bsdf/sheen_functions.glsl.js","../src/shader/bvh/inside_fog_volume_function.glsl.js","../src/shader/bvh/ray_any_hit_function.glsl.js","../src/materials/pathtracing/glsl/attenuate_hit_function.glsl.js","../src/materials/pathtracing/glsl/camera_util_functions.glsl.js","../src/materials/pathtracing/glsl/direct_light_contribution_function.glsl.js","../src/materials/pathtracing/glsl/get_surface_record_function.glsl.js","../src/materials/pathtracing/glsl/render_structs.glsl.js","../src/materials/pathtracing/glsl/trace_scene_function.glsl.js","../src/materials/pathtracing/PhysicalPathTracingMaterial.js","../src/core/PathTracingRenderer.js","../src/textures/ProceduralEquirectTexture.js","../src/textures/GradientEquirectTexture.js","../src/materials/fullscreen/ClampedInterpolationMaterial.js","../src/utils/CubeToEquirectGenerator.js","../src/core/WebGLPathTracer.js","../src/objects/EquirectCamera.js","../src/objects/PhysicalSpotLight.js","../src/objects/ShapedAreaLight.js","../src/utils/BlurredEnvMapGenerator.js","../src/materials/fullscreen/DenoiseMaterial.js","../src/materials/surface/FogVolumeMaterial.js","../src/index.js"],"sourcesContent":["import { BufferAttribute } from 'three';\n\n// target offset is the number of elements in the target buffer stride to skip before copying the\n// attributes contents in to.\nexport function copyAttributeContents( attr, target, targetOffset = 0 ) {\n\n\tif ( attr.isInterleavedBufferAttribute ) {\n\n\t\tconst itemSize = attr.itemSize;\n\t\tfor ( let i = 0, l = attr.count; i < l; i ++ ) {\n\n\t\t\tconst io = i + targetOffset;\n\t\t\ttarget.setX( io, attr.getX( i ) );\n\t\t\tif ( itemSize >= 2 ) target.setY( io, attr.getY( i ) );\n\t\t\tif ( itemSize >= 3 ) target.setZ( io, attr.getZ( i ) );\n\t\t\tif ( itemSize >= 4 ) target.setW( io, attr.getW( i ) );\n\n\t\t}\n\n\t} else {\n\n\t\tconst array = target.array;\n\t\tconst cons = array.constructor;\n\t\tconst byteOffset = array.BYTES_PER_ELEMENT * attr.itemSize * targetOffset;\n\t\tconst temp = new cons( array.buffer, byteOffset, attr.array.length );\n\t\ttemp.set( attr.array );\n\n\t}\n\n}\n\n// Clones the given attribute with a new compatible buffer attribute but no data\nexport function createAttributeClone( attr, countOverride = null ) {\n\n\tconst cons = attr.array.constructor;\n\tconst normalized = attr.normalized;\n\tconst itemSize = attr.itemSize;\n\tconst count = countOverride === null ? attr.count : countOverride;\n\n\treturn new BufferAttribute( new cons( itemSize * count ), itemSize, normalized );\n\n}\n\n// Confirms that the two provided attributes are compatible. Returns false if they are not.\nexport function validateAttributes( attr1, attr2 ) {\n\n\tif ( ! attr1 && ! attr2 ) {\n\n\t\treturn true;\n\n\t}\n\n\tif ( Boolean( attr1 ) !== Boolean( attr2 ) ) {\n\n\t\treturn false;\n\n\t}\n\n\tconst sameCount = attr1.count === attr2.count;\n\tconst sameNormalized = attr1.normalized === attr2.normalized;\n\tconst sameType = attr1.array.constructor === attr2.array.constructor;\n\tconst sameItemSize = attr1.itemSize === attr2.itemSize;\n\n\tif ( ! sameCount || ! sameNormalized || ! sameType || ! sameItemSize ) {\n\n\t\treturn false;\n\n\t}\n\n\treturn true;\n\n}\n","import { BufferAttribute, BufferGeometry } from 'three';\nimport { copyAttributeContents, createAttributeClone } from './BufferAttributeUtils.js';\n\nfunction validateMergeability( geometries ) {\n\n\tconst isIndexed = geometries[ 0 ].index !== null;\n\tconst attributesUsed = new Set( Object.keys( geometries[ 0 ].attributes ) );\n\tif ( ! geometries[ 0 ].getAttribute( 'position' ) ) {\n\n\t\tthrow new Error( 'StaticGeometryGenerator: position attribute is required.' );\n\n\t}\n\n\tfor ( let i = 0; i < geometries.length; ++ i ) {\n\n\t\tconst geometry = geometries[ i ];\n\t\tlet attributesCount = 0;\n\n\t\t// ensure that all geometries are indexed, or none\n\t\tif ( isIndexed !== ( geometry.index !== null ) ) {\n\n\t\t\tthrow new Error( 'StaticGeometryGenerator: All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.' );\n\n\t\t}\n\n\t\t// gather attributes, exit early if they're different\n\t\tfor ( const name in geometry.attributes ) {\n\n\t\t\tif ( ! attributesUsed.has( name ) ) {\n\n\t\t\t\tthrow new Error( 'StaticGeometryGenerator: All geometries must have compatible attributes; make sure \"' + name + '\" attribute exists among all geometries, or in none of them.' );\n\n\t\t\t}\n\n\t\t\tattributesCount ++;\n\n\t\t}\n\n\t\t// ensure geometries have the same number of attributes\n\t\tif ( attributesCount !== attributesUsed.size ) {\n\n\t\t\tthrow new Error( 'StaticGeometryGenerator: All geometries must have the same number of attributes.' );\n\n\t\t}\n\n\t}\n\n}\n\nfunction getTotalIndexCount( geometries ) {\n\n\tlet result = 0;\n\tfor ( let i = 0, l = geometries.length; i < l; i ++ ) {\n\n\t\tresult += geometries[ i ].getIndex().count;\n\n\t}\n\n\treturn result;\n\n}\n\nfunction getTotalAttributeCount( geometries ) {\n\n\tlet result = 0;\n\tfor ( let i = 0, l = geometries.length; i < l; i ++ ) {\n\n\t\tresult += geometries[ i ].getAttribute( 'position' ).count;\n\n\t}\n\n\treturn result;\n\n}\n\nfunction trimMismatchedAttributes( target, indexCount, attrCount ) {\n\n\tif ( target.index && target.index.count !== indexCount ) {\n\n\t\ttarget.setIndex( null );\n\n\t}\n\n\tconst attributes = target.attributes;\n\tfor ( const key in attributes ) {\n\n\t\tconst attr = attributes[ key ];\n\t\tif ( attr.count !== attrCount ) {\n\n\t\t\ttarget.deleteAttribute( key );\n\n\t\t}\n\n\t}\n\n}\n\n// Modified version of BufferGeometryUtils.mergeBufferGeometries that ignores morph targets and updates a attributes in place\nexport function mergeGeometries( geometries, options = {}, targetGeometry = new BufferGeometry() ) {\n\n\tconst {\n\t\tuseGroups = false,\n\t\tforceUpdate = false,\n\t\tskipAssigningAttributes = [],\n\t\toverwriteIndex = true,\n\t} = options;\n\n\t// check if we can merge these geometries\n\tvalidateMergeability( geometries );\n\n\tconst isIndexed = geometries[ 0 ].index !== null;\n\tconst totalIndexCount = isIndexed ? getTotalIndexCount( geometries ) : - 1;\n\tconst totalAttributeCount = getTotalAttributeCount( geometries );\n\ttrimMismatchedAttributes( targetGeometry, totalIndexCount, totalAttributeCount );\n\n\t// set up groups\n\tif ( useGroups ) {\n\n\t\tlet offset = 0;\n\t\tfor ( let i = 0, l = geometries.length; i < l; i ++ ) {\n\n\t\t\tconst geometry = geometries[ i ];\n\n\t\t\tlet primitiveCount;\n\t\t\tif ( isIndexed ) {\n\n\t\t\t\tprimitiveCount = geometry.getIndex().count;\n\n\t\t\t} else {\n\n\t\t\t\tprimitiveCount = geometry.getAttribute( 'position' ).count;\n\n\t\t\t}\n\n\t\t\ttargetGeometry.addGroup( offset, primitiveCount, i );\n\t\t\toffset += primitiveCount;\n\n\t\t}\n\n\t}\n\n\t// generate the final geometry\n\t// skip the assigning any attributes for items in the above array\n\tif ( isIndexed ) {\n\n\t\t// set up the index if it doesn't exist\n\t\tlet forceUpdateIndex = false;\n\t\tif ( ! targetGeometry.index ) {\n\n\t\t\ttargetGeometry.setIndex( new BufferAttribute( new Uint32Array( totalIndexCount ), 1, false ) );\n\t\t\tforceUpdateIndex = true;\n\n\t\t}\n\n\t\tif ( forceUpdateIndex || overwriteIndex ) {\n\n\t\t\t// copy the index data to the target geometry\n\t\t\tlet targetOffset = 0;\n\t\t\tlet indexOffset = 0;\n\t\t\tconst targetIndex = targetGeometry.getIndex();\n\t\t\tfor ( let i = 0, l = geometries.length; i < l; i ++ ) {\n\n\t\t\t\tconst geometry = geometries[ i ];\n\t\t\t\tconst index = geometry.getIndex();\n\t\t\t\tconst skip = ! forceUpdate && ! forceUpdateIndex && skipAssigningAttributes[ i ];\n\t\t\t\tif ( ! skip ) {\n\n\t\t\t\t\tfor ( let j = 0; j < index.count; ++ j ) {\n\n\t\t\t\t\t\ttargetIndex.setX( targetOffset + j, index.getX( j ) + indexOffset );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\ttargetOffset += index.count;\n\t\t\t\tindexOffset += geometry.getAttribute( 'position' ).count;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t// copy all the attribute data over\n\tconst attributes = Object.keys( geometries[ 0 ].attributes );\n\tfor ( let i = 0, l = attributes.length; i < l; i ++ ) {\n\n\t\tlet forceUpdateAttr = false;\n\t\tconst key = attributes[ i ];\n\t\tif ( ! targetGeometry.getAttribute( key ) ) {\n\n\t\t\tconst firstAttr = geometries[ 0 ].getAttribute( key );\n\t\t\ttargetGeometry.setAttribute( key, createAttributeClone( firstAttr, totalAttributeCount ) );\n\t\t\tforceUpdateAttr = true;\n\n\t\t}\n\n\t\tlet offset = 0;\n\t\tconst targetAttribute = targetGeometry.getAttribute( key );\n\t\tfor ( let g = 0, l = geometries.length; g < l; g ++ ) {\n\n\t\t\tconst geometry = geometries[ g ];\n\t\t\tconst skip = ! forceUpdate && ! forceUpdateAttr && skipAssigningAttributes[ g ];\n\t\t\tconst attr = geometry.getAttribute( key );\n \t\t\tif ( ! skip ) {\n\n\t\t\t\tif ( key === 'color' && targetAttribute.itemSize !== attr.itemSize ) {\n\n\t\t\t\t\t// make sure the color attribute is aligned with itemSize 3 to 4\n\t\t\t\t\tfor ( let index = offset, l = attr.count; index < l; index ++ ) {\n\n\t\t\t\t\t\tattr.setXYZW( index, targetAttribute.getX( index ), targetAttribute.getY( index ), targetAttribute.getZ( index ), 1.0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tcopyAttributeContents( attr, targetAttribute, offset );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\toffset += attr.count;\n\n\t\t}\n\n\t}\n\n}\n","import { BufferAttribute } from 'three';\n\nexport function updateMaterialIndexAttribute( geometry, materials, allMaterials ) {\n\n\tconst indexAttr = geometry.index;\n\tconst posAttr = geometry.attributes.position;\n\tconst vertCount = posAttr.count;\n\tconst totalCount = indexAttr ? indexAttr.count : vertCount;\n\tlet groups = geometry.groups;\n\tif ( groups.length === 0 ) {\n\n\t\tgroups = [ { count: totalCount, start: 0, materialIndex: 0 } ];\n\n\t}\n\n\tlet materialIndexAttribute = geometry.getAttribute( 'materialIndex' );\n\tif ( ! materialIndexAttribute || materialIndexAttribute.count !== vertCount ) {\n\n\t\t// use an array with the minimum precision required to store all material id references.\n\t\tlet array;\n\t\tif ( allMaterials.length <= 255 ) {\n\n\t\t\tarray = new Uint8Array( vertCount );\n\n\t\t} else {\n\n\t\t\tarray = new Uint16Array( vertCount );\n\n\t\t}\n\n\t\tmaterialIndexAttribute = new BufferAttribute( array, 1, false );\n\t\tgeometry.deleteAttribute( 'materialIndex' );\n\t\tgeometry.setAttribute( 'materialIndex', materialIndexAttribute );\n\n\t}\n\n\tconst materialArray = materialIndexAttribute.array;\n\tfor ( let i = 0; i < groups.length; i ++ ) {\n\n\t\tconst group = groups[ i ];\n\t\tconst start = group.start;\n\t\tconst count = group.count;\n\t\tconst endCount = Math.min( count, totalCount - start );\n\n\t\tconst mat = Array.isArray( materials ) ? materials[ group.materialIndex ] : materials;\n\t\tconst materialIndex = allMaterials.indexOf( mat );\n\n\t\tfor ( let j = 0; j < endCount; j ++ ) {\n\n\t\t\tlet index = start + j;\n\t\t\tif ( indexAttr ) {\n\n\t\t\t\tindex = indexAttr.getX( index );\n\n\t\t\t}\n\n\t\t\tmaterialArray[ index ] = materialIndex;\n\n\t\t}\n\n\t}\n\n}\n\nexport function setCommonAttributes( geometry, attributes ) {\n\n\tif ( ! geometry.index ) {\n\n\t\t// TODO: compute a typed array\n\t\tconst indexCount = geometry.attributes.position.count;\n\t\tconst array = new Array( indexCount );\n\t\tfor ( let i = 0; i < indexCount; i ++ ) {\n\n\t\t\tarray[ i ] = i;\n\n\t\t}\n\n\t\tgeometry.setIndex( array );\n\n\t}\n\n\tif ( ! geometry.attributes.normal && ( attributes && attributes.includes( 'normal' ) ) ) {\n\n\t\tgeometry.computeVertexNormals();\n\n\t}\n\n\tif ( ! geometry.attributes.uv && ( attributes && attributes.includes( 'uv' ) ) ) {\n\n\t\tconst vertCount = geometry.attributes.position.count;\n\t\tgeometry.setAttribute( 'uv', new BufferAttribute( new Float32Array( vertCount * 2 ), 2, false ) );\n\n\t}\n\n\tif ( ! geometry.attributes.uv2 && ( attributes && attributes.includes( 'uv2' ) ) ) {\n\n\t\tconst vertCount = geometry.attributes.position.count;\n\t\tgeometry.setAttribute( 'uv2', new BufferAttribute( new Float32Array( vertCount * 2 ), 2, false ) );\n\n\t}\n\n\tif ( ! geometry.attributes.tangent && ( attributes && attributes.includes( 'tangent' ) ) ) {\n\n\t\t// compute tangents requires a uv and normal buffer\n\t\tif ( geometry.attributes.uv && geometry.attributes.normal ) {\n\n\t\t\tgeometry.computeTangents();\n\n\t\t} else {\n\n\t\t\tconst vertCount = geometry.attributes.position.count;\n\t\t\tgeometry.setAttribute( 'tangent', new BufferAttribute( new Float32Array( vertCount * 4 ), 4, false ) );\n\n\t\t}\n\n\t}\n\n\tif ( ! geometry.attributes.color && ( attributes && attributes.includes( 'color' ) ) ) {\n\n\t\tconst vertCount = geometry.attributes.position.count;\n\t\tconst array = new Float32Array( vertCount * 4 );\n\t\tarray.fill( 1.0 );\n\t\tgeometry.setAttribute( 'color', new BufferAttribute( array, 4 ) );\n\n\t}\n\n}\n","// https://www.geeksforgeeks.org/how-to-create-hash-from-string-in-javascript/\n// https://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript\nexport function bufferToHash( buffer ) {\n\n\tlet hash = 0;\n\n\tif ( buffer.byteLength !== 0 ) {\n\n\t\tconst uintArray = new Uint8Array( buffer );\n\t\tfor ( let i = 0; i < buffer.byteLength; i ++ ) {\n\n\t\t\tconst byte = uintArray[ i ];\n\t\t\thash = ( ( hash << 5 ) - hash ) + byte;\n\t\t\thash |= 0;\n\n\t\t}\n\n\t}\n\n\treturn hash;\n\n}\n","import { Matrix4 } from 'three';\nimport { bufferToHash } from '../../utils/bufferToHash.js';\n\nfunction getGeometryHash( geometry ) {\n\n\tlet hash = geometry.uuid;\n\tconst attributes = Object.values( geometry.attributes );\n\tif ( geometry.index ) {\n\n\t\tattributes.push( geometry.index );\n\t\thash += `index|${ geometry.index.version }`;\n\n\t}\n\n\tconst keys = Object.keys( attributes ).sort();\n\tfor ( const key of keys ) {\n\n\t\tconst attr = attributes[ key ];\n\t\thash += `${ key }_${ attr.version }|`;\n\n\t}\n\n\treturn hash;\n\n}\n\nfunction getSkeletonHash( mesh ) {\n\n\tconst skeleton = mesh.skeleton;\n\tif ( skeleton ) {\n\n\t\tif ( ! skeleton.boneTexture ) {\n\n\t\t\tskeleton.computeBoneTexture();\n\n\t\t}\n\n\t\t// we can't use the texture version here because it will change even\n\t\t// when the bones haven't\n\t\tconst dataHash = bufferToHash( skeleton.boneTexture.image.data.buffer );\n\t\treturn `${ dataHash }_${ skeleton.boneTexture.uuid }`;\n\n\t} else {\n\n\t\treturn null;\n\n\t}\n\n}\n\n// Checks whether the geometry changed between this and last evaluation\nexport class MeshDiff {\n\n\tconstructor( mesh = null ) {\n\n\t\tthis.matrixWorld = new Matrix4();\n\t\tthis.geometryHash = null;\n\t\tthis.skeletonHash = null;\n\t\tthis.primitiveCount = - 1;\n\n\t\tif ( mesh !== null ) {\n\n\t\t\tthis.updateFrom( mesh );\n\n\t\t}\n\n\t}\n\n\tupdateFrom( mesh ) {\n\n\t\tconst geometry = mesh.geometry;\n\t\tconst primitiveCount = ( geometry.index ? geometry.index.count : geometry.attributes.position.count ) / 3;\n\t\tthis.matrixWorld.copy( mesh.matrixWorld );\n\t\tthis.geometryHash = getGeometryHash( geometry );\n\t\tthis.primitiveCount = primitiveCount;\n\t\tthis.skeletonHash = getSkeletonHash( mesh );\n\n\t}\n\n\tdidChange( mesh ) {\n\n\t\tconst geometry = mesh.geometry;\n\t\tconst primitiveCount = ( geometry.index ? geometry.index.count : geometry.attributes.position.count ) / 3;\n\n\t\tconst identical =\n\t\t\tthis.matrixWorld.equals( mesh.matrixWorld ) &&\n\t\t\tthis.geometryHash === getGeometryHash( geometry ) &&\n\t\t\tthis.skeletonHash === getSkeletonHash( mesh ) &&\n\t\t\tthis.primitiveCount === primitiveCount;\n\n\t\treturn ! identical;\n\n\t}\n\n}\n","import { BufferGeometry, Matrix3, Matrix4, Vector3, Vector4 } from 'three';\nimport { copyAttributeContents, createAttributeClone, validateAttributes } from './BufferAttributeUtils.js';\n\nconst _positionVector = /*@__PURE__*/ new Vector3();\nconst _normalVector = /*@__PURE__*/ new Vector3();\nconst _tangentVector = /*@__PURE__*/ new Vector3();\nconst _tangentVector4 = /*@__PURE__*/ new Vector4();\n\nconst _morphVector = /*@__PURE__*/ new Vector3();\nconst _temp = /*@__PURE__*/ new Vector3();\n\nconst _skinIndex = /*@__PURE__*/ new Vector4();\nconst _skinWeight = /*@__PURE__*/ new Vector4();\nconst _matrix = /*@__PURE__*/ new Matrix4();\nconst _boneMatrix = /*@__PURE__*/ new Matrix4();\n\n// A version of \"SkinnedMesh.boneTransform\" for normals\nfunction boneNormalTransform( mesh, index, target ) {\n\n\tconst skeleton = mesh.skeleton;\n\tconst geometry = mesh.geometry;\n\tconst bones = skeleton.bones;\n\tconst boneInverses = skeleton.boneInverses;\n\n\t_skinIndex.fromBufferAttribute( geometry.attributes.skinIndex, index );\n\t_skinWeight.fromBufferAttribute( geometry.attributes.skinWeight, index );\n\n\t_matrix.elements.fill( 0 );\n\n\tfor ( let i = 0; i < 4; i ++ ) {\n\n\t\tconst weight = _skinWeight.getComponent( i );\n\n\t\tif ( weight !== 0 ) {\n\n\t\t\tconst boneIndex = _skinIndex.getComponent( i );\n\t\t\t_boneMatrix.multiplyMatrices( bones[ boneIndex ].matrixWorld, boneInverses[ boneIndex ] );\n\n\t\t\taddScaledMatrix( _matrix, _boneMatrix, weight );\n\n\t\t}\n\n\t}\n\n\t_matrix.multiply( mesh.bindMatrix ).premultiply( mesh.bindMatrixInverse );\n\ttarget.transformDirection( _matrix );\n\n\treturn target;\n\n}\n\n// Applies the morph target data to the target vector\nfunction applyMorphTarget( morphData, morphInfluences, morphTargetsRelative, i, target ) {\n\n\t_morphVector.set( 0, 0, 0 );\n\tfor ( let j = 0, jl = morphData.length; j < jl; j ++ ) {\n\n\t\tconst influence = morphInfluences[ j ];\n\t\tconst morphAttribute = morphData[ j ];\n\n\t\tif ( influence === 0 ) continue;\n\n\t\t_temp.fromBufferAttribute( morphAttribute, i );\n\n\t\tif ( morphTargetsRelative ) {\n\n\t\t\t_morphVector.addScaledVector( _temp, influence );\n\n\t\t} else {\n\n\t\t\t_morphVector.addScaledVector( _temp.sub( target ), influence );\n\n\t\t}\n\n\t}\n\n\ttarget.add( _morphVector );\n\n}\n\n// Adds the \"matrix\" multiplied by \"scale\" to \"target\"\nfunction addScaledMatrix( target, matrix, scale ) {\n\n\tconst targetArray = target.elements;\n\tconst matrixArray = matrix.elements;\n\tfor ( let i = 0, l = matrixArray.length; i < l; i ++ ) {\n\n\t\ttargetArray[ i ] += matrixArray[ i ] * scale;\n\n\t}\n\n}\n\n// inverts the geometry in place\nfunction invertGeometry( geometry ) {\n\n\tconst { index, attributes } = geometry;\n\tif ( index ) {\n\n\t\tfor ( let i = 0, l = index.count; i < l; i += 3 ) {\n\n\t\t\tconst v0 = index.getX( i );\n\t\t\tconst v2 = index.getX( i + 2 );\n\t\t\tindex.setX( i, v2 );\n\t\t\tindex.setX( i + 2, v0 );\n\n\t\t}\n\n\t} else {\n\n\t\tfor ( const key in attributes ) {\n\n\t\t\tconst attr = attributes[ key ];\n\t\t\tconst itemSize = attr.itemSize;\n\t\t\tfor ( let i = 0, l = attr.count; i < l; i += 3 ) {\n\n\t\t\t\tfor ( let j = 0; j < itemSize; j ++ ) {\n\n\t\t\t\t\tconst v0 = attr.getComponent( i, j );\n\t\t\t\t\tconst v2 = attr.getComponent( i + 2, j );\n\t\t\t\t\tattr.setComponent( i, j, v2 );\n\t\t\t\t\tattr.setComponent( i + 2, j, v0 );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn geometry;\n\n}\n\nexport function convertToStaticGeometry( mesh, options = {}, targetGeometry = new BufferGeometry() ) {\n\n\toptions = {\n\t\tapplyWorldTransforms: true,\n\t\tattributes: [],\n\t\t...options\n\t};\n\n\tconst geometry = mesh.geometry;\n\tconst applyWorldTransforms = options.applyWorldTransforms;\n\tconst includeNormal = options.attributes.includes( 'normal' );\n\tconst includeTangent = options.attributes.includes( 'tangent' );\n\tconst attributes = geometry.attributes;\n\tconst targetAttributes = targetGeometry.attributes;\n\n\t// strip any unused and unneeded attributes\n\tfor ( const key in targetGeometry.attributes ) {\n\n\t\tif ( ! options.attributes.includes( key ) || ! ( key in geometry.attributes ) ) {\n\n\t\t\ttargetGeometry.deleteAttribute( key );\n\n\t\t}\n\n\t}\n\n\t// initialize the attributes if they don't exist\n\tif ( ! targetGeometry.index && geometry.index ) {\n\n\t\ttargetGeometry.index = geometry.index.clone();\n\n\t}\n\n\tif ( ! targetAttributes.position ) {\n\n\t\ttargetGeometry.setAttribute( 'position', createAttributeClone( attributes.position ) );\n\n\t}\n\n\tif ( includeNormal && ! targetAttributes.normal && attributes.normal ) {\n\n\t\ttargetGeometry.setAttribute( 'normal', createAttributeClone( attributes.normal ) );\n\n\t}\n\n\tif ( includeTangent && ! targetAttributes.tangent && attributes.tangent ) {\n\n\t\ttargetGeometry.setAttribute( 'tangent', createAttributeClone( attributes.tangent ) );\n\n\t}\n\n\t// ensure the attributes are consistent\n\tvalidateAttributes( geometry.index, targetGeometry.index );\n\tvalidateAttributes( attributes.position, targetAttributes.position );\n\n\tif ( includeNormal ) {\n\n\t\tvalidateAttributes( attributes.normal, targetAttributes.normal );\n\n\t}\n\n\tif ( includeTangent ) {\n\n\t\tvalidateAttributes( attributes.tangent, targetAttributes.tangent );\n\n\t}\n\n\t// generate transformed vertex attribute data\n\tconst position = attributes.position;\n\tconst normal = includeNormal ? attributes.normal : null;\n\tconst tangent = includeTangent ? attributes.tangent : null;\n\tconst morphPosition = geometry.morphAttributes.position;\n\tconst morphNormal = geometry.morphAttributes.normal;\n\tconst morphTangent = geometry.morphAttributes.tangent;\n\tconst morphTargetsRelative = geometry.morphTargetsRelative;\n\tconst morphInfluences = mesh.morphTargetInfluences;\n\tconst normalMatrix = new Matrix3();\n\tnormalMatrix.getNormalMatrix( mesh.matrixWorld );\n\n\t// copy the index\n\tif ( geometry.index ) {\n\n\t\ttargetGeometry.index.array.set( geometry.index.array );\n\n\t}\n\n\t// copy and apply other attributes\n\tfor ( let i = 0, l = attributes.position.count; i < l; i ++ ) {\n\n\t\t_positionVector.fromBufferAttribute( position, i );\n\t\tif ( normal ) {\n\n\t\t\t_normalVector.fromBufferAttribute( normal, i );\n\n\t\t}\n\n\t\tif ( tangent ) {\n\n\t\t\t_tangentVector4.fromBufferAttribute( tangent, i );\n\t\t\t_tangentVector.fromBufferAttribute( tangent, i );\n\n\t\t}\n\n\t\t// apply morph target transform\n\t\tif ( morphInfluences ) {\n\n\t\t\tif ( morphPosition ) {\n\n\t\t\t\tapplyMorphTarget( morphPosition, morphInfluences, morphTargetsRelative, i, _positionVector );\n\n\t\t\t}\n\n\t\t\tif ( morphNormal ) {\n\n\t\t\t\tapplyMorphTarget( morphNormal, morphInfluences, morphTargetsRelative, i, _normalVector );\n\n\t\t\t}\n\n\t\t\tif ( morphTangent ) {\n\n\t\t\t\tapplyMorphTarget( morphTangent, morphInfluences, morphTargetsRelative, i, _tangentVector );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// apply bone transform\n\t\tif ( mesh.isSkinnedMesh ) {\n\n\t\t\tmesh.applyBoneTransform( i, _positionVector );\n\t\t\tif ( normal ) {\n\n\t\t\t\tboneNormalTransform( mesh, i, _normalVector );\n\n\t\t\t}\n\n\t\t\tif ( tangent ) {\n\n\t\t\t\tboneNormalTransform( mesh, i, _tangentVector );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// update the vectors of the attributes\n\t\tif ( applyWorldTransforms ) {\n\n\t\t\t_positionVector.applyMatrix4( mesh.matrixWorld );\n\n\t\t}\n\n\t\ttargetAttributes.position.setXYZ( i, _positionVector.x, _positionVector.y, _positionVector.z );\n\n\t\tif ( normal ) {\n\n\t\t\tif ( applyWorldTransforms ) {\n\n\t\t\t\t_normalVector.applyNormalMatrix( normalMatrix );\n\n\t\t\t}\n\n\t\t\ttargetAttributes.normal.setXYZ( i, _normalVector.x, _normalVector.y, _normalVector.z );\n\n\t\t}\n\n\t\tif ( tangent ) {\n\n\t\t\tif ( applyWorldTransforms ) {\n\n\t\t\t\t_tangentVector.transformDirection( mesh.matrixWorld );\n\n\t\t\t}\n\n\t\t\ttargetAttributes.tangent.setXYZW( i, _tangentVector.x, _tangentVector.y, _tangentVector.z, _tangentVector4.w );\n\n\t\t}\n\n\t}\n\n\t// copy other attributes over\n\tfor ( const i in options.attributes ) {\n\n\t\tconst key = options.attributes[ i ];\n\t\tif ( key === 'position' || key === 'tangent' || key === 'normal' || ! ( key in attributes ) ) {\n\n\t\t\tcontinue;\n\n\t\t}\n\n\t\tif ( ! targetAttributes[ key ] ) {\n\n\t\t\ttargetGeometry.setAttribute( key, createAttributeClone( attributes[ key ] ) );\n\n\t\t}\n\n\t\tvalidateAttributes( attributes[ key ], targetAttributes[ key ] );\n\t\tcopyAttributeContents( attributes[ key ], targetAttributes[ key ] );\n\n\t}\n\n\tif ( mesh.matrixWorld.determinant() < 0 ) {\n\n\t\tinvertGeometry( targetGeometry );\n\n\t}\n\n\treturn targetGeometry;\n\n}\n","import { BufferGeometry } from 'three';\nimport { MeshDiff } from './MeshDiff.js';\nimport { convertToStaticGeometry } from './convertToStaticGeometry.js';\nimport { validateAttributes } from './BufferAttributeUtils.js';\n\nexport class BakedGeometry extends BufferGeometry {\n\n\tconstructor() {\n\n\t\tsuper();\n\t\tthis.version = 0;\n\t\tthis.hash = null;\n\t\tthis._diff = new MeshDiff();\n\n\t}\n\n\t// returns whether the passed mesh is compatible with this baked geometry\n\t// such that it can be updated without resizing attributes\n\tisCompatible( mesh, attributes ) {\n\n\t\tconst geometry = mesh.geometry;\n\t\tfor ( let i = 0; i < attributes.length; i ++ ) {\n\n\t\t\tconst key = attributes[ i ];\n\t\t\tconst attr1 = geometry.attributes[ key ];\n\t\t\tconst attr2 = this.attributes[ key ];\n\t\t\tif ( attr1 && ! validateAttributes( attr1, attr2 ) ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\tupdateFrom( mesh, options ) {\n\n\t\tconst diff = this._diff;\n\t\tif ( diff.didChange( mesh ) ) {\n\n\t\t\tconvertToStaticGeometry( mesh, options, this );\n\t\t\tdiff.updateFrom( mesh );\n\t\t\tthis.version ++;\n\t\t\tthis.hash = `${ this.uuid }_${ this.version }`;\n\t\t\treturn true;\n\n\t\t} else {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t}\n\n}\n","import { BufferAttribute, BufferGeometry, Mesh, MeshBasicMaterial } from 'three';\nimport { mergeGeometries } from './mergeGeometries.js';\nimport { setCommonAttributes } from './GeometryPreparationUtils.js';\nimport { BakedGeometry } from './BakedGeometry.js';\n\nexport const NO_CHANGE = 0;\nexport const GEOMETRY_ADJUSTED = 1;\nexport const GEOMETRY_REBUILT = 2;\n\n// iterate over only the meshes in the provided objects\nfunction flatTraverseMeshes( objects, cb ) {\n\n\tfor ( let i = 0, l = objects.length; i < l; i ++ ) {\n\n\t\tconst object = objects[ i ];\n\t\tobject.traverseVisible( o => {\n\n\t\t\tif ( o.isMesh ) {\n\n\t\t\t\tcb( o );\n\n\t\t\t}\n\n\t\t} );\n\n\t}\n\n}\n\n// return the set of materials used by the provided meshes\nfunction getMaterials( meshes ) {\n\n\tconst materials = [];\n\tfor ( let i = 0, l = meshes.length; i < l; i ++ ) {\n\n\t\tconst mesh = meshes[ i ];\n\t\tif ( Array.isArray( mesh.material ) ) {\n\n\t\t\tmaterials.push( ...mesh.material );\n\n\t\t} else {\n\n\t\t\tmaterials.push( mesh.material );\n\n\t\t}\n\n\t}\n\n\treturn materials;\n\n}\n\nfunction mergeGeometryList( geometries, target, options ) {\n\n\t// If we have no geometry to merge then provide an empty geometry.\n\tif ( geometries.length === 0 ) {\n\n\t\t// if there are no geometries then just create a fake empty geometry to provide\n\t\ttarget.setIndex( null );\n\n\t\t// remove all geometry\n\t\tconst attrs = target.attributes;\n\t\tfor ( const key in attrs ) {\n\n\t\t\ttarget.deleteAttribute( key );\n\n\t\t}\n\n\t\t// create dummy attributes\n\t\tfor ( const key in options.attributes ) {\n\n\t\t\ttarget.setAttribute( options.attributes[ key ], new BufferAttribute( new Float32Array( 0 ), 4, false ) );\n\n\t\t}\n\n\t} else {\n\n\t\tmergeGeometries( geometries, options, target );\n\n\t}\n\n\t// Mark all attributes as needing an update\n\tfor ( const key in target.attributes ) {\n\n\t\ttarget.attributes[ key ].needsUpdate = true;\n\n\t}\n\n}\n\n\nexport class StaticGeometryGenerator {\n\n\tconstructor( objects ) {\n\n\t\tthis.objects = null;\n\t\tthis.useGroups = true;\n\t\tthis.applyWorldTransforms = true;\n\t\tthis.generateMissingAttributes = true;\n\t\tthis.overwriteIndex = true;\n\t\tthis.attributes = [ 'position', 'normal', 'color', 'tangent', 'uv', 'uv2' ];\n\t\tthis._intermediateGeometry = new Map();\n\t\tthis._geometryMergeSets = new WeakMap();\n\t\tthis._mergeOrder = [];\n\t\tthis._dummyMesh = null;\n\n\t\tthis.setObjects( objects || [] );\n\n\t}\n\n\t_getDummyMesh() {\n\n\t\t// return a consistent dummy mesh\n\t\tif ( ! this._dummyMesh ) {\n\n\t\t\tconst dummyMaterial = new MeshBasicMaterial();\n\t\t\tconst emptyGeometry = new BufferGeometry();\n\t\t\temptyGeometry.setAttribute( 'position', new BufferAttribute( new Float32Array( 9 ), 3 ) );\n\t\t\tthis._dummyMesh = new Mesh( emptyGeometry, dummyMaterial );\n\n\t\t}\n\n\t\treturn this._dummyMesh;\n\n\t}\n\n\t_getMeshes() {\n\n\t\t// iterate over only the meshes in the provided objects\n\t\tconst meshes = [];\n\t\tflatTraverseMeshes( this.objects, mesh => {\n\n\t\t\tmeshes.push( mesh );\n\n\t\t} );\n\n\t\t// Sort the geometry so it's in a reliable order\n\t\tmeshes.sort( ( a, b ) => {\n\n\t\t\tif ( a.uuid > b.uuid ) return 1;\n\t\t\tif ( a.uuid < b.uuid ) return - 1;\n\t\t\treturn 0;\n\n\t\t} );\n\n\t\tif ( meshes.length === 0 ) {\n\n\t\t\tmeshes.push( this._getDummyMesh() );\n\n\t\t}\n\n\t\treturn meshes;\n\n\t}\n\n\t_updateIntermediateGeometries() {\n\n\t\tconst { _intermediateGeometry } = this;\n\n\t\tconst meshes = this._getMeshes();\n\t\tconst unusedMeshKeys = new Set( _intermediateGeometry.keys() );\n\t\tconst convertOptions = {\n\t\t\tattributes: this.attributes,\n\t\t\tapplyWorldTransforms: this.applyWorldTransforms,\n\t\t};\n\n\t\tfor ( let i = 0, l = meshes.length; i < l; i ++ ) {\n\n\t\t\tconst mesh = meshes[ i ];\n\t\t\tconst meshKey = mesh.uuid;\n\t\t\tunusedMeshKeys.delete( meshKey );\n\n\t\t\t// initialize the intermediate geometry\n\t\t\t// if the mesh and source geometry have changed in such a way that they are no longer\n\t\t\t// compatible then regenerate the baked geometry from scratch\n\t\t\tlet geom = _intermediateGeometry.get( meshKey );\n\t\t\tif ( ! geom || ! geom.isCompatible( mesh, this.attributes ) ) {\n\n\t\t\t\tif ( geom ) {\n\n\t\t\t\t\tgeom.dispose();\n\n\t\t\t\t}\n\n\t\t\t\tgeom = new BakedGeometry();\n\t\t\t\t_intermediateGeometry.set( meshKey, geom );\n\n\t\t\t}\n\n\t\t\t// transform the geometry into the intermediate buffer geometry, saving whether\n\t\t\t// or not it changed.\n\t\t\tif ( geom.updateFrom( mesh, convertOptions ) ) {\n\n\t\t\t\t// TODO: provide option for only generating the set of attributes that are present\n\t\t\t\t// and are in the attributes array\n\t\t\t\tif ( this.generateMissingAttributes ) {\n\n\t\t\t\t\tsetCommonAttributes( geom, this.attributes );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tunusedMeshKeys.forEach( key => {\n\n\t\t\t_intermediateGeometry.delete( key );\n\n\t\t} );\n\n\t}\n\n\tsetObjects( objects ) {\n\n\t\tif ( Array.isArray( objects ) ) {\n\n\t\t\tthis.objects = [ ...objects ];\n\n\t\t} else {\n\n\t\t\tthis.objects = [ objects ];\n\n\t\t}\n\n\t}\n\n\tgenerate( targetGeometry = new BufferGeometry() ) {\n\n\t\t// track which attributes have been updated and which to skip to avoid unnecessary attribute copies\n\t\tconst { useGroups, overwriteIndex, _intermediateGeometry, _geometryMergeSets } = this;\n\n\t\tconst meshes = this._getMeshes();\n\t\tconst skipAssigningAttributes = [];\n\t\tconst mergeGeometry = [];\n\t\tconst previousMergeInfo = _geometryMergeSets.get( targetGeometry ) || [];\n\n\t\t// update all the intermediate static geometry representations\n\t\tthis._updateIntermediateGeometries();\n\n\t\t// get the list of geometries to merge\n\t\tlet forceUpdate = false;\n\t\tif ( meshes.length !== previousMergeInfo.length ) {\n\n\t\t\tforceUpdate = true;\n\n\t\t}\n\n\t\tfor ( let i = 0, l = meshes.length; i < l; i ++ ) {\n\n\t\t\tconst mesh = meshes[ i ];\n\t\t\tconst geom = _intermediateGeometry.get( mesh.uuid );\n\t\t\tmergeGeometry.push( geom );\n\n\t\t\tconst info = previousMergeInfo[ i ];\n\t\t\tif ( ! info || info.uuid !== geom.uuid ) {\n\n\t\t\t\tskipAssigningAttributes.push( false );\n\t\t\t\tforceUpdate = true;\n\n\t\t\t} else if ( info.version !== geom.version ) {\n\n\t\t\t\tskipAssigningAttributes.push( false );\n\n\t\t\t} else {\n\n\t\t\t\tskipAssigningAttributes.push( true );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// If we have no geometry to merge then provide an empty geometry.\n\t\tmergeGeometryList( mergeGeometry, targetGeometry, { useGroups, forceUpdate, skipAssigningAttributes, overwriteIndex } );\n\n\t\t// force update means the attribute buffer lengths have changed\n\t\tif ( forceUpdate ) {\n\n\t\t\ttargetGeometry.dispose();\n\n\t\t}\n\n\t\t_geometryMergeSets.set( targetGeometry, mergeGeometry.map( g => ( {\n\t\t\tversion: g.version,\n\t\t\tuuid: g.uuid,\n\t\t} ) ) );\n\n\t\tlet changeType = NO_CHANGE;\n\t\tif ( forceUpdate ) changeType = GEOMETRY_REBUILT;\n\t\telse if ( skipAssigningAttributes.includes( false ) ) changeType = GEOMETRY_ADJUSTED;\n\n\t\treturn {\n\t\t\tchangeType,\n\t\t\tmaterials: getMaterials( meshes ),\n\t\t\tgeometry: targetGeometry,\n\t\t};\n\n\t}\n\n}\n","import { BufferGeometry } from 'three';\nimport { MeshBVH, SAH } from 'three-mesh-bvh';\nimport { StaticGeometryGenerator, NO_CHANGE, GEOMETRY_ADJUSTED, GEOMETRY_REBUILT } from './utils/StaticGeometryGenerator.js';\nimport { updateMaterialIndexAttribute } from './utils/GeometryPreparationUtils.js';\n\n// collect the textures from the materials\nfunction getTextures( materials ) {\n\n\tconst textureSet = new Set();\n\tfor ( let i = 0, l = materials.length; i < l; i ++ ) {\n\n\t\tconst material = materials[ i ];\n\t\tfor ( const key in material ) {\n\n\t\t\tconst value = material[ key ];\n\t\t\tif ( value && value.isTexture ) {\n\n\t\t\t\ttextureSet.add( value );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn Array.from( textureSet );\n\n}\n\n// collect the lights in the scene\nfunction getLights( objects ) {\n\n\tconst lights = [];\n\tconst iesSet = new Set();\n\tfor ( let i = 0, l = objects.length; i < l; i ++ ) {\n\n\t\tobjects[ i ].traverse( c => {\n\n\t\t\tif ( c.visible ) {\n\n\t\t\t\tif (\n\t\t\t\t\tc.isRectAreaLight ||\n\t\t\t\t\tc.isSpotLight ||\n\t\t\t\t\tc.isPointLight ||\n\t\t\t\t\tc.isDirectionalLight\n\t\t\t\t) {\n\n\t\t\t\t\tlights.push( c );\n\n\t\t\t\t\tif ( c.iesMap ) {\n\n\t\t\t\t\t\tiesSet.add( c.iesMap );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} );\n\n\t}\n\n\tconst iesTextures = Array.from( iesSet ).sort( ( a, b ) => {\n\n\t\tif ( a.uuid < b.uuid ) return 1;\n\t\tif ( a.uuid > b.uuid ) return - 1;\n\t\treturn 0;\n\n\t} );\n\n\treturn { lights, iesTextures };\n\n}\n\nexport class PathTracingSceneGenerator {\n\n\tget initialized() {\n\n\t\treturn Boolean( this.bvh );\n\n\t}\n\n\tconstructor( objects ) {\n\n\t\t// options\n\t\tthis.bvhOptions = {};\n\t\tthis.attributes = [ 'position', 'normal', 'tangent', 'color', 'uv', 'uv2' ];\n\t\tthis.generateBVH = true;\n\n\t\t// state\n\t\tthis.bvh = null;\n\t\tthis.geometry = new BufferGeometry();\n\t\tthis.staticGeometryGenerator = new StaticGeometryGenerator( objects );\n\t\tthis._bvhWorker = null;\n\t\tthis._pendingGenerate = null;\n\t\tthis._buildAsync = false;\n\t\tthis._materialUuids = null;\n\n\t}\n\n\tsetObjects( objects ) {\n\n\t\tthis.staticGeometryGenerator.setObjects( objects );\n\n\t}\n\n\tsetBVHWorker( bvhWorker ) {\n\n\t\tthis._bvhWorker = bvhWorker;\n\n\t}\n\n\tasync generateAsync( onProgress = null ) {\n\n\t\tif ( ! this._bvhWorker ) {\n\n\t\t\tthrow new Error( 'PathTracingSceneGenerator: \"setBVHWorker\" must be called before \"generateAsync\" can be called.' );\n\n\t\t}\n\n\t\tif ( this.bvh instanceof Promise ) {\n\n\t\t\t// if a bvh is already being generated we can wait for that to finish\n\t\t\t// and build another with the latest data while sharing the results.\n\t\t\tif ( ! this._pendingGenerate ) {\n\n\t\t\t\tthis._pendingGenerate = new Promise( async () => {\n\n\t\t\t\t\tawait this.bvh;\n\t\t\t\t\tthis._pendingGenerate = null;\n\n\t\t\t\t\t// TODO: support multiple callbacks queued?\n\t\t\t\t\treturn this.generateAsync( onProgress );\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\treturn this._pendingGenerate;\n\n\t\t} else {\n\n\t\t\tthis._buildAsync = true;\n\t\t\tconst result = this.generate( onProgress );\n\t\t\tthis._buildAsync = false;\n\n\t\t\tresult.bvh = this.bvh = await result.bvh;\n\t\t\treturn result;\n\n\t\t}\n\n\t}\n\n\tgenerate( onProgress = null ) {\n\n\t\tconst { staticGeometryGenerator, geometry, attributes } = this;\n\t\tconst objects = staticGeometryGenerator.objects;\n\t\tstaticGeometryGenerator.attributes = attributes;\n\n\t\t// update the skeleton animations in case WebGLRenderer is not running\n\t\t// to update it.\n\t\tobjects.forEach( o => {\n\n\t\t\to.traverse( c => {\n\n\t\t\t\tif ( c.isSkinnedMesh && c.skeleton ) {\n\n\t\t\t\t\tc.skeleton.update();\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t} );\n\n\t\t// generate the geometry\n\t\tconst result = staticGeometryGenerator.generate( geometry );\n\t\tconst materials = result.materials;\n\t\tlet needsMaterialIndexUpdate = result.changeType !== NO_CHANGE || this._materialUuids === null || this._materialUuids.length !== length;\n\t\tif ( ! needsMaterialIndexUpdate ) {\n\n\t\t\tfor ( let i = 0, length = materials.length; i < length; i ++ ) {\n\n\t\t\t\tconst material = materials[ i ];\n\t\t\t\tif ( material.uuid !== this._materialUuids[ i ] ) {\n\n\t\t\t\t\tneedsMaterialIndexUpdate = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst textures = getTextures( materials );\n\t\tconst { lights, iesTextures } = getLights( objects );\n\t\tif ( needsMaterialIndexUpdate ) {\n\n\t\t\tupdateMaterialIndexAttribute( geometry, materials, materials );\n\t\t\tthis._materialUuids = materials.map( material => material.uuid );\n\n\t\t}\n\n\t\t// only generate a new bvh if the objects used have changed\n\t\tif ( this.generateBVH ) {\n\n\t\t\tif ( this.bvh instanceof Promise ) {\n\n\t\t\t\tthrow new Error( 'PathTracingSceneGenerator: BVH is already building asynchronously.' );\n\n\t\t\t}\n\n\t\t\tif ( result.changeType === GEOMETRY_REBUILT ) {\n\n\t\t\t\tconst bvhOptions = {\n\t\t\t\t\tstrategy: SAH,\n\t\t\t\t\tmaxLeafTris: 1,\n\t\t\t\t\tindirect: true,\n\t\t\t\t\tonProgress,\n\t\t\t\t\t...this.bvhOptions,\n\t\t\t\t};\n\n\t\t\t\tif ( this._buildAsync ) {\n\n\t\t\t\t\tthis.bvh = this._bvhWorker.generate( geometry, bvhOptions );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis.bvh = new MeshBVH( geometry, bvhOptions );\n\n\t\t\t\t}\n\n\t\t\t} else if ( result.changeType === GEOMETRY_ADJUSTED ) {\n\n\t\t\t\tthis.bvh.refit();\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn {\n\t\t\tbvhChanged: result.changeType !== NO_CHANGE,\n\t\t\tbvh: this.bvh,\n\t\t\tneedsMaterialIndexUpdate,\n\t\t\tlights,\n\t\t\tiesTextures,\n\t\t\tgeometry,\n\t\t\tmaterials,\n\t\t\ttextures,\n\t\t\tobjects,\n\t\t};\n\n\t}\n\n}\n\nexport class DynamicPathTracingSceneGenerator extends PathTracingSceneGenerator {\n\n\tconstructor( ...args ) {\n\n\t\tsuper( ...args );\n\t\tconsole.warn( 'DynamicPathTracingSceneGenerator has been deprecated and renamed to \"PathTracingSceneGenerator\".' );\n\n\t}\n\n}\n\nexport class PathTracingSceneWorker extends PathTracingSceneGenerator {\n\n\tconstructor( ...args ) {\n\n\t\tsuper( ...args );\n\t\tconsole.warn( 'PathTracingSceneWorker has been deprecated and renamed to \"PathTracingSceneGenerator\".' );\n\n\t}\n\n}\n","import { ShaderMaterial } from 'three';\n\nexport class MaterialBase extends ShaderMaterial {\n\n\tset needsUpdate( v ) {\n\n\t\tsuper.needsUpdate = true;\n\t\tthis.dispatchEvent( {\n\n\t\t\ttype: 'recompilation',\n\n\t\t} );\n\n\t}\n\n\tconstructor( shader ) {\n\n\t\tsuper( shader );\n\n\t\tfor ( const key in this.uniforms ) {\n\n\t\t\tObject.defineProperty( this, key, {\n\n\t\t\t\tget() {\n\n\t\t\t\t\treturn this.uniforms[ key ].value;\n\n\t\t\t\t},\n\n\t\t\t\tset( v ) {\n\n\t\t\t\t\tthis.uniforms[ key ].value = v;\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t}\n\n\t}\n\n\t// sets the given named define value and sets \"needsUpdate\" to true if it's different\n\tsetDefine( name, value = undefined ) {\n\n\t\tif ( value === undefined || value === null ) {\n\n\t\t\tif ( name in this.defines ) {\n\n\t\t\t\tdelete this.defines[ name ];\n\t\t\t\tthis.needsUpdate = true;\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ( this.defines[ name ] !== value ) {\n\n\t\t\t\tthis.defines[ name ] = value;\n\t\t\t\tthis.needsUpdate = true;\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n}\n","import { NoBlending } from 'three';\nimport { MaterialBase } from '../MaterialBase.js';\n\nexport class BlendMaterial extends MaterialBase {\n\n\tconstructor( parameters ) {\n\n\t\tsuper( {\n\n\t\t\tblending: NoBlending,\n\n\t\t\tuniforms: {\n\n\t\t\t\ttarget1: { value: null },\n\t\t\t\ttarget2: { value: null },\n\t\t\t\topacity: { value: 1.0 },\n\n\t\t\t},\n\n\t\t\tvertexShader: /* glsl */`\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t\t}`,\n\n\t\t\tfragmentShader: /* glsl */`\n\n\t\t\t\tuniform float opacity;\n\n\t\t\t\tuniform sampler2D target1;\n\t\t\t\tuniform sampler2D target2;\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec4 color1 = texture2D( target1, vUv );\n\t\t\t\t\tvec4 color2 = texture2D( target2, vUv );\n\n\t\t\t\t\tfloat invOpacity = 1.0 - opacity;\n\t\t\t\t\tfloat totalAlpha = color1.a * invOpacity + color2.a * opacity;\n\n\t\t\t\t\tif ( color1.a != 0.0 || color2.a != 0.0 ) {\n\n\t\t\t\t\t\tgl_FragColor.rgb = color1.rgb * ( invOpacity * color1.a / totalAlpha ) + color2.rgb * ( opacity * color2.a / totalAlpha );\n\t\t\t\t\t\tgl_FragColor.a = totalAlpha;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tgl_FragColor = vec4( 0.0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t}`\n\n\t\t} );\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n}\n","// References\n// - https://jcgt.org/published/0009/04/01/\n// - Code from https://www.shadertoy.com/view/WtGyDm\n\n// functions to generate multi-dimensions variables of the same functions\n// to support 1, 2, 3, and 4 dimensional sobol sampling.\nfunction generateSobolFunctionVariants( dim = 1 ) {\n\n\tlet type = 'uint';\n\tif ( dim > 1 ) {\n\n\t\ttype = 'uvec' + dim;\n\n\t}\n\n\treturn /* glsl */`\n\t\t${ type } sobolReverseBits( ${ type } x ) {\n\n\t\t\tx = ( ( ( x & 0xaaaaaaaau ) >> 1 ) | ( ( x & 0x55555555u ) << 1 ) );\n\t\t\tx = ( ( ( x & 0xccccccccu ) >> 2 ) | ( ( x & 0x33333333u ) << 2 ) );\n\t\t\tx = ( ( ( x & 0xf0f0f0f0u ) >> 4 ) | ( ( x & 0x0f0f0f0fu ) << 4 ) );\n\t\t\tx = ( ( ( x & 0xff00ff00u ) >> 8 ) | ( ( x & 0x00ff00ffu ) << 8 ) );\n\t\t\treturn ( ( x >> 16 ) | ( x << 16 ) );\n\n\t\t}\n\n\t\t${ type } sobolHashCombine( uint seed, ${ type } v ) {\n\n\t\t\treturn seed ^ ( v + ${ type }( ( seed << 6 ) + ( seed >> 2 ) ) );\n\n\t\t}\n\n\t\t${ type } sobolLaineKarrasPermutation( ${ type } x, ${ type } seed ) {\n\n\t\t\tx += seed;\n\t\t\tx ^= x * 0x6c50b47cu;\n\t\t\tx ^= x * 0xb82f1e52u;\n\t\t\tx ^= x * 0xc7afe638u;\n\t\t\tx ^= x * 0x8d22f6e6u;\n\t\t\treturn x;\n\n\t\t}\n\n\t\t${ type } nestedUniformScrambleBase2( ${ type } x, ${ type } seed ) {\n\n\t\t\tx = sobolLaineKarrasPermutation( x, seed );\n\t\t\tx = sobolReverseBits( x );\n\t\t\treturn x;\n\n\t\t}\n\t`;\n\n}\n\nfunction generateSobolSampleFunctions( dim = 1 ) {\n\n\tlet utype = 'uint';\n\tlet vtype = 'float';\n\tlet num = '';\n\tlet components = '.r';\n\tlet combineValues = '1u';\n\tif ( dim > 1 ) {\n\n\t\tutype = 'uvec' + dim;\n\t\tvtype = 'vec' + dim;\n\t\tnum = dim + '';\n\t\tif ( dim === 2 ) {\n\n\t\t\tcomponents = '.rg';\n\t\t\tcombineValues = 'uvec2( 1u, 2u )';\n\n\t\t} else if ( dim === 3 ) {\n\n\t\t\tcomponents = '.rgb';\n\t\t\tcombineValues = 'uvec3( 1u, 2u, 3u )';\n\n\t\t} else {\n\n\t\t\tcomponents = '';\n\t\t\tcombineValues = 'uvec4( 1u, 2u, 3u, 4u )';\n\n\t\t}\n\n\t}\n\n\treturn /* glsl */`\n\n\t\t${ vtype } sobol${ num }( int effect ) {\n\n\t\t\tuint seed = sobolGetSeed( sobolBounceIndex, uint( effect ) );\n\t\t\tuint index = sobolPathIndex;\n\n\t\t\tuint shuffle_seed = sobolHashCombine( seed, 0u );\n\t\t\tuint shuffled_index = nestedUniformScrambleBase2( sobolReverseBits( index ), shuffle_seed );\n\t\t\t${ vtype } sobol_pt = sobolGetTexturePoint( shuffled_index )${ components };\n\t\t\t${ utype } result = ${ utype }( sobol_pt * 16777216.0 );\n\n\t\t\t${ utype } seed2 = sobolHashCombine( seed, ${ combineValues } );\n\t\t\tresult = nestedUniformScrambleBase2( result, seed2 );\n\n\t\t\treturn SOBOL_FACTOR * ${ vtype }( result >> 8 );\n\n\t\t}\n\t`;\n\n}\n\nexport const sobol_common = /* glsl */`\n\n\t// Utils\n\tconst float SOBOL_FACTOR = 1.0 / 16777216.0;\n\tconst uint SOBOL_MAX_POINTS = 256u * 256u;\n\n\t${ generateSobolFunctionVariants( 1 ) }\n\t${ generateSobolFunctionVariants( 2 ) }\n\t${ generateSobolFunctionVariants( 3 ) }\n\t${ generateSobolFunctionVariants( 4 ) }\n\n\tuint sobolHash( uint x ) {\n\n\t\t// finalizer from murmurhash3\n\t\tx ^= x >> 16;\n\t\tx *= 0x85ebca6bu;\n\t\tx ^= x >> 13;\n\t\tx *= 0xc2b2ae35u;\n\t\tx ^= x >> 16;\n\t\treturn x;\n\n\t}\n\n`;\n\nexport const sobol_point_generation = /* glsl */`\n\n\tconst uint SOBOL_DIRECTIONS_1[ 32 ] = uint[ 32 ](\n\t\t0x80000000u, 0xc0000000u, 0xa0000000u, 0xf0000000u,\n\t\t0x88000000u, 0xcc000000u, 0xaa000000u, 0xff000000u,\n\t\t0x80800000u, 0xc0c00000u, 0xa0a00000u, 0xf0f00000u,\n\t\t0x88880000u, 0xcccc0000u, 0xaaaa0000u, 0xffff0000u,\n\t\t0x80008000u, 0xc000c000u, 0xa000a000u, 0xf000f000u,\n\t\t0x88008800u, 0xcc00cc00u, 0xaa00aa00u, 0xff00ff00u,\n\t\t0x80808080u, 0xc0c0c0c0u, 0xa0a0a0a0u, 0xf0f0f0f0u,\n\t\t0x88888888u, 0xccccccccu, 0xaaaaaaaau, 0xffffffffu\n\t);\n\n\tconst uint SOBOL_DIRECTIONS_2[ 32 ] = uint[ 32 ](\n\t\t0x80000000u, 0xc0000000u, 0x60000000u, 0x90000000u,\n\t\t0xe8000000u, 0x5c000000u, 0x8e000000u, 0xc5000000u,\n\t\t0x68800000u, 0x9cc00000u, 0xee600000u, 0x55900000u,\n\t\t0x80680000u, 0xc09c0000u, 0x60ee0000u, 0x90550000u,\n\t\t0xe8808000u, 0x5cc0c000u, 0x8e606000u, 0xc5909000u,\n\t\t0x6868e800u, 0x9c9c5c00u, 0xeeee8e00u, 0x5555c500u,\n\t\t0x8000e880u, 0xc0005cc0u, 0x60008e60u, 0x9000c590u,\n\t\t0xe8006868u, 0x5c009c9cu, 0x8e00eeeeu, 0xc5005555u\n\t);\n\n\tconst uint SOBOL_DIRECTIONS_3[ 32 ] = uint[ 32 ](\n\t\t0x80000000u, 0xc0000000u, 0x20000000u, 0x50000000u,\n\t\t0xf8000000u, 0x74000000u, 0xa2000000u, 0x93000000u,\n\t\t0xd8800000u, 0x25400000u, 0x59e00000u, 0xe6d00000u,\n\t\t0x78080000u, 0xb40c0000u, 0x82020000u, 0xc3050000u,\n\t\t0x208f8000u, 0x51474000u, 0xfbea2000u, 0x75d93000u,\n\t\t0xa0858800u, 0x914e5400u, 0xdbe79e00u, 0x25db6d00u,\n\t\t0x58800080u, 0xe54000c0u, 0x79e00020u, 0xb6d00050u,\n\t\t0x800800f8u, 0xc00c0074u, 0x200200a2u, 0x50050093u\n\t);\n\n\tconst uint SOBOL_DIRECTIONS_4[ 32 ] = uint[ 32 ](\n\t\t0x80000000u, 0x40000000u, 0x20000000u, 0xb0000000u,\n\t\t0xf8000000u, 0xdc000000u, 0x7a000000u, 0x9d000000u,\n\t\t0x5a800000u, 0x2fc00000u, 0xa1600000u, 0xf0b00000u,\n\t\t0xda880000u, 0x6fc40000u, 0x81620000u, 0x40bb0000u,\n\t\t0x22878000u, 0xb3c9c000u, 0xfb65a000u, 0xddb2d000u,\n\t\t0x78022800u, 0x9c0b3c00u, 0x5a0fb600u, 0x2d0ddb00u,\n\t\t0xa2878080u, 0xf3c9c040u, 0xdb65a020u, 0x6db2d0b0u,\n\t\t0x800228f8u, 0x400b3cdcu, 0x200fb67au, 0xb00ddb9du\n\t);\n\n\tuint getMaskedSobol( uint index, uint directions[ 32 ] ) {\n\n\t\tuint X = 0u;\n\t\tfor ( int bit = 0; bit < 32; bit ++ ) {\n\n\t\t\tuint mask = ( index >> bit ) & 1u;\n\t\t\tX ^= mask * directions[ bit ];\n\n\t\t}\n\t\treturn X;\n\n\t}\n\n\tvec4 generateSobolPoint( uint index ) {\n\n\t\tif ( index >= SOBOL_MAX_POINTS ) {\n\n\t\t\treturn vec4( 0.0 );\n\n\t\t}\n\n\t\t// NOTE: this sobol \"direction\" is also available but we can't write out 5 components\n\t\t// uint x = index & 0x00ffffffu;\n\t\tuint x = sobolReverseBits( getMaskedSobol( index, SOBOL_DIRECTIONS_1 ) ) & 0x00ffffffu;\n\t\tuint y = sobolReverseBits( getMaskedSobol( index, SOBOL_DIRECTIONS_2 ) ) & 0x00ffffffu;\n\t\tuint z = sobolReverseBits( getMaskedSobol( index, SOBOL_DIRECTIONS_3 ) ) & 0x00ffffffu;\n\t\tuint w = sobolReverseBits( getMaskedSobol( index, SOBOL_DIRECTIONS_4 ) ) & 0x00ffffffu;\n\n\t\treturn vec4( x, y, z, w ) * SOBOL_FACTOR;\n\n\t}\n\n`;\n\nexport const sobol_functions = /* glsl */`\n\n\t// Seeds\n\tuniform sampler2D sobolTexture;\n\tuint sobolPixelIndex = 0u;\n\tuint sobolPathIndex = 0u;\n\tuint sobolBounceIndex = 0u;\n\n\tuint sobolGetSeed( uint bounce, uint effect ) {\n\n\t\treturn sobolHash(\n\t\t\tsobolHashCombine(\n\t\t\t\tsobolHashCombine(\n\t\t\t\t\tsobolHash( bounce ),\n\t\t\t\t\tsobolPixelIndex\n\t\t\t\t),\n\t\t\t\teffect\n\t\t\t)\n\t\t);\n\n\t}\n\n\tvec4 sobolGetTexturePoint( uint index ) {\n\n\t\tif ( index >= SOBOL_MAX_POINTS ) {\n\n\t\t\tindex = index % SOBOL_MAX_POINTS;\n\n\t\t}\n\n\t\tuvec2 dim = uvec2( textureSize( sobolTexture, 0 ).xy );\n\t\tuint y = index / dim.x;\n\t\tuint x = index - y * dim.x;\n\t\tvec2 uv = vec2( x, y ) / vec2( dim );\n\t\treturn texture( sobolTexture, uv );\n\n\t}\n\n\t${ generateSobolSampleFunctions( 1 ) }\n\t${ generateSobolSampleFunctions( 2 ) }\n\t${ generateSobolSampleFunctions( 3 ) }\n\t${ generateSobolSampleFunctions( 4 ) }\n\n`;\n","import { FloatType, NearestFilter, NoBlending, RGBAFormat, Vector2, WebGLRenderTarget } from 'three';\nimport { FullScreenQuad } from 'three/examples/jsm/postprocessing/Pass.js';\nimport { MaterialBase } from '../materials/MaterialBase.js';\nimport { sobol_common, sobol_point_generation } from '../shader/rand/sobol.glsl.js';\n\nclass SobolNumbersMaterial extends MaterialBase {\n\n\tconstructor() {\n\n\t\tsuper( {\n\n\t\t\tblending: NoBlending,\n\n\t\t\tuniforms: {\n\n\t\t\t\tresolution: { value: new Vector2() },\n\n\t\t\t},\n\n\t\t\tvertexShader: /* glsl */`\n\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t\t}\n\t\t\t`,\n\n\t\t\tfragmentShader: /* glsl */`\n\n\t\t\t\t${ sobol_common }\n\t\t\t\t${ sobol_point_generation }\n\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform vec2 resolution;\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tuint index = uint( gl_FragCoord.y ) * uint( resolution.x ) + uint( gl_FragCoord.x );\n\t\t\t\t\tgl_FragColor = generateSobolPoint( index );\n\n\t\t\t\t}\n\t\t\t`,\n\n\t\t} );\n\n\t}\n\n}\n\nexport class SobolNumberMapGenerator {\n\n\tgenerate( renderer, dimensions = 256 ) {\n\n\t\tconst target = new WebGLRenderTarget( dimensions, dimensions, {\n\n\t\t\ttype: FloatType,\n\t\t\tformat: RGBAFormat,\n\t\t\tminFilter: NearestFilter,\n\t\t\tmagFilter: NearestFilter,\n\t\t\tgenerateMipmaps: false,\n\n\t\t} );\n\n\t\tconst ogTarget = renderer.getRenderTarget();\n\t\trenderer.setRenderTarget( target );\n\n\t\tconst quad = new FullScreenQuad( new SobolNumbersMaterial() );\n\t\tquad.material.resolution.set( dimensions, dimensions );\n\t\tquad.render( renderer );\n\n\t\trenderer.setRenderTarget( ogTarget );\n\t\tquad.dispose();\n\n\t\treturn target;\n\n\t}\n\n}\n","import { PerspectiveCamera } from 'three';\n\nexport class PhysicalCamera extends PerspectiveCamera {\n\n\tset bokehSize( size ) {\n\n\t\tthis.fStop = this.getFocalLength() / size;\n\n\t}\n\n\tget bokehSize() {\n\n\t\treturn this.getFocalLength() / this.fStop;\n\n\t}\n\n\tconstructor( ...args ) {\n\n\t\tsuper( ...args );\n\t\tthis.fStop = 1.4;\n\t\tthis.apertureBlades = 0;\n\t\tthis.apertureRotation = 0;\n\t\tthis.focusDistance = 25;\n\t\tthis.anamorphicRatio = 1;\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.fStop = source.fStop;\n\t\tthis.apertureBlades = source.apertureBlades;\n\t\tthis.apertureRotation = source.apertureRotation;\n\t\tthis.focusDistance = source.focusDistance;\n\t\tthis.anamorphicRatio = source.anamorphicRatio;\n\n\t\treturn this;\n\n\t}\n\n}\n","import { PhysicalCamera } from '../objects/PhysicalCamera.js';\nexport class PhysicalCameraUniform {\n\n\tconstructor() {\n\n\t\tthis.bokehSize = 0;\n\t\tthis.apertureBlades = 0;\n\t\tthis.apertureRotation = 0;\n\t\tthis.focusDistance = 10;\n\t\tthis.anamorphicRatio = 1;\n\n\t}\n\n\tupdateFrom( camera ) {\n\n\t\tif ( camera instanceof PhysicalCamera ) {\n\n\t\t\tthis.bokehSize = camera.bokehSize;\n\t\t\tthis.apertureBlades = camera.apertureBlades;\n\t\t\tthis.apertureRotation = camera.apertureRotation;\n\t\t\tthis.focusDistance = camera.focusDistance;\n\t\t\tthis.anamorphicRatio = camera.anamorphicRatio;\n\n\t\t} else {\n\n\t\t\tthis.bokehSize = 0;\n\t\t\tthis.apertureRotation = 0;\n\t\t\tthis.apertureBlades = 0;\n\t\t\tthis.focusDistance = 10;\n\t\t\tthis.anamorphicRatio = 1;\n\n\t\t}\n\n\t}\n\n}\n","import { DataUtils } from 'three';\n\n\nexport function toHalfFloatArray( f32Array ) {\n\n\tconst f16Array = new Uint16Array( f32Array.length );\n\tfor ( let i = 0, n = f32Array.length; i < n; ++ i ) {\n\n\t\tf16Array[ i ] = DataUtils.toHalfFloat( f32Array[ i ] );\n\n\t}\n\n\treturn f16Array;\n\n}\n","import { DataTexture, RedFormat, LinearFilter, DataUtils, HalfFloatType, Source, RepeatWrapping, RGBAFormat, FloatType, ClampToEdgeWrapping } from 'three';\nimport { toHalfFloatArray } from '../utils/TextureUtils.js';\n\nfunction binarySearchFindClosestIndexOf( array, targetValue, offset = 0, count = array.length ) {\n\n\tlet lower = offset;\n\tlet upper = offset + count - 1;\n\n\twhile ( lower < upper ) {\n\n\t\t// calculate the midpoint for this iteration using a bitwise shift right operator to save 1 floating point multiplication\n\t\t// and 1 truncation from the double tilde operator to improve performance\n\t\t// this results in much better performance over using standard \"~ ~ ( (lower + upper) ) / 2\" to calculate the midpoint\n\t\tconst mid = ( lower + upper ) >> 1;\n\n\t\t// check if the middle array value is above or below the target and shift\n\t\t// which half of the array we're looking at\n\t\tif ( array[ mid ] < targetValue ) {\n\n\t\t\tlower = mid + 1;\n\n\t\t} else {\n\n\t\t\tupper = mid;\n\n\t\t}\n\n\t}\n\n\treturn lower - offset;\n\n}\n\nfunction colorToLuminance( r, g, b ) {\n\n\t// https://en.wikipedia.org/wiki/Relative_luminance\n\treturn 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n}\n\n// ensures the data is all floating point values and flipY is false\nfunction preprocessEnvMap( envMap, targetType = HalfFloatType ) {\n\n\tconst map = envMap.clone();\n\tmap.source = new Source( { ...map.image } );\n\tconst { width, height, data } = map.image;\n\n\t// TODO: is there a simple way to avoid cloning and adjusting the env map data here?\n\t// convert the data from half float uint 16 arrays to float arrays for cdf computation\n\tlet newData = data;\n\tif ( map.type !== targetType ) {\n\n\t\tif ( targetType === HalfFloatType ) {\n\n\t\t\tnewData = new Uint16Array( data.length );\n\n\t\t} else {\n\n\t\t\tnewData = new Float32Array( data.length );\n\n\t\t}\n\n\t\tlet maxIntValue;\n\t\tif ( data instanceof Int8Array || data instanceof Int16Array || data instanceof Int32Array ) {\n\n\t\t\tmaxIntValue = 2 ** ( 8 * data.BYTES_PER_ELEMENT - 1 ) - 1;\n\n\t\t} else {\n\n\t\t\tmaxIntValue = 2 ** ( 8 * data.BYTES_PER_ELEMENT ) - 1;\n\n\t\t}\n\n\t\tfor ( let i = 0, l = data.length; i < l; i ++ ) {\n\n\t\t\tlet v = data[ i ];\n\t\t\tif ( map.type === HalfFloatType ) {\n\n\t\t\t\tv = DataUtils.fromHalfFloat( data[ i ] );\n\n\t\t\t}\n\n\t\t\tif ( map.type !== FloatType && map.type !== HalfFloatType ) {\n\n\t\t\t\tv /= maxIntValue;\n\n\t\t\t}\n\n\t\t\tif ( targetType === HalfFloatType ) {\n\n\t\t\t\tnewData[ i ] = DataUtils.toHalfFloat( v );\n\n\t\t\t}\n\n\t\t}\n\n\t\tmap.image.data = newData;\n\t\tmap.type = targetType;\n\n\t}\n\n\t// remove any y flipping for cdf computation\n\tif ( map.flipY ) {\n\n\t\tconst ogData = newData;\n\t\tnewData = newData.slice();\n\t\tfor ( let y = 0; y < height; y ++ ) {\n\n\t\t\tfor ( let x = 0; x < width; x ++ ) {\n\n\t\t\t\tconst newY = height - y - 1;\n\t\t\t\tconst ogIndex = 4 * ( y * width + x );\n\t\t\t\tconst newIndex = 4 * ( newY * width + x );\n\n\t\t\t\tnewData[ newIndex + 0 ] = ogData[ ogIndex + 0 ];\n\t\t\t\tnewData[ newIndex + 1 ] = ogData[ ogIndex + 1 ];\n\t\t\t\tnewData[ newIndex + 2 ] = ogData[ ogIndex + 2 ];\n\t\t\t\tnewData[ newIndex + 3 ] = ogData[ ogIndex + 3 ];\n\n\t\t\t}\n\n\t\t}\n\n\t\tmap.flipY = false;\n\t\tmap.image.data = newData;\n\n\t}\n\n\treturn map;\n\n}\n\nexport class EquirectHdrInfoUniform {\n\n\tconstructor() {\n\n\t\t// Default to a white texture and associated weights so we don't\n\t\t// just render black initially.\n\t\tconst blackTex = new DataTexture( toHalfFloatArray( new Float32Array( [ 0, 0, 0, 0 ] ) ), 1, 1 );\n\t\tblackTex.type = HalfFloatType;\n\t\tblackTex.format = RGBAFormat;\n\t\tblackTex.minFilter = LinearFilter;\n\t\tblackTex.magFilter = LinearFilter;\n\t\tblackTex.wrapS = RepeatWrapping;\n\t\tblackTex.wrapT = RepeatWrapping;\n\t\tblackTex.generateMipmaps = false;\n\t\tblackTex.needsUpdate = true;\n\n\t\t// Stores a map of [0, 1] value -> cumulative importance row & pdf\n\t\t// used to sampling a random value to a relevant row to sample from\n\t\tconst marginalWeights = new DataTexture( toHalfFloatArray( new Float32Array( [ 0, 1 ] ) ), 1, 2 );\n\t\tmarginalWeights.type = HalfFloatType;\n\t\tmarginalWeights.format = RedFormat;\n\t\tmarginalWeights.minFilter = LinearFilter;\n\t\tmarginalWeights.magFilter = LinearFilter;\n\t\tmarginalWeights.generateMipmaps = false;\n\t\tmarginalWeights.needsUpdate = true;\n\n\t\t// Stores a map of [0, 1] value -> cumulative importance column & pdf\n\t\t// used to sampling a random value to a relevant pixel to sample from\n\t\tconst conditionalWeights = new DataTexture( toHalfFloatArray( new Float32Array( [ 0, 0, 1, 1 ] ) ), 2, 2 );\n\t\tconditionalWeights.type = HalfFloatType;\n\t\tconditionalWeights.format = RedFormat;\n\t\tconditionalWeights.minFilter = LinearFilter;\n\t\tconditionalWeights.magFilter = LinearFilter;\n\t\tconditionalWeights.generateMipmaps = false;\n\t\tconditionalWeights.needsUpdate = true;\n\n\t\tthis.map = blackTex;\n\t\tthis.marginalWeights = marginalWeights;\n\t\tthis.conditionalWeights = conditionalWeights;\n\t\tthis.totalSum = 0;\n\n\t\t// TODO: Add support for float or half float types here. We need to pass this into\n\t\t// the preprocess function and ensure our CDF and MDF textures are appropriately sized\n\t\t// Ideally we wouldn't upscale a bit depth if we didn't need to.\n\t\t// this.type = HalfFloatType;\n\n\t}\n\n\tdispose() {\n\n\t\tthis.marginalWeights.dispose();\n\t\tthis.conditionalWeights.dispose();\n\t\tthis.map.dispose();\n\n\t}\n\n\tupdateFrom( hdr ) {\n\n\t\t// https://github.com/knightcrawler25/GLSL-PathTracer/blob/3c6fd9b6b3da47cd50c527eeb45845eef06c55c3/src/loaders/hdrloader.cpp\n\t\t// https://pbr-book.org/3ed-2018/Light_Transport_I_Surface_Reflection/Sampling_Light_Sources#InfiniteAreaLights\n\t\tconst map = preprocessEnvMap( hdr );\n\t\tmap.wrapS = RepeatWrapping;\n\t\tmap.wrapT = ClampToEdgeWrapping;\n\n\t\tconst { width, height, data } = map.image;\n\n\t\t// \"conditional\" = \"pixel relative to row pixels sum\"\n\t\t// \"marginal\" = \"row relative to row sum\"\n\n\t\t// track the importance of any given pixel in the image by tracking its weight relative to other pixels in the image\n\t\tconst pdfConditional = new Float32Array( width * height );\n\t\tconst cdfConditional = new Float32Array( width * height );\n\n\t\tconst pdfMarginal = new Float32Array( height );\n\t\tconst cdfMarginal = new Float32Array( height );\n\n\t\tlet totalSumValue = 0.0;\n\t\tlet cumulativeWeightMarginal = 0.0;\n\t\tfor ( let y = 0; y < height; y ++ ) {\n\n\t\t\tlet cumulativeRowWeight = 0.0;\n\t\t\tfor ( let x = 0; x < width; x ++ ) {\n\n\t\t\t\tconst i = y * width + x;\n\t\t\t\tconst r = DataUtils.fromHalfFloat( data[ 4 * i + 0 ] );\n\t\t\t\tconst g = DataUtils.fromHalfFloat( data[ 4 * i + 1 ] );\n\t\t\t\tconst b = DataUtils.fromHalfFloat( data[ 4 * i + 2 ] );\n\n\t\t\t\t// the probability of the pixel being selected in this row is the\n\t\t\t\t// scale of the luminance relative to the rest of the pixels.\n\t\t\t\t// TODO: this should also account for the solid angle of the pixel when sampling\n\t\t\t\tconst weight = colorToLuminance( r, g, b );\n\t\t\t\tcumulativeRowWeight += weight;\n\t\t\t\ttotalSumValue += weight;\n\n\t\t\t\tpdfConditional[ i ] = weight;\n\t\t\t\tcdfConditional[ i ] = cumulativeRowWeight;\n\n\t\t\t}\n\n\t\t\t// can happen if the row is all black\n\t\t\tif ( cumulativeRowWeight !== 0 ) {\n\n\t\t\t\t// scale the pdf and cdf to [0.0, 1.0]\n\t\t\t\tfor ( let i = y * width, l = y * width + width; i < l; i ++ ) {\n\n\t\t\t\t\tpdfConditional[ i ] /= cumulativeRowWeight;\n\t\t\t\t\tcdfConditional[ i ] /= cumulativeRowWeight;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tcumulativeWeightMarginal += cumulativeRowWeight;\n\n\t\t\t// compute the marginal pdf and cdf along the height of the map.\n\t\t\tpdfMarginal[ y ] = cumulativeRowWeight;\n\t\t\tcdfMarginal[ y ] = cumulativeWeightMarginal;\n\n\t\t}\n\n\t\t// can happen if the texture is all black\n\t\tif ( cumulativeWeightMarginal !== 0 ) {\n\n\t\t\t// scale the marginal pdf and cdf to [0.0, 1.0]\n\t\t\tfor ( let i = 0, l = pdfMarginal.length; i < l; i ++ ) {\n\n\t\t\t\tpdfMarginal[ i ] /= cumulativeWeightMarginal;\n\t\t\t\tcdfMarginal[ i ] /= cumulativeWeightMarginal;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// compute a sorted index of distributions and the probabilities along them for both\n\t\t// the marginal and conditional data. These will be used to sample with a random number\n\t\t// to retrieve a uv value to sample in the environment map.\n\t\t// These values continually increase so it's okay to interpolate between them.\n\t\tconst marginalDataArray = new Uint16Array( height );\n\t\tconst conditionalDataArray = new Uint16Array( width * height );\n\n\t\t// we add a half texel offset so we're sampling the center of the pixel\n\t\tfor ( let i = 0; i < height; i ++ ) {\n\n\t\t\tconst dist = ( i + 1 ) / height;\n\t\t\tconst row = binarySearchFindClosestIndexOf( cdfMarginal, dist );\n\n\t\t\tmarginalDataArray[ i ] = DataUtils.toHalfFloat( ( row + 0.5 ) / height );\n\n\t\t}\n\n\t\tfor ( let y = 0; y < height; y ++ ) {\n\n\t\t\tfor ( let x = 0; x < width; x ++ ) {\n\n\t\t\t\tconst i = y * width + x;\n\t\t\t\tconst dist = ( x + 1 ) / width;\n\t\t\t\tconst col = binarySearchFindClosestIndexOf( cdfConditional, dist, y * width, width );\n\n\t\t\t\tconditionalDataArray[ i ] = DataUtils.toHalfFloat( ( col + 0.5 ) / width );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.dispose();\n\n\t\tconst { marginalWeights, conditionalWeights } = this;\n\t\tmarginalWeights.image = { width: height, height: 1, data: marginalDataArray };\n\t\tmarginalWeights.needsUpdate = true;\n\n\t\tconditionalWeights.image = { width, height, data: conditionalDataArray };\n\t\tconditionalWeights.needsUpdate = true;\n\n\t\tthis.totalSum = totalSumValue;\n\t\tthis.map = map;\n\n\t}\n\n}\n","import { DataTexture, RGBAFormat, ClampToEdgeWrapping, FloatType, Vector3, Quaternion, Matrix4, NearestFilter } from 'three';\nimport { bufferToHash } from '../utils/bufferToHash.js';\n\nconst LIGHT_PIXELS = 6;\nconst RECT_AREA_LIGHT = 0;\nconst CIRC_AREA_LIGHT = 1;\nconst SPOT_LIGHT = 2;\nconst DIR_LIGHT = 3;\nconst POINT_LIGHT = 4;\n\nconst u = new Vector3();\nconst v = new Vector3();\nconst m = new Matrix4();\nconst worldQuaternion = new Quaternion();\nconst eye = new Vector3();\nconst target = new Vector3();\nconst up = new Vector3( 0, 1, 0 );\nexport class LightsInfoUniformStruct {\n\n\tconstructor() {\n\n\t\tconst tex = new DataTexture( new Float32Array( 4 ), 1, 1 );\n\t\ttex.format = RGBAFormat;\n\t\ttex.type = FloatType;\n\t\ttex.wrapS = ClampToEdgeWrapping;\n\t\ttex.wrapT = ClampToEdgeWrapping;\n\t\ttex.generateMipmaps = false;\n\t\ttex.minFilter = NearestFilter;\n\t\ttex.magFilter = NearestFilter;\n\n\t\tthis.tex = tex;\n\t\tthis.count = 0;\n\n\t}\n\n\tupdateFrom( lights, iesTextures = [] ) {\n\n\t\tconst tex = this.tex;\n\t\tconst pixelCount = Math.max( lights.length * LIGHT_PIXELS, 1 );\n\t\tconst dimension = Math.ceil( Math.sqrt( pixelCount ) );\n\n\t\tif ( tex.image.width !== dimension ) {\n\n\t\t\ttex.dispose();\n\n\t\t\ttex.image.data = new Float32Array( dimension * dimension * 4 );\n\t\t\ttex.image.width = dimension;\n\t\t\ttex.image.height = dimension;\n\n\t\t}\n\n\t\tconst floatArray = tex.image.data;\n\n\t\tfor ( let i = 0, l = lights.length; i < l; i ++ ) {\n\n\t\t\tconst l = lights[ i ];\n\n\t\t\tconst baseIndex = i * LIGHT_PIXELS * 4;\n\t\t\tlet index = 0;\n\n\t\t\t// initialize to 0\n\t\t\tfor ( let p = 0; p < LIGHT_PIXELS * 4; p ++ ) {\n\n\t\t\t\tfloatArray[ baseIndex + p ] = 0;\n\n\t\t\t}\n\n\t\t\t// sample 1\n\t\t    // position\n\t\t\tl.getWorldPosition( v );\n\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = v.x;\n\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = v.y;\n\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = v.z;\n\n\t\t\t// type\n\t\t\tlet type = RECT_AREA_LIGHT;\n\t\t\tif ( l.isRectAreaLight && l.isCircular ) {\n\n\t\t\t\ttype = CIRC_AREA_LIGHT;\n\n\t\t\t} else if ( l.isSpotLight ) {\n\n\t\t\t\ttype = SPOT_LIGHT;\n\n\t\t\t} else if ( l.isDirectionalLight ) {\n\n\t\t\t\ttype = DIR_LIGHT;\n\n\t\t\t} else if ( l.isPointLight ) {\n\n\t\t\t\ttype = POINT_LIGHT;\n\n\t\t\t}\n\n\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = type;\n\n\t\t\t// sample 2\n\t\t\t// color\n\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = l.color.r;\n\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = l.color.g;\n\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = l.color.b;\n\n\t\t\t// intensity\n\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = l.intensity;\n\n\t\t\tl.getWorldQuaternion( worldQuaternion );\n\n\t\t\tif ( l.isRectAreaLight ) {\n\n\t\t\t\t// sample 3\n\t\t\t\t// u vector\n\t\t\t\tu.set( l.width, 0, 0 ).applyQuaternion( worldQuaternion );\n\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = u.x;\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = u.y;\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = u.z;\n\t\t\t\tindex ++;\n\n\t\t\t\t// sample 4\n\t\t\t\t// v vector\n\t\t\t\tv.set( 0, l.height, 0 ).applyQuaternion( worldQuaternion );\n\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = v.x;\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = v.y;\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = v.z;\n\n\t\t\t\t// area\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = u.cross( v ).length() * ( l.isCircular ? ( Math.PI / 4.0 ) : 1.0 );\n\n\t\t\t} else if ( l.isSpotLight ) {\n\n\t\t\t\tconst radius = l.radius || 0;\n\t\t\t\teye.setFromMatrixPosition( l.matrixWorld );\n\t\t\t\ttarget.setFromMatrixPosition( l.target.matrixWorld );\n\t\t\t\tm.lookAt( eye, target, up );\n\t\t\t\tworldQuaternion.setFromRotationMatrix( m );\n\n\t\t\t\t// sample 3\n\t\t\t\t// u vector\n\t\t\t\tu.set( 1, 0, 0 ).applyQuaternion( worldQuaternion );\n\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = u.x;\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = u.y;\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = u.z;\n\t\t\t\tindex ++;\n\n\t\t\t\t// sample 4\n\t\t\t\t// v vector\n\t\t\t\tv.set( 0, 1, 0 ).applyQuaternion( worldQuaternion );\n\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = v.x;\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = v.y;\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = v.z;\n\n\t\t\t\t// area\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = Math.PI * radius * radius;\n\n\t\t\t\t// sample 5\n\t\t\t\t// radius\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = radius;\n\n\t\t\t\t// decay\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = l.decay;\n\n\t\t\t\t// distance\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = l.distance;\n\n\t\t\t\t// coneCos\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = Math.cos( l.angle );\n\n\t\t\t\t// sample 6\n\t\t\t\t// penumbraCos\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = Math.cos( l.angle * ( 1 - l.penumbra ) );\n\n\t\t\t\t// iesProfile\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = l.iesMap ? iesTextures.indexOf( l.iesMap ) : - 1;\n\n\t\t\t} else if ( l.isPointLight ) {\n\n\t\t\t\tconst worldPosition = u.setFromMatrixPosition( l.matrixWorld );\n\n\t\t\t\t// sample 3\n\t\t\t\t// u vector\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = worldPosition.x;\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = worldPosition.y;\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = worldPosition.z;\n\t\t\t\tindex ++;\n\n\t\t\t\t// sample 4\n\t\t\t\tindex += 4;\n\n\t\t\t\t// sample 5\n\t\t\t\tindex += 1;\n\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = l.decay;\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = l.distance;\n\n\t\t\t} else if ( l.isDirectionalLight ) {\n\n\t\t\t\tconst worldPosition = u.setFromMatrixPosition( l.matrixWorld );\n\t\t\t\tconst targetPosition = v.setFromMatrixPosition( l.target.matrixWorld );\n\t\t\t\ttarget.subVectors( worldPosition, targetPosition ).normalize();\n\n\t\t\t\t// sample 3\n\t\t\t\t// u vector\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = target.x;\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = target.y;\n\t\t\t\tfloatArray[ baseIndex + ( index ++ ) ] = target.z;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.count = lights.length;\n\n\t\tconst hash = bufferToHash( floatArray.buffer );\n\t\tif ( this.hash !== hash ) {\n\n\t\t\tthis.hash = hash;\n\t\t\ttex.needsUpdate = true;\n\t\t\treturn true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n}\n","import { DataArrayTexture, FloatType, RGBAFormat } from 'three';\nimport { FloatVertexAttributeTexture } from 'three-mesh-bvh';\n\nfunction copyArrayToArray( fromArray, fromStride, toArray, toStride, offset ) {\n\n\tif ( fromStride > toStride ) {\n\n\t\tthrow new Error();\n\n\t}\n\n\t// scale non-float values to their normalized range\n\tconst count = fromArray.length / fromStride;\n\tconst bpe = fromArray.constructor.BYTES_PER_ELEMENT * 8;\n\tlet maxValue = 1.0;\n\tswitch ( fromArray.constructor ) {\n\n\tcase Uint8Array:\n\tcase Uint16Array:\n\tcase Uint32Array:\n\t\tmaxValue = 2 ** bpe - 1;\n\t\tbreak;\n\n\tcase Int8Array:\n\tcase Int16Array:\n\tcase Int32Array:\n\t\tmaxValue = 2 ** ( bpe - 1 ) - 1;\n\t\tbreak;\n\n\t}\n\n\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\tconst i4 = 4 * i;\n\t\tconst is = fromStride * i;\n\t\tfor ( let j = 0; j < toStride; j ++ ) {\n\n\t\t\ttoArray[ offset + i4 + j ] = fromStride >= j + 1 ? fromArray[ is + j ] / maxValue : 0;\n\n\t\t}\n\n\t}\n\n}\n\nexport class FloatAttributeTextureArray extends DataArrayTexture {\n\n\tconstructor() {\n\n\t\tsuper();\n\t\tthis._textures = [];\n\t\tthis.type = FloatType;\n\t\tthis.format = RGBAFormat;\n\t\tthis.internalFormat = 'RGBA32F';\n\n\t}\n\n\tupdateAttribute( index, attr ) {\n\n\t\t// update the texture\n\t\tconst tex = this._textures[ index ];\n\t\ttex.updateFrom( attr );\n\n\t\t// ensure compatibility\n\t\tconst baseImage = tex.image;\n\t\tconst image = this.image;\n\t\tif ( baseImage.width !== image.width || baseImage.height !== image.height ) {\n\n\t\t\tthrow new Error( 'FloatAttributeTextureArray: Attribute must be the same dimensions when updating single layer.' );\n\n\t\t}\n\n\t\t// update the image\n\t\tconst { width, height, data } = image;\n\t\tconst length = width * height * 4;\n\t\tconst offset = length * index;\n\t\tlet itemSize = attr.itemSize;\n\t\tif ( itemSize === 3 ) {\n\n\t\t\titemSize = 4;\n\n\t\t}\n\n\t\t// copy the data\n\t\tcopyArrayToArray( tex.image.data, itemSize, data, 4, offset );\n\n\t\tthis.dispose();\n\t\tthis.needsUpdate = true;\n\n\t}\n\n\tsetAttributes( attrs ) {\n\n\t\t// ensure the attribute count\n\t\tconst itemCount = attrs[ 0 ].count;\n\t\tconst attrsLength = attrs.length;\n\t\tfor ( let i = 0, l = attrsLength; i < l; i ++ ) {\n\n\t\t\tif ( attrs[ i ].count !== itemCount ) {\n\n\t\t\t\tthrow new Error( 'FloatAttributeTextureArray: All attributes must have the same item count.' );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// initialize all textures\n\t\tconst textures = this._textures;\n\t\twhile ( textures.length < attrsLength ) {\n\n\t\t\tconst tex = new FloatVertexAttributeTexture();\n\t\t\ttextures.push( tex );\n\n\t\t}\n\n\t\twhile ( textures.length > attrsLength ) {\n\n\t\t\ttextures.pop();\n\n\t\t}\n\n\t\t// update all textures\n\t\tfor ( let i = 0, l = attrsLength; i < l; i ++ ) {\n\n\t\t\ttextures[ i ].updateFrom( attrs[ i ] );\n\n\t\t}\n\n\t\t// determine if we need to create a new array\n\t\tconst baseTexture = textures[ 0 ];\n\t\tconst baseImage = baseTexture.image;\n\t\tconst image = this.image;\n\n\t\tif ( baseImage.width !== image.width || baseImage.height !== image.height || baseImage.depth !== attrsLength ) {\n\n\t\t\timage.width = baseImage.width;\n\t\t\timage.height = baseImage.height;\n\t\t\timage.depth = attrsLength;\n\t\t\timage.data = new Float32Array( image.width * image.height * image.depth * 4 );\n\n\t\t}\n\n\t\t// copy the other texture data into the data array texture\n\t\tconst { data, width, height } = image;\n\t\tfor ( let i = 0, l = attrsLength; i < l; i ++ ) {\n\n\t\t\tconst tex = textures[ i ];\n\t\t\tconst length = width * height * 4;\n\t\t\tconst offset = length * i;\n\n\t\t\tlet itemSize = attrs[ i ].itemSize;\n\t\t\tif ( itemSize === 3 ) {\n\n\t\t\t\titemSize = 4;\n\n\t\t\t}\n\n\t\t\tcopyArrayToArray( tex.image.data, itemSize, data, 4, offset );\n\n\t\t}\n\n\t\t// reset the texture\n\t\tthis.dispose();\n\t\tthis.needsUpdate = true;\n\n\t}\n\n\n}\n","import { FloatAttributeTextureArray } from './FloatAttributeTextureArray.js';\n\nexport class AttributesTextureArray extends FloatAttributeTextureArray {\n\n\tupdateNormalAttribute( attr ) {\n\n\t\tthis.updateAttribute( 0, attr );\n\n\t}\n\n\tupdateTangentAttribute( attr ) {\n\n\t\tthis.updateAttribute( 1, attr );\n\n\t}\n\n\tupdateUvAttribute( attr ) {\n\n\t\tthis.updateAttribute( 2, attr );\n\n\t}\n\n\tupdateColorAttribute( attr ) {\n\n\t\tthis.updateAttribute( 3, attr );\n\n\t}\n\n\tupdateFrom( normal, tangent, uv, color ) {\n\n\t\tthis.setAttributes( [ normal, tangent, uv, color ] );\n\n\t}\n\n}\n","function uuidSort( a, b ) {\n\n\tif ( a.uuid < b.uuid ) return 1;\n\tif ( a.uuid > b.uuid ) return - 1;\n\treturn 0;\n\n}\n\n// we must hash the texture to determine uniqueness using the encoding, as well, because the\n// when rendering each texture to the texture array they must have a consistent color space.\nexport function getTextureHash( t ) {\n\n\treturn `${ t.source.uuid }:${ t.colorSpace }`;\n\n}\n\n// reduce the set of textures to just those with a unique source while retaining\n// the order of the textures.\nfunction reduceTexturesToUniqueSources( textures ) {\n\n\tconst sourceSet = new Set();\n\tconst result = [];\n\tfor ( let i = 0, l = textures.length; i < l; i ++ ) {\n\n\t\tconst tex = textures[ i ];\n\t\tconst hash = getTextureHash( tex );\n\t\tif ( ! sourceSet.has( hash ) ) {\n\n\t\t\tsourceSet.add( hash );\n\t\t\tresult.push( tex );\n\n\t\t}\n\n\t}\n\n\treturn result;\n\n}\n\nexport function getIesTextures( lights ) {\n\n\tconst textures = lights.map( l => l.iesMap || null ).filter( t => t );\n\tconst textureSet = new Set( textures );\n\treturn Array.from( textureSet ).sort( uuidSort );\n\n}\n\nexport function getTextures( materials ) {\n\n\tconst textureSet = new Set();\n\tfor ( let i = 0, l = materials.length; i < l; i ++ ) {\n\n\t\tconst material = materials[ i ];\n\t\tfor ( const key in material ) {\n\n\t\t\tconst value = material[ key ];\n\t\t\tif ( value && value.isTexture ) {\n\n\t\t\t\ttextureSet.add( value );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tconst textureArray = Array.from( textureSet );\n\treturn reduceTexturesToUniqueSources( textureArray ).sort( uuidSort );\n\n}\n\nexport function getLights( scene ) {\n\n\tconst lights = [];\n\tscene.traverse( c => {\n\n\t\tif ( c.visible ) {\n\n\t\t\tif (\n\t\t\t\tc.isRectAreaLight ||\n\t\t\t\tc.isSpotLight ||\n\t\t\t\tc.isPointLight ||\n\t\t\t\tc.isDirectionalLight\n\t\t\t) {\n\n\t\t\t\tlights.push( c );\n\n\t\t\t}\n\n\t\t}\n\n\t} );\n\n\treturn lights.sort( uuidSort );\n\n}\n","import { DataTexture, RGBAFormat, ClampToEdgeWrapping, FloatType, FrontSide, BackSide, DoubleSide, NearestFilter } from 'three';\nimport { getTextureHash } from '../core/utils/sceneUpdateUtils.js';\nimport { bufferToHash } from '../utils/bufferToHash.js';\n\nexport const MATERIAL_PIXELS = 47;\nconst MATERIAL_STRIDE = MATERIAL_PIXELS * 4;\n\nclass MaterialFeatures {\n\n\tconstructor() {\n\n\t\tthis._features = {};\n\n\t}\n\n\tisUsed( feature ) {\n\n\t\treturn feature in this._features;\n\n\t}\n\n\tsetUsed( feature, used = true ) {\n\n\t\tif ( used === false ) {\n\n\t\t\tdelete this._features[ feature ];\n\n\t\t} else {\n\n\t\t\tthis._features[ feature ] = true;\n\n\t\t}\n\n\t}\n\n\treset() {\n\n\t\tthis._features = {};\n\n\t}\n\n}\n\nexport class MaterialsTexture extends DataTexture {\n\n\tconstructor() {\n\n\t\tsuper( new Float32Array( 4 ), 1, 1 );\n\n\t\tthis.format = RGBAFormat;\n\t\tthis.type = FloatType;\n\t\tthis.wrapS = ClampToEdgeWrapping;\n\t\tthis.wrapT = ClampToEdgeWrapping;\n\t\tthis.minFilter = NearestFilter;\n\t\tthis.magFilter = NearestFilter;\n\t\tthis.generateMipmaps = false;\n\t\tthis.features = new MaterialFeatures();\n\n\t}\n\n\tupdateFrom( materials, textures ) {\n\n\t\tfunction getTexture( material, key, def = - 1 ) {\n\n\t\t\tif ( key in material && material[ key ] ) {\n\n\t\t\t\tconst hash = getTextureHash( material[ key ] );\n\t\t\t\treturn textureLookUp[ hash ];\n\n\t\t\t} else {\n\n\t\t\t\treturn def;\n\n\t\t\t}\n\n\t\t}\n\n\t\tfunction getField( material, key, def ) {\n\n\t\t\treturn key in material ? material[ key ] : def;\n\n\t\t}\n\n\t\tfunction writeTextureMatrixToArray( material, textureKey, array, offset ) {\n\n\t\t\tconst texture = material[ textureKey ] && material[ textureKey ].isTexture ? material[ textureKey ] : null;\n\n\t\t\t// check if texture exists\n\t\t\tif ( texture ) {\n\n\t\t\t\tif ( texture.matrixAutoUpdate ) {\n\n\t\t\t\t\ttexture.updateMatrix();\n\n\t\t\t\t}\n\n\t\t\t\tconst elements = texture.matrix.elements;\n\n\t\t\t\tlet i = 0;\n\n\t\t\t\t// first row\n\t\t\t\tarray[ offset + i ++ ] = elements[ 0 ];\n\t\t\t\tarray[ offset + i ++ ] = elements[ 3 ];\n\t\t\t\tarray[ offset + i ++ ] = elements[ 6 ];\n\t\t\t\ti ++;\n\n\t\t\t\t// second row\n\t\t\t\tarray[ offset + i ++ ] = elements[ 1 ];\n\t\t\t\tarray[ offset + i ++ ] = elements[ 4 ];\n\t\t\t\tarray[ offset + i ++ ] = elements[ 7 ];\n\t\t\t\ti ++;\n\n\t\t\t}\n\n\t\t\treturn 8;\n\n\t\t}\n\n\t\tlet index = 0;\n\t\tconst pixelCount = materials.length * MATERIAL_PIXELS;\n\t\tconst dimension = Math.ceil( Math.sqrt( pixelCount ) ) || 1;\n\t\tconst { image, features } = this;\n\n\t\t// index the list of textures based on shareable source\n\t\tconst textureLookUp = {};\n\t\tfor ( let i = 0, l = textures.length; i < l; i ++ ) {\n\n\t\t\ttextureLookUp[ getTextureHash( textures[ i ] ) ] = i;\n\n\t\t}\n\n\t\tif ( image.width !== dimension ) {\n\n\t\t\tthis.dispose();\n\n\t\t\timage.data = new Float32Array( dimension * dimension * 4 );\n\t\t\timage.width = dimension;\n\t\t\timage.height = dimension;\n\n\t\t}\n\n\t\tconst floatArray = image.data;\n\n\t\t// on some devices (Google Pixel 6) the \"floatBitsToInt\" function does not work correctly so we\n\t\t// can't encode texture ids that way.\n\t\t// const intArray = new Int32Array( floatArray.buffer );\n\n\t\tfeatures.reset();\n\t\tfor ( let i = 0, l = materials.length; i < l; i ++ ) {\n\n\t\t\tconst m = materials[ i ];\n\n\t\t\tif ( m.isFogVolumeMaterial ) {\n\n\t\t\t\tfeatures.setUsed( 'FOG' );\n\n\t\t\t\tfor ( let j = 0; j < MATERIAL_STRIDE; j ++ ) {\n\n\t\t\t\t\tfloatArray[ index + j ] = 0;\n\n\t\t\t\t}\n\n\t\t\t\t// sample 0 .rgb\n\t\t\t\tfloatArray[ index + 0 * 4 + 0 ] = m.color.r;\n\t\t\t\tfloatArray[ index + 0 * 4 + 1 ] = m.color.g;\n\t\t\t\tfloatArray[ index + 0 * 4 + 2 ] = m.color.b;\n\n\t\t\t\t// sample 2 .a\n\t\t\t\tfloatArray[ index + 2 * 4 + 3 ] = getField( m, 'emissiveIntensity', 0.0 );\n\n\t\t\t\t// sample 3 .rgb\n\t\t\t\tfloatArray[ index + 3 * 4 + 0 ] = m.emissive.r;\n\t\t\t\tfloatArray[ index + 3 * 4 + 1 ] = m.emissive.g;\n\t\t\t\tfloatArray[ index + 3 * 4 + 2 ] = m.emissive.b;\n\n\t\t\t\t// sample 13 .g\n\t\t\t\t// reusing opacity field\n\t\t\t\tfloatArray[ index + 13 * 4 + 1 ] = m.density;\n\n\t\t\t\t// side\n\t\t\t\tfloatArray[ index + 13 * 4 + 3 ] = 0.0;\n\n\t\t\t\t// sample 14 .b\n\t\t\t\tfloatArray[ index + 14 * 4 + 2 ] = 1 << 2;\n\n\t\t\t\tindex += MATERIAL_STRIDE;\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\t// sample 0\n\t\t\t// color\n\t\t\tfloatArray[ index ++ ] = m.color.r;\n\t\t\tfloatArray[ index ++ ] = m.color.g;\n\t\t\tfloatArray[ index ++ ] = m.color.b;\n\t\t\tfloatArray[ index ++ ] = getTexture( m, 'map' );\n\n\t\t\t// sample 1\n\t\t\t// metalness & roughness\n\t\t\tfloatArray[ index ++ ] = getField( m, 'metalness', 0.0 );\n\t\t\tfloatArray[ index ++ ] = getTexture( m, 'metalnessMap' );\n\t\t\tfloatArray[ index ++ ] = getField( m, 'roughness', 0.0 );\n\t\t\tfloatArray[ index ++ ] = getTexture( m, 'roughnessMap' );\n\n\t\t\t// sample 2\n\t\t\t// transmission & emissiveIntensity\n\t\t\t// three.js assumes a default f0 of 0.04 if no ior is provided which equates to an ior of 1.5\n\t\t\tfloatArray[ index ++ ] = getField( m, 'ior', 1.5 );\n\t\t\tfloatArray[ index ++ ] = getField( m, 'transmission', 0.0 );\n\t\t\tfloatArray[ index ++ ] = getTexture( m, 'transmissionMap' );\n\t\t\tfloatArray[ index ++ ] = getField( m, 'emissiveIntensity', 0.0 );\n\n\t\t\t// sample 3\n\t\t\t// emission\n\t\t\tif ( 'emissive' in m ) {\n\n\t\t\t\tfloatArray[ index ++ ] = m.emissive.r;\n\t\t\t\tfloatArray[ index ++ ] = m.emissive.g;\n\t\t\t\tfloatArray[ index ++ ] = m.emissive.b;\n\n\t\t\t} else {\n\n\t\t\t\tfloatArray[ index ++ ] = 0.0;\n\t\t\t\tfloatArray[ index ++ ] = 0.0;\n\t\t\t\tfloatArray[ index ++ ] = 0.0;\n\n\t\t\t}\n\n\t\t\tfloatArray[ index ++ ] = getTexture( m, 'emissiveMap' );\n\n\t\t\t// sample 4\n\t\t\t// normals\n\t\t\tfloatArray[ index ++ ] = getTexture( m, 'normalMap' );\n\t\t\tif ( 'normalScale' in m ) {\n\n\t\t\t\tfloatArray[ index ++ ] = m.normalScale.x;\n\t\t\t\tfloatArray[ index ++ ] = m.normalScale.y;\n\n \t\t\t} else {\n\n \t\t\t\tfloatArray[ index ++ ] = 1;\n \t\t\t\tfloatArray[ index ++ ] = 1;\n\n \t\t\t}\n\n\t\t\t// clearcoat\n\t\t\tfloatArray[ index ++ ] = getField( m, 'clearcoat', 0.0 );\n\t\t\tfloatArray[ index ++ ] = getTexture( m, 'clearcoatMap' ); // sample 5\n\n\t\t\tfloatArray[ index ++ ] = getField( m, 'clearcoatRoughness', 0.0 );\n\t\t\tfloatArray[ index ++ ] = getTexture( m, 'clearcoatRoughnessMap' );\n\n\t\t\tfloatArray[ index ++ ] = getTexture( m, 'clearcoatNormalMap' );\n\n\t\t\t// sample 6\n\t\t\tif ( 'clearcoatNormalScale' in m ) {\n\n\t\t\t\tfloatArray[ index ++ ] = m.clearcoatNormalScale.x;\n\t\t\t\tfloatArray[ index ++ ] = m.clearcoatNormalScale.y;\n\n\t\t\t} else {\n\n\t\t\t\tfloatArray[ index ++ ] = 1;\n\t\t\t\tfloatArray[ index ++ ] = 1;\n\n\t\t\t}\n\n\t\t\tindex ++;\n\t\t\tfloatArray[ index ++ ] = getField( m, 'sheen', 0.0 );\n\n\t\t\t// sample 7\n\t\t\t// sheen\n\t\t\tif ( 'sheenColor' in m ) {\n\n\t\t\t\tfloatArray[ index ++ ] = m.sheenColor.r;\n\t\t\t\tfloatArray[ index ++ ] = m.sheenColor.g;\n\t\t\t\tfloatArray[ index ++ ] = m.sheenColor.b;\n\n\t\t\t} else {\n\n\t\t\t\tfloatArray[ index ++ ] = 0.0;\n\t\t\t\tfloatArray[ index ++ ] = 0.0;\n\t\t\t\tfloatArray[ index ++ ] = 0.0;\n\n\t\t\t}\n\n\t\t\tfloatArray[ index ++ ] = getTexture( m, 'sheenColorMap' );\n\n\t\t\t// sample 8\n\t\t\tfloatArray[ index ++ ] = getField( m, 'sheenRoughness', 0.0 );\n\t\t\tfloatArray[ index ++ ] = getTexture( m, 'sheenRoughnessMap' );\n\n\t\t\t// iridescence\n\t\t\tfloatArray[ index ++ ] = getTexture( m, 'iridescenceMap' );\n\t\t\tfloatArray[ index ++ ] = getTexture( m, 'iridescenceThicknessMap' );\n\n\t\t\t// sample 9\n\t\t\tfloatArray[ index ++ ] = getField( m, 'iridescence', 0.0 );\n\t\t\tfloatArray[ index ++ ] = getField( m, 'iridescenceIOR', 1.3 );\n\n\t\t\tconst iridescenceThicknessRange = getField( m, 'iridescenceThicknessRange', [ 100, 400 ] );\n\t\t\tfloatArray[ index ++ ] = iridescenceThicknessRange[ 0 ];\n\t\t\tfloatArray[ index ++ ] = iridescenceThicknessRange[ 1 ];\n\n\t\t\t// sample 10\n\t\t\t// specular color\n\t\t\tif ( 'specularColor' in m ) {\n\n\t\t\t\tfloatArray[ index ++ ] = m.specularColor.r;\n\t\t\t\tfloatArray[ index ++ ] = m.specularColor.g;\n\t\t\t\tfloatArray[ index ++ ] = m.specularColor.b;\n\n\t\t\t} else {\n\n\t\t\t\tfloatArray[ index ++ ] = 1.0;\n\t\t\t\tfloatArray[ index ++ ] = 1.0;\n\t\t\t\tfloatArray[ index ++ ] = 1.0;\n\n\t\t\t}\n\n\t\t\tfloatArray[ index ++ ] = getTexture( m, 'specularColorMap' );\n\n\t\t\t// sample 11\n\t\t\t// specular intensity\n\t\t\tfloatArray[ index ++ ] = getField( m, 'specularIntensity', 1.0 );\n\t\t\tfloatArray[ index ++ ] = getTexture( m, 'specularIntensityMap' );\n\n\t\t\t// isThinFilm\n\t\t\tconst isThinFilm = getField( m, 'thickness', 0.0 ) === 0.0 && getField( m, 'attenuationDistance', Infinity ) === Infinity;\n\t\t\tfloatArray[ index ++ ] = Number( isThinFilm );\n\t\t\tindex ++;\n\n\t\t\t// sample 12\n\t\t\tif ( 'attenuationColor' in m ) {\n\n\t\t\t\tfloatArray[ index ++ ] = m.attenuationColor.r;\n\t\t\t\tfloatArray[ index ++ ] = m.attenuationColor.g;\n\t\t\t\tfloatArray[ index ++ ] = m.attenuationColor.b;\n\n\t\t\t} else {\n\n\t\t\t\tfloatArray[ index ++ ] = 1.0;\n\t\t\t\tfloatArray[ index ++ ] = 1.0;\n\t\t\t\tfloatArray[ index ++ ] = 1.0;\n\n\t\t\t}\n\n\t\t\tfloatArray[ index ++ ] = getField( m, 'attenuationDistance', Infinity );\n\n\t\t\t// sample 13\n\t\t\t// alphaMap\n\t\t\tfloatArray[ index ++ ] = getTexture( m, 'alphaMap' );\n\n\t\t\t// side & matte\n\t\t\tfloatArray[ index ++ ] = m.opacity;\n\t\t\tfloatArray[ index ++ ] = m.alphaTest;\n\t\t\tif ( ! isThinFilm && m.transmission > 0.0 ) {\n\n\t\t\t\tfloatArray[ index ++ ] = 0;\n\n\t\t\t} else {\n\n\t\t\t\tswitch ( m.side ) {\n\n\t\t\t\tcase FrontSide:\n\t\t\t\t\tfloatArray[ index ++ ] = 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase BackSide:\n\t\t\t\t\tfloatArray[ index ++ ] = - 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DoubleSide:\n\t\t\t\t\tfloatArray[ index ++ ] = 0;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// sample 14\n\t\t\tfloatArray[ index ++ ] = Number( getField( m, 'matte', false ) ); // matte\n\t\t\tfloatArray[ index ++ ] = Number( getField( m, 'castShadow', true ) ); // shadow\n\t\t\tfloatArray[ index ++ ] = Number( m.vertexColors ) | ( Number( m.flatShading ) << 1 ); // vertexColors & flatShading\n\t\t\tfloatArray[ index ++ ] = Number( m.transparent ); // transparent\n\n\t\t\t// map transform 15\n\t\t\tindex += writeTextureMatrixToArray( m, 'map', floatArray, index );\n\n\t\t\t// metalnessMap transform 17\n\t\t\tindex += writeTextureMatrixToArray( m, 'metalnessMap', floatArray, index );\n\n\t\t\t// roughnessMap transform 19\n\t\t\tindex += writeTextureMatrixToArray( m, 'roughnessMap', floatArray, index );\n\n\t\t\t// transmissionMap transform 21\n\t\t\tindex += writeTextureMatrixToArray( m, 'transmissionMap', floatArray, index );\n\n\t\t\t// emissiveMap transform 22\n\t\t\tindex += writeTextureMatrixToArray( m, 'emissiveMap', floatArray, index );\n\n\t\t\t// normalMap transform 25\n\t\t\tindex += writeTextureMatrixToArray( m, 'normalMap', floatArray, index );\n\n\t\t\t// clearcoatMap transform 27\n\t\t\tindex += writeTextureMatrixToArray( m, 'clearcoatMap', floatArray, index );\n\n\t\t\t// clearcoatNormalMap transform 29\n\t\t\tindex += writeTextureMatrixToArray( m, 'clearcoatNormalMap', floatArray, index );\n\n\t\t\t// clearcoatRoughnessMap transform 31\n\t\t\tindex += writeTextureMatrixToArray( m, 'clearcoatRoughnessMap', floatArray, index );\n\n\t\t\t// sheenColorMap transform 33\n\t\t\tindex += writeTextureMatrixToArray( m, 'sheenColorMap', floatArray, index );\n\n\t\t\t// sheenRoughnessMap transform 35\n\t\t\tindex += writeTextureMatrixToArray( m, 'sheenRoughnessMap', floatArray, index );\n\n\t\t\t// iridescenceMap transform 37\n\t\t\tindex += writeTextureMatrixToArray( m, 'iridescenceMap', floatArray, index );\n\n\t\t\t// iridescenceThicknessMap transform 39\n\t\t\tindex += writeTextureMatrixToArray( m, 'iridescenceThicknessMap', floatArray, index );\n\n\t\t\t// specularColorMap transform 41\n\t\t\tindex += writeTextureMatrixToArray( m, 'specularColorMap', floatArray, index );\n\n\t\t\t// specularIntensityMap transform 43\n\t\t\tindex += writeTextureMatrixToArray( m, 'specularIntensityMap', floatArray, index );\n\n\t\t\t// alphaMap transform 45\n\t\t\tindex += writeTextureMatrixToArray( m, 'alphaMap', floatArray, index );\n\n\t\t}\n\n\t\t// check if the contents have changed\n\t\tconst hash = bufferToHash( floatArray.buffer );\n\t\tif ( this.hash !== hash ) {\n\n\t\t\tthis.hash = hash;\n\t\t\tthis.needsUpdate = true;\n\t\t\treturn true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n}\n","import {\n\tWebGLArrayRenderTarget,\n\tRGBAFormat,\n\tUnsignedByteType,\n\tColor,\n\tRepeatWrapping,\n\tLinearFilter,\n\tNoToneMapping,\n\tShaderMaterial,\n} from 'three';\nimport { FullScreenQuad } from 'three/examples/jsm/postprocessing/Pass.js';\n\nconst prevColor = new Color();\nfunction getTextureHash( texture ) {\n\n\treturn texture ? `${ texture.uuid }:${ texture.version }` : null;\n\n}\n\nfunction assignOptions( target, options ) {\n\n\tfor ( const key in options ) {\n\n\t\tif ( key in target ) {\n\n\t\t\ttarget[ key ] = options[ key ];\n\n\t\t}\n\n\t}\n\n}\n\nexport class RenderTarget2DArray extends WebGLArrayRenderTarget {\n\n\tconstructor( width, height, options ) {\n\n\t\tconst textureOptions = {\n\t\t\tformat: RGBAFormat,\n\t\t\ttype: UnsignedByteType,\n\t\t\tminFilter: LinearFilter,\n\t\t\tmagFilter: LinearFilter,\n\t\t\twrapS: RepeatWrapping,\n\t\t\twrapT: RepeatWrapping,\n\t\t\tgenerateMipmaps: false,\n\t\t\t...options,\n\t\t};\n\n\t\tsuper( width, height, 1, textureOptions );\n\n\t\t// manually assign the options because passing options into the\n\t\t// constructor does not work\n\t\tassignOptions( this.texture, textureOptions );\n\n\t\tthis.texture.setTextures = ( ...args ) => {\n\n\t\t\tthis.setTextures( ...args );\n\n\t\t};\n\n\t\tthis.hashes = [ null ];\n\n\t\tconst fsQuad = new FullScreenQuad( new CopyMaterial() );\n\t\tthis.fsQuad = fsQuad;\n\n\t}\n\n\tsetTextures( renderer, textures, width = this.width, height = this.height ) {\n\n\t\t// save previous renderer state\n\t\tconst prevRenderTarget = renderer.getRenderTarget();\n\t\tconst prevToneMapping = renderer.toneMapping;\n\t\tconst prevAlpha = renderer.getClearAlpha();\n\t\trenderer.getClearColor( prevColor );\n\n\t\t// resize the render target and ensure we don't have an empty texture\n\t\t// render target depth must be >= 1 to avoid unbound texture error on android devices\n\t\tconst depth = textures.length || 1;\n\t\tif ( width !== this.width || height !== this.height || this.depth !== depth ) {\n\n\t\t\tthis.setSize( width, height, depth );\n\t\t\tthis.hashes = new Array( depth ).fill( null );\n\n\t\t}\n\n\t\trenderer.setClearColor( 0, 0 );\n\t\trenderer.toneMapping = NoToneMapping;\n\n\t\t// render each texture into each layer of the target\n\t\tconst fsQuad = this.fsQuad;\n\t\tconst hashes = this.hashes;\n\t\tlet updated = false;\n\t\tfor ( let i = 0, l = depth; i < l; i ++ ) {\n\n\t\t\tconst texture = textures[ i ];\n\t\t\tconst hash = getTextureHash( texture );\n\t\t\tif ( texture && ( hashes[ i ] !== hash || texture.isWebGLRenderTarget ) ) {\n\n\t\t\t\t// revert to default texture transform before rendering\n\t\t\t\ttexture.matrixAutoUpdate = false;\n\t\t\t\ttexture.matrix.identity();\n\n\t\t\t\tfsQuad.material.map = texture;\n\n\t\t\t\trenderer.setRenderTarget( this, i );\n\t\t\t\tfsQuad.render( renderer );\n\n\t\t\t\t// restore custom texture transform\n\t\t\t\ttexture.updateMatrix();\n\t\t\t\ttexture.matrixAutoUpdate = true;\n\n\t\t\t\t// ensure textures are not updated unnecessarily\n\t\t\t\thashes[ i ] = hash;\n\t\t\t\tupdated = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// reset the renderer\n\t\tfsQuad.material.map = null;\n\t\trenderer.setClearColor( prevColor, prevAlpha );\n\t\trenderer.setRenderTarget( prevRenderTarget );\n\t\trenderer.toneMapping = prevToneMapping;\n\n\t\treturn updated;\n\n\t}\n\n\tdispose() {\n\n\t\tsuper.dispose();\n\t\tthis.fsQuad.dispose();\n\n\t}\n\n}\n\nclass CopyMaterial extends ShaderMaterial {\n\n\tget map() {\n\n\t\treturn this.uniforms.map.value;\n\n\t}\n\tset map( v ) {\n\n\t\tthis.uniforms.map.value = v;\n\n\t}\n\n\tconstructor() {\n\n\t\tsuper( {\n\t\t\tuniforms: {\n\n\t\t\t\tmap: { value: null },\n\n\t\t\t},\n\n\t\t\tvertexShader: /* glsl */`\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t\t}\n\t\t\t`,\n\n\t\t\tfragmentShader: /* glsl */`\n\t\t\t\tuniform sampler2D map;\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_FragColor = texture2D( map, vUv );\n\n\t\t\t\t}\n\t\t\t`\n\t\t} );\n\n\t}\n\n}\n","// Stratified Sampling based on implementation from hoverinc pathtracer\n// - https://github.com/hoverinc/ray-tracing-renderer\n// - http://www.pbr-book.org/3ed-2018/Sampling_and_Reconstruction/Stratified_Sampling.html\n\nexport function shuffle( arr, random = Math.random() ) {\n\n\tfor ( let i = arr.length - 1; i > 0; i -- ) {\n\n\t  const j = Math.floor( random() * ( i + 1 ) );\n\t  const x = arr[ i ];\n\t  arr[ i ] = arr[ j ];\n\t  arr[ j ] = x;\n\n\t}\n\n\treturn arr;\n\n}\n\n// strataCount : The number of bins per dimension\n// dimensions  : The number of dimensions to generate stratified values for\nexport class StratifiedSampler {\n\n\tconstructor( strataCount, dimensions, random = Math.random ) {\n\n\t\tconst l = strataCount ** dimensions;\n\t\tconst strata = new Uint16Array( l );\n\t\tlet index = l;\n\n\t\t// each integer represents a statum bin\n\t\tfor ( let i = 0; i < l; i ++ ) {\n\n\t\t\tstrata[ i ] = i;\n\n\t\t}\n\n\t\tthis.samples = new Float32Array( dimensions );\n\n\t\tthis.strataCount = strataCount;\n\n\t\tthis.reset = function () {\n\n\t\t\tfor ( let i = 0; i < l; i ++ ) {\n\n\t\t\t\tstrata[ i ] = i;\n\n\t\t\t}\n\n\t\t\tindex = 0;\n\n\t\t};\n\n\t\tthis.reshuffle = function () {\n\n\t\t\tindex = 0;\n\n\t\t};\n\n\t\tthis.next = function () {\n\n\t\t\tconst { samples } = this;\n\n\t\t\tif ( index >= strata.length ) {\n\n\t\t\t\tshuffle( strata, random );\n\t\t\t\tthis.reshuffle();\n\n\t\t\t}\n\n\t\t\tlet stratum = strata[ index ++ ];\n\n\t\t\tfor ( let i = 0; i < dimensions; i ++ ) {\n\n\t\t\t\tsamples[ i ] = ( stratum % strataCount + random() ) / strataCount;\n\t\t\t\tstratum = Math.floor( stratum / strataCount );\n\n\t\t\t}\n\n\t\t\treturn samples;\n\n\t\t};\n\n\t}\n\n}\n","// Stratified Sampling based on implementation from hoverinc pathtracer\n// - https://github.com/hoverinc/ray-tracing-renderer\n// - http://www.pbr-book.org/3ed-2018/Sampling_and_Reconstruction/Stratified_Sampling.html\n\nimport { StratifiedSampler } from './StratifiedSampler.js';\n\n// Stratified set of data with each tuple stratified separately and combined\nexport class StratifiedSamplerCombined {\n\n\tconstructor( strataCount, listOfDimensions, random = Math.random ) {\n\n\t\tlet totalDim = 0;\n\t\tfor ( const dim of listOfDimensions ) {\n\n\t\t\ttotalDim += dim;\n\n\t\t}\n\n\t\tconst combined = new Float32Array( totalDim );\n\t\tconst strataObjs = [];\n\t\tlet offset = 0;\n\t\tfor ( const dim of listOfDimensions ) {\n\n\t\t\tconst sampler = new StratifiedSampler( strataCount, dim, random );\n\t\t\tsampler.samples = new Float32Array( combined.buffer, offset, sampler.samples.length );\n\t\t\toffset += sampler.samples.length * 4;\n\t\t\tstrataObjs.push( sampler );\n\n\t\t}\n\n\t\tthis.samples = combined;\n\n\t\tthis.strataCount = strataCount;\n\n\t\tthis.next = function () {\n\n\t\t\tfor ( const strata of strataObjs ) {\n\n\t\t\t\tstrata.next();\n\n\t\t\t}\n\n\t\t\treturn combined;\n\n\t\t};\n\n\t\tthis.reshuffle = function () {\n\n\t\t\tfor ( const strata of strataObjs ) {\n\n\t\t\t\tstrata.reshuffle();\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.reset = function () {\n\n\t\t\tfor ( const strata of strataObjs ) {\n\n\t\t\t\tstrata.reset();\n\n\t\t\t}\n\n\t\t};\n\n\t}\n\n}\n","import { DataTexture, FloatType, NearestFilter, RGBAFormat } from 'three';\nimport { StratifiedSamplerCombined } from './stratified/StratifiedSamplerCombined.js';\n\n// https://stackoverflow.com/questions/424292/seedable-javascript-random-number-generator\nclass RandomGenerator {\n\n\tconstructor( seed = 0 ) {\n\n\t\t// LCG using GCC's constants\n\t\tthis.m = 0x80000000; // 2**31;\n\t\tthis.a = 1103515245;\n\t\tthis.c = 12345;\n\n\t\tthis.seed = seed;\n\n\t}\n\n\tnextInt() {\n\n\t\tthis.seed = ( this.a * this.seed + this.c ) % this.m;\n\t\treturn this.seed;\n\n\t}\n\n\tnextFloat() {\n\n\t\t// returns in range [0,1]\n\t\treturn this.nextInt() / ( this.m - 1 );\n\n\t}\n\n}\n\nexport class StratifiedSamplesTexture extends DataTexture {\n\n\tconstructor( count = 1, depth = 1, strata = 8 ) {\n\n\t\tsuper( new Float32Array( 1 ), 1, 1, RGBAFormat, FloatType );\n\t\tthis.minFilter = NearestFilter;\n\t\tthis.magFilter = NearestFilter;\n\n\t\tthis.strata = strata;\n\t\tthis.sampler = null;\n\t\tthis.generator = new RandomGenerator();\n\t\tthis.stableNoise = false;\n\t\tthis.random = () => {\n\n\t\t\tif ( this.stableNoise ) {\n\n\t\t\t\treturn this.generator.nextFloat();\n\n\t\t\t} else {\n\n\t\t\t\treturn Math.random();\n\n\t\t\t}\n\n\t\t};\n\n\t\tthis.init( count, depth, strata );\n\n\t}\n\n\tinit( count = this.image.height, depth = this.image.width, strata = this.strata ) {\n\n\t\tconst { image } = this;\n\t\tif ( image.width === depth && image.height === count && this.sampler !== null ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst dimensions = new Array( count * depth ).fill( 4 );\n\t\tconst sampler = new StratifiedSamplerCombined( strata, dimensions, this.random );\n\n\t\timage.width = depth;\n\t\timage.height = count;\n\t\timage.data = sampler.samples;\n\n\t\tthis.sampler = sampler;\n\n\t\tthis.dispose();\n\t\tthis.next();\n\n\t}\n\n\tnext() {\n\n\t\tthis.sampler.next();\n\t\tthis.needsUpdate = true;\n\n\t}\n\n\treset() {\n\n\t\tthis.sampler.reset();\n\t\tthis.generator.seed = 0;\n\n\t}\n\n}\n","export function shuffleArray( array, random = Math.random ) {\n\n\tfor ( let i = array.length - 1; i > 0; i -- ) {\n\n\t\tconst replaceIndex = ~ ~ ( ( random() - 1e-6 ) * i );\n\t\tconst tmp = array[ i ];\n\t\tarray[ i ] = array[ replaceIndex ];\n\t\tarray[ replaceIndex ] = tmp;\n\n\t}\n\n}\n\nexport function fillWithOnes( array, count ) {\n\n\tarray.fill( 0 );\n\n\tfor ( let i = 0; i < count; i ++ ) {\n\n\t\tarray[ i ] = 1;\n\n\t}\n\n}\n","export class BlueNoiseSamples {\n\n\tconstructor( size ) {\n\n\t\tthis.count = 0;\n\t\tthis.size = - 1;\n\t\tthis.sigma = - 1;\n\t\tthis.radius = - 1;\n\t\tthis.lookupTable = null;\n\t\tthis.score = null;\n\t\tthis.binaryPattern = null;\n\n\t\tthis.resize( size );\n\t\tthis.setSigma( 1.5 );\n\n\t}\n\n\tfindVoid() {\n\n\t\tconst { score, binaryPattern } = this;\n\n\t\tlet currValue = Infinity;\n\t\tlet currIndex = - 1;\n\t\tfor ( let i = 0, l = binaryPattern.length; i < l; i ++ ) {\n\n\t\t\tif ( binaryPattern[ i ] !== 0 ) {\n\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tconst pScore = score[ i ];\n\t\t\tif ( pScore < currValue ) {\n\n\t\t\t\tcurrValue = pScore;\n\t\t\t\tcurrIndex = i;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn currIndex;\n\n\t}\n\n\tfindCluster() {\n\n\t\tconst { score, binaryPattern } = this;\n\n\t\tlet currValue = - Infinity;\n\t\tlet currIndex = - 1;\n\t\tfor ( let i = 0, l = binaryPattern.length; i < l; i ++ ) {\n\n\t\t\tif ( binaryPattern[ i ] !== 1 ) {\n\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tconst pScore = score[ i ];\n\t\t\tif ( pScore > currValue ) {\n\n\t\t\t\tcurrValue = pScore;\n\t\t\t\tcurrIndex = i;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn currIndex;\n\n\t}\n\n\tsetSigma( sigma ) {\n\n\t\tif ( sigma === this.sigma ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\t// generate a radius in which the score will be updated under the\n\t\t// assumption that e^-10 is insignificant enough to be the border at\n\t\t// which we drop off.\n\t\tconst radius = ~ ~ ( Math.sqrt( 10 * 2 * ( sigma ** 2 ) ) + 1 );\n\t\tconst lookupWidth = 2 * radius + 1;\n\t\tconst lookupTable = new Float32Array( lookupWidth * lookupWidth );\n\t\tconst sigma2 = sigma * sigma;\n\t\tfor ( let x = - radius; x <= radius; x ++ ) {\n\n\t\t\tfor ( let y = - radius; y <= radius; y ++ ) {\n\n\t\t\t\tconst index = ( radius + y ) * lookupWidth + x + radius;\n\t\t\t\tconst dist2 = x * x + y * y;\n\t\t\t\tlookupTable[ index ] = Math.E ** ( - dist2 / ( 2 * sigma2 ) );\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.lookupTable = lookupTable;\n\t\tthis.sigma = sigma;\n\t\tthis.radius = radius;\n\n\t}\n\n\tresize( size ) {\n\n\t\tif ( this.size !== size ) {\n\n\t\t\tthis.size = size;\n\t\t\tthis.score = new Float32Array( size * size );\n\t\t\tthis.binaryPattern = new Uint8Array( size * size );\n\n\t\t}\n\n\n\t}\n\n\tinvert() {\n\n\t\tconst { binaryPattern, score, size } = this;\n\n\t\tscore.fill( 0 );\n\n\t\tfor ( let i = 0, l = binaryPattern.length; i < l; i ++ ) {\n\n\t\t\tif ( binaryPattern[ i ] === 0 ) {\n\n\t\t\t\tconst y = ~ ~ ( i / size );\n\t\t\t\tconst x = i - y * size;\n\t\t\t\tthis.updateScore( x, y, 1 );\n\t\t\t\tbinaryPattern[ i ] = 1;\n\n\t\t\t} else {\n\n\t\t\t\tbinaryPattern[ i ] = 0;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tupdateScore( x, y, multiplier ) {\n\n\t\t// TODO: Is there a way to keep track of the highest and lowest scores here to avoid have to search over\n\t\t// everything in the buffer?\n\t\tconst { size, score, lookupTable } = this;\n\n\t\t// const sigma2 = sigma * sigma;\n\t\t// const radius = Math.floor( size / 2 );\n\t\tconst radius = this.radius;\n\t\tconst lookupWidth = 2 * radius + 1;\n\t\tfor ( let px = - radius; px <= radius; px ++ ) {\n\n\t\t\tfor ( let py = - radius; py <= radius; py ++ ) {\n\n\t\t\t\t// const dist2 = px * px + py * py;\n\t\t\t\t// const value = Math.E ** ( - dist2 / ( 2 * sigma2 ) );\n\n\t\t\t\tconst lookupIndex = ( radius + py ) * lookupWidth + px + radius;\n\t\t\t\tconst value = lookupTable[ lookupIndex ];\n\n\t\t\t\tlet sx = ( x + px );\n\t\t\t\tsx = sx < 0 ? size + sx : sx % size;\n\n\t\t\t\tlet sy = ( y + py );\n\t\t\t\tsy = sy < 0 ? size + sy : sy % size;\n\n\t\t\t\tconst sindex = sy * size + sx;\n\t\t\t\tscore[ sindex ] += multiplier * value;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\taddPointIndex( index ) {\n\n\t\tthis.binaryPattern[ index ] = 1;\n\n\t\tconst size = this.size;\n\t\tconst y = ~ ~ ( index / size );\n\t\tconst x = index - y * size;\n\t\tthis.updateScore( x, y, 1 );\n\t\tthis.count ++;\n\n\t}\n\n\tremovePointIndex( index ) {\n\n\t\tthis.binaryPattern[ index ] = 0;\n\n\t\tconst size = this.size;\n\t\tconst y = ~ ~ ( index / size );\n\t\tconst x = index - y * size;\n\t\tthis.updateScore( x, y, - 1 );\n\t\tthis.count --;\n\n\t}\n\n\tcopy( source ) {\n\n\t\tthis.resize( source.size );\n\t\tthis.score.set( source.score );\n\t\tthis.binaryPattern.set( source.binaryPattern );\n\t\tthis.setSigma( source.sigma );\n\t\tthis.count = source.count;\n\n\t}\n\n}\n","import { shuffleArray, fillWithOnes } from './utils.js';\nimport { BlueNoiseSamples } from './BlueNoiseSamples.js';\n\nexport class BlueNoiseGenerator {\n\n\tconstructor() {\n\n\t\tthis.random = Math.random;\n\t\tthis.sigma = 1.5;\n\t\tthis.size = 64;\n\t\tthis.majorityPointsRatio = 0.1;\n\n\t\tthis.samples = new BlueNoiseSamples( 1 );\n\t\tthis.savedSamples = new BlueNoiseSamples( 1 );\n\n\t}\n\n\tgenerate() {\n\n\t\t// http://cv.ulichney.com/papers/1993-void-cluster.pdf\n\n\t\tconst {\n\t\t\tsamples,\n\t\t\tsavedSamples,\n\t\t\tsigma,\n\t\t\tmajorityPointsRatio,\n\t\t\tsize,\n\t\t} = this;\n\n\t\tsamples.resize( size );\n\t\tsamples.setSigma( sigma );\n\n\t\t// 1. Randomly place the minority points.\n\t\tconst pointCount = Math.floor( size * size * majorityPointsRatio );\n\t\tconst initialSamples = samples.binaryPattern;\n\n\t\tfillWithOnes( initialSamples, pointCount );\n\t\tshuffleArray( initialSamples, this.random );\n\n\t\tfor ( let i = 0, l = initialSamples.length; i < l; i ++ ) {\n\n\t\t\tif ( initialSamples[ i ] === 1 ) {\n\n\t\t\t\tsamples.addPointIndex( i );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// 2. Remove minority point that is in densest cluster and place it in the largest void.\n\t\twhile ( true ) {\n\n\t\t\tconst clusterIndex = samples.findCluster();\n\t\t\tsamples.removePointIndex( clusterIndex );\n\n\t\t\tconst voidIndex = samples.findVoid();\n\t\t\tif ( clusterIndex === voidIndex ) {\n\n\t\t\t\tsamples.addPointIndex( clusterIndex );\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t\tsamples.addPointIndex( voidIndex );\n\n\t\t}\n\n\t\t// 3. PHASE I: Assign a rank to each progressively less dense cluster point and put it\n\t\t// in the dither array.\n\t\tconst ditherArray = new Uint32Array( size * size );\n\t\tsavedSamples.copy( samples );\n\n\t\tlet rank;\n\t\trank = samples.count - 1;\n\t\twhile ( rank >= 0 ) {\n\n\t\t\tconst clusterIndex = samples.findCluster();\n\t\t\tsamples.removePointIndex( clusterIndex );\n\n\t\t\tditherArray[ clusterIndex ] = rank;\n\t\t\trank --;\n\n\t\t}\n\n\t\t// 4. PHASE II: Do the same thing for the largest voids up to half of the total pixels using\n\t\t// the initial binary pattern.\n\t\tconst totalSize = size * size;\n\t\trank = savedSamples.count;\n\t\twhile ( rank < totalSize / 2 ) {\n\n\t\t\tconst voidIndex = savedSamples.findVoid();\n\t\t\tsavedSamples.addPointIndex( voidIndex );\n\t\t\tditherArray[ voidIndex ] = rank;\n\t\t\trank ++;\n\n\t\t}\n\n\t\t// 5. PHASE III: Invert the pattern and finish out by assigning a rank to the remaining\n\t\t// and iteratively removing them.\n\t\tsavedSamples.invert();\n\n\t\twhile ( rank < totalSize ) {\n\n\t\t\tconst clusterIndex = savedSamples.findCluster();\n\t\t\tsavedSamples.removePointIndex( clusterIndex );\n\t\t\tditherArray[ clusterIndex ] = rank;\n\t\t\trank ++;\n\n\t\t}\n\n\t\treturn { data: ditherArray, maxValue: totalSize };\n\n\t}\n\n}\n","import { DataTexture, FloatType, NearestFilter, RGBAFormat, RGFormat, RedFormat } from 'three';\nimport { BlueNoiseGenerator } from './blueNoise/BlueNoiseGenerator.js';\n\nfunction getStride( channels ) {\n\n\tif ( channels >= 3 ) {\n\n\t\treturn 4;\n\n\t} else {\n\n\t\treturn channels;\n\n\t}\n\n}\n\nfunction getFormat( channels ) {\n\n\tswitch ( channels ) {\n\n\tcase 1:\n\t\treturn RedFormat;\n\tcase 2:\n\t\treturn RGFormat;\n\tdefault:\n\t\treturn RGBAFormat;\n\n\t}\n\n}\n\nexport class BlueNoiseTexture extends DataTexture {\n\n\tconstructor( size = 64, channels = 1 ) {\n\n\t\tsuper( new Float32Array( 4 ), 1, 1, RGBAFormat, FloatType );\n\t\tthis.minFilter = NearestFilter;\n\t\tthis.magFilter = NearestFilter;\n\n\t\tthis.size = size;\n\t\tthis.channels = channels;\n\t\tthis.update();\n\n\t}\n\n\tupdate() {\n\n\t\tconst channels = this.channels;\n\t\tconst size = this.size;\n\t\tconst generator = new BlueNoiseGenerator();\n\t\tgenerator.channels = channels;\n\t\tgenerator.size = size;\n\n\t\tconst stride = getStride( channels );\n\t\tconst format = getFormat( stride );\n\t\tif ( this.image.width !== size || format !== this.format ) {\n\n\t\t\tthis.image.width = size;\n\t\t\tthis.image.height = size;\n\t\t\tthis.image.data = new Float32Array( ( size ** 2 ) * stride );\n\t\t\tthis.format = format;\n\t\t\tthis.dispose();\n\n\t\t}\n\n\t\tconst data = this.image.data;\n\t\tfor ( let i = 0, l = channels; i < l; i ++ ) {\n\n\t\t\tconst result = generator.generate();\n\t\t\tconst bin = result.data;\n\t\t\tconst maxValue = result.maxValue;\n\n\t\t\tfor ( let j = 0, l2 = bin.length; j < l2; j ++ ) {\n\n\t\t\t\tconst value = bin[ j ] / maxValue;\n\t\t\t\tdata[ j * stride + i ] = value;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.needsUpdate = true;\n\n\t}\n\n}\n","export const camera_struct = /* glsl */`\n\n\tstruct PhysicalCamera {\n\n\t\tfloat focusDistance;\n\t\tfloat anamorphicRatio;\n\t\tfloat bokehSize;\n\t\tint apertureBlades;\n\t\tfloat apertureRotation;\n\n\t};\n\n`;\n","export const equirect_struct = /* glsl */`\n\n\tstruct EquirectHdrInfo {\n\n\t\tsampler2D marginalWeights;\n\t\tsampler2D conditionalWeights;\n\t\tsampler2D map;\n\n\t\tfloat totalSum;\n\n\t};\n\n`;\n","export const lights_struct = /* glsl */`\n\n\t#define RECT_AREA_LIGHT_TYPE 0\n\t#define CIRC_AREA_LIGHT_TYPE 1\n\t#define SPOT_LIGHT_TYPE 2\n\t#define DIR_LIGHT_TYPE 3\n\t#define POINT_LIGHT_TYPE 4\n\n\tstruct LightsInfo {\n\n\t\tsampler2D tex;\n\t\tuint count;\n\n\t};\n\n\tstruct Light {\n\n\t\tvec3 position;\n\t\tint type;\n\n\t\tvec3 color;\n\t\tfloat intensity;\n\n\t\tvec3 u;\n\t\tvec3 v;\n\t\tfloat area;\n\n\t\t// spot light fields\n\t\tfloat radius;\n\t\tfloat near;\n\t\tfloat decay;\n\t\tfloat distance;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint iesProfile;\n\n\t};\n\n\tLight readLightInfo( sampler2D tex, uint index ) {\n\n\t\tuint i = index * 6u;\n\n\t\tvec4 s0 = texelFetch1D( tex, i + 0u );\n\t\tvec4 s1 = texelFetch1D( tex, i + 1u );\n\t\tvec4 s2 = texelFetch1D( tex, i + 2u );\n\t\tvec4 s3 = texelFetch1D( tex, i + 3u );\n\n\t\tLight l;\n\t\tl.position = s0.rgb;\n\t\tl.type = int( round( s0.a ) );\n\n\t\tl.color = s1.rgb;\n\t\tl.intensity = s1.a;\n\n\t\tl.u = s2.rgb;\n\t\tl.v = s3.rgb;\n\t\tl.area = s3.a;\n\n\t\tif ( l.type == SPOT_LIGHT_TYPE || l.type == POINT_LIGHT_TYPE ) {\n\n\t\t\tvec4 s4 = texelFetch1D( tex, i + 4u );\n\t\t\tvec4 s5 = texelFetch1D( tex, i + 5u );\n\t\t\tl.radius = s4.r;\n\t\t\tl.decay = s4.g;\n\t\t\tl.distance = s4.b;\n\t\t\tl.coneCos = s4.a;\n\n\t\t\tl.penumbraCos = s5.r;\n\t\t\tl.iesProfile = int( round( s5.g ) );\n\n\t\t} else {\n\n\t\t\tl.radius = 0.0;\n\t\t\tl.decay = 0.0;\n\t\t\tl.distance = 0.0;\n\n\t\t\tl.coneCos = 0.0;\n\t\t\tl.penumbraCos = 0.0;\n\t\t\tl.iesProfile = - 1;\n\n\t\t}\n\n\t\treturn l;\n\n\t}\n\n`;\n","export const material_struct = /* glsl */ `\n\n\tstruct Material {\n\n\t\tvec3 color;\n\t\tint map;\n\n\t\tfloat metalness;\n\t\tint metalnessMap;\n\n\t\tfloat roughness;\n\t\tint roughnessMap;\n\n\t\tfloat ior;\n\t\tfloat transmission;\n\t\tint transmissionMap;\n\n\t\tfloat emissiveIntensity;\n\t\tvec3 emissive;\n\t\tint emissiveMap;\n\n\t\tint normalMap;\n\t\tvec2 normalScale;\n\n\t\tfloat clearcoat;\n\t\tint clearcoatMap;\n\t\tint clearcoatNormalMap;\n\t\tvec2 clearcoatNormalScale;\n\t\tfloat clearcoatRoughness;\n\t\tint clearcoatRoughnessMap;\n\n\t\tint iridescenceMap;\n\t\tint iridescenceThicknessMap;\n\t\tfloat iridescence;\n\t\tfloat iridescenceIor;\n\t\tfloat iridescenceThicknessMinimum;\n\t\tfloat iridescenceThicknessMaximum;\n\n\t\tvec3 specularColor;\n\t\tint specularColorMap;\n\n\t\tfloat specularIntensity;\n\t\tint specularIntensityMap;\n\t\tbool thinFilm;\n\n\t\tvec3 attenuationColor;\n\t\tfloat attenuationDistance;\n\n\t\tint alphaMap;\n\n\t\tbool castShadow;\n\t\tfloat opacity;\n\t\tfloat alphaTest;\n\n\t\tfloat side;\n\t\tbool matte;\n\n\t\tfloat sheen;\n\t\tvec3 sheenColor;\n\t\tint sheenColorMap;\n\t\tfloat sheenRoughness;\n\t\tint sheenRoughnessMap;\n\n\t\tbool vertexColors;\n\t\tbool flatShading;\n\t\tbool transparent;\n\t\tbool fogVolume;\n\n\t\tmat3 mapTransform;\n\t\tmat3 metalnessMapTransform;\n\t\tmat3 roughnessMapTransform;\n\t\tmat3 transmissionMapTransform;\n\t\tmat3 emissiveMapTransform;\n\t\tmat3 normalMapTransform;\n\t\tmat3 clearcoatMapTransform;\n\t\tmat3 clearcoatNormalMapTransform;\n\t\tmat3 clearcoatRoughnessMapTransform;\n\t\tmat3 sheenColorMapTransform;\n\t\tmat3 sheenRoughnessMapTransform;\n\t\tmat3 iridescenceMapTransform;\n\t\tmat3 iridescenceThicknessMapTransform;\n\t\tmat3 specularColorMapTransform;\n\t\tmat3 specularIntensityMapTransform;\n\t\tmat3 alphaMapTransform;\n\n\t};\n\n\tmat3 readTextureTransform( sampler2D tex, uint index ) {\n\n\t\tmat3 textureTransform;\n\n\t\tvec4 row1 = texelFetch1D( tex, index );\n\t\tvec4 row2 = texelFetch1D( tex, index + 1u );\n\n\t\ttextureTransform[0] = vec3(row1.r, row2.r, 0.0);\n\t\ttextureTransform[1] = vec3(row1.g, row2.g, 0.0);\n\t\ttextureTransform[2] = vec3(row1.b, row2.b, 1.0);\n\n\t\treturn textureTransform;\n\n\t}\n\n\tMaterial readMaterialInfo( sampler2D tex, uint index ) {\n\n\t\tuint i = index * uint( MATERIAL_PIXELS );\n\n\t\tvec4 s0 = texelFetch1D( tex, i + 0u );\n\t\tvec4 s1 = texelFetch1D( tex, i + 1u );\n\t\tvec4 s2 = texelFetch1D( tex, i + 2u );\n\t\tvec4 s3 = texelFetch1D( tex, i + 3u );\n\t\tvec4 s4 = texelFetch1D( tex, i + 4u );\n\t\tvec4 s5 = texelFetch1D( tex, i + 5u );\n\t\tvec4 s6 = texelFetch1D( tex, i + 6u );\n\t\tvec4 s7 = texelFetch1D( tex, i + 7u );\n\t\tvec4 s8 = texelFetch1D( tex, i + 8u );\n\t\tvec4 s9 = texelFetch1D( tex, i + 9u );\n\t\tvec4 s10 = texelFetch1D( tex, i + 10u );\n\t\tvec4 s11 = texelFetch1D( tex, i + 11u );\n\t\tvec4 s12 = texelFetch1D( tex, i + 12u );\n\t\tvec4 s13 = texelFetch1D( tex, i + 13u );\n\t\tvec4 s14 = texelFetch1D( tex, i + 14u );\n\n\t\tMaterial m;\n\t\tm.color = s0.rgb;\n\t\tm.map = int( round( s0.a ) );\n\n\t\tm.metalness = s1.r;\n\t\tm.metalnessMap = int( round( s1.g ) );\n\t\tm.roughness = s1.b;\n\t\tm.roughnessMap = int( round( s1.a ) );\n\n\t\tm.ior = s2.r;\n\t\tm.transmission = s2.g;\n\t\tm.transmissionMap = int( round( s2.b ) );\n\t\tm.emissiveIntensity = s2.a;\n\n\t\tm.emissive = s3.rgb;\n\t\tm.emissiveMap = int( round( s3.a ) );\n\n\t\tm.normalMap = int( round( s4.r ) );\n\t\tm.normalScale = s4.gb;\n\n\t\tm.clearcoat = s4.a;\n\t\tm.clearcoatMap = int( round( s5.r ) );\n\t\tm.clearcoatRoughness = s5.g;\n\t\tm.clearcoatRoughnessMap = int( round( s5.b ) );\n\t\tm.clearcoatNormalMap = int( round( s5.a ) );\n\t\tm.clearcoatNormalScale = s6.rg;\n\n\t\tm.sheen = s6.a;\n\t\tm.sheenColor = s7.rgb;\n\t\tm.sheenColorMap = int( round( s7.a ) );\n\t\tm.sheenRoughness = s8.r;\n\t\tm.sheenRoughnessMap = int( round( s8.g ) );\n\n\t\tm.iridescenceMap = int( round( s8.b ) );\n\t\tm.iridescenceThicknessMap = int( round( s8.a ) );\n\t\tm.iridescence = s9.r;\n\t\tm.iridescenceIor = s9.g;\n\t\tm.iridescenceThicknessMinimum = s9.b;\n\t\tm.iridescenceThicknessMaximum = s9.a;\n\n\t\tm.specularColor = s10.rgb;\n\t\tm.specularColorMap = int( round( s10.a ) );\n\n\t\tm.specularIntensity = s11.r;\n\t\tm.specularIntensityMap = int( round( s11.g ) );\n\t\tm.thinFilm = bool( s11.b );\n\n\t\tm.attenuationColor = s12.rgb;\n\t\tm.attenuationDistance = s12.a;\n\n\t\tm.alphaMap = int( round( s13.r ) );\n\n\t\tm.opacity = s13.g;\n\t\tm.alphaTest = s13.b;\n\t\tm.side = s13.a;\n\n\t\tm.matte = bool( s14.r );\n\t\tm.castShadow = bool( s14.g );\n\t\tm.vertexColors = bool( int( s14.b ) & 1 );\n\t\tm.flatShading = bool( int( s14.b ) & 2 );\n\t\tm.fogVolume = bool( int( s14.b ) & 4 );\n\t\tm.transparent = bool( s14.a );\n\n\t\tuint firstTextureTransformIdx = i + 15u;\n\n\t\t// mat3( 1.0 ) is an identity matrix\n\t\tm.mapTransform = m.map == - 1 ? mat3( 1.0 ) : readTextureTransform( tex, firstTextureTransformIdx );\n\t\tm.metalnessMapTransform = m.metalnessMap == - 1 ? mat3( 1.0 ) : readTextureTransform( tex, firstTextureTransformIdx + 2u );\n\t\tm.roughnessMapTransform = m.roughnessMap == - 1 ? mat3( 1.0 ) : readTextureTransform( tex, firstTextureTransformIdx + 4u );\n\t\tm.transmissionMapTransform = m.transmissionMap == - 1 ? mat3( 1.0 ) : readTextureTransform( tex, firstTextureTransformIdx + 6u );\n\t\tm.emissiveMapTransform = m.emissiveMap == - 1 ? mat3( 1.0 ) : readTextureTransform( tex, firstTextureTransformIdx + 8u );\n\t\tm.normalMapTransform = m.normalMap == - 1 ? mat3( 1.0 ) : readTextureTransform( tex, firstTextureTransformIdx + 10u );\n\t\tm.clearcoatMapTransform = m.clearcoatMap == - 1 ? mat3( 1.0 ) : readTextureTransform( tex, firstTextureTransformIdx + 12u );\n\t\tm.clearcoatNormalMapTransform = m.clearcoatNormalMap == - 1 ? mat3( 1.0 ) : readTextureTransform( tex, firstTextureTransformIdx + 14u );\n\t\tm.clearcoatRoughnessMapTransform = m.clearcoatRoughnessMap == - 1 ? mat3( 1.0 ) : readTextureTransform( tex, firstTextureTransformIdx + 16u );\n\t\tm.sheenColorMapTransform = m.sheenColorMap == - 1 ? mat3( 1.0 ) : readTextureTransform( tex, firstTextureTransformIdx + 18u );\n\t\tm.sheenRoughnessMapTransform = m.sheenRoughnessMap == - 1 ? mat3( 1.0 ) : readTextureTransform( tex, firstTextureTransformIdx + 20u );\n\t\tm.iridescenceMapTransform = m.iridescenceMap == - 1 ? mat3( 1.0 ) : readTextureTransform( tex, firstTextureTransformIdx + 22u );\n\t\tm.iridescenceThicknessMapTransform = m.iridescenceThicknessMap == - 1 ? mat3( 1.0 ) : readTextureTransform( tex, firstTextureTransformIdx + 24u );\n\t\tm.specularColorMapTransform = m.specularColorMap == - 1 ? mat3( 1.0 ) : readTextureTransform( tex, firstTextureTransformIdx + 26u );\n\t\tm.specularIntensityMapTransform = m.specularIntensityMap == - 1 ? mat3( 1.0 ) : readTextureTransform( tex, firstTextureTransformIdx + 28u );\n\t\tm.alphaMapTransform = m.alphaMap == - 1 ? mat3( 1.0 ) : readTextureTransform( tex, firstTextureTransformIdx + 30u );\n\n\t\treturn m;\n\n\t}\n\n`;\n","export const surface_record_struct = /* glsl */`\n\n\tstruct SurfaceRecord {\n\n\t\t// surface type\n\t\tbool volumeParticle;\n\n\t\t// geometry\n\t\tvec3 faceNormal;\n\t\tbool frontFace;\n\t\tvec3 normal;\n\t\tmat3 normalBasis;\n\t\tmat3 normalInvBasis;\n\n\t\t// cached properties\n\t\tfloat eta;\n\t\tfloat f0;\n\n\t\t// material\n\t\tfloat roughness;\n\t\tfloat filteredRoughness;\n\t\tfloat metalness;\n\t\tvec3 color;\n\t\tvec3 emission;\n\n\t\t// transmission\n\t\tfloat ior;\n\t\tfloat transmission;\n\t\tbool thinFilm;\n\t\tvec3 attenuationColor;\n\t\tfloat attenuationDistance;\n\n\t\t// clearcoat\n\t\tvec3 clearcoatNormal;\n\t\tmat3 clearcoatBasis;\n\t\tmat3 clearcoatInvBasis;\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tfloat filteredClearcoatRoughness;\n\n\t\t// sheen\n\t\tfloat sheen;\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\n\t\t// iridescence\n\t\tfloat iridescence;\n\t\tfloat iridescenceIor;\n\t\tfloat iridescenceThickness;\n\n\t\t// specular\n\t\tvec3 specularColor;\n\t\tfloat specularIntensity;\n\t};\n\n\tstruct ScatterRecord {\n\t\tfloat specularPdf;\n\t\tfloat pdf;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\n`;\n","export const equirect_functions = /* glsl */`\n\n\t// samples the the given environment map in the given direction\n\tvec3 sampleEquirectColor( sampler2D envMap, vec3 direction ) {\n\n\t\treturn texture2D( envMap, equirectDirectionToUv( direction ) ).rgb;\n\n\t}\n\n\t// gets the pdf of the given direction to sample\n\tfloat equirectDirectionPdf( vec3 direction ) {\n\n\t\tvec2 uv = equirectDirectionToUv( direction );\n\t\tfloat theta = uv.y * PI;\n\t\tfloat sinTheta = sin( theta );\n\t\tif ( sinTheta == 0.0 ) {\n\n\t\t\treturn 0.0;\n\n\t\t}\n\n\t\treturn 1.0 / ( 2.0 * PI * PI * sinTheta );\n\n\t}\n\n\t// samples the color given env map with CDF and returns the pdf of the direction\n\tfloat sampleEquirect( vec3 direction, inout vec3 color ) {\n\n\t\tfloat totalSum = envMapInfo.totalSum;\n\t\tif ( totalSum == 0.0 ) {\n\n\t\t\tcolor = vec3( 0.0 );\n\t\t\treturn 1.0;\n\n\t\t}\n\n\t\tvec2 uv = equirectDirectionToUv( direction );\n\t\tcolor = texture2D( envMapInfo.map, uv ).rgb;\n\n\t\tfloat lum = luminance( color );\n\t\tivec2 resolution = textureSize( envMapInfo.map, 0 );\n\t\tfloat pdf = lum / totalSum;\n\n\t\treturn float( resolution.x * resolution.y ) * pdf * equirectDirectionPdf( direction );\n\n\t}\n\n\t// samples a direction of the envmap with color and retrieves pdf\n\tfloat sampleEquirectProbability( vec2 r, inout vec3 color, inout vec3 direction ) {\n\n\t\t// sample env map cdf\n\t\tfloat v = texture2D( envMapInfo.marginalWeights, vec2( r.x, 0.0 ) ).x;\n\t\tfloat u = texture2D( envMapInfo.conditionalWeights, vec2( r.y, v ) ).x;\n\t\tvec2 uv = vec2( u, v );\n\n\t\tvec3 derivedDirection = equirectUvToDirection( uv );\n\t\tdirection = derivedDirection;\n\t\tcolor = texture2D( envMapInfo.map, uv ).rgb;\n\n\t\tfloat totalSum = envMapInfo.totalSum;\n\t\tfloat lum = luminance( color );\n\t\tivec2 resolution = textureSize( envMapInfo.map, 0 );\n\t\tfloat pdf = lum / totalSum;\n\n\t\treturn float( resolution.x * resolution.y ) * pdf * equirectDirectionPdf( direction );\n\n\t}\n`;\n","export const light_sampling_functions = /* glsl */`\n\n\tfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\n\t\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n\n\t}\n\n\tfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\n\t\t// based upon Frostbite 3 Moving to Physically-based Rendering\n\t\t// page 32, equation 26: E[window1]\n\t\t// https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), EPSILON );\n\n\t\tif ( cutoffDistance > 0.0 ) {\n\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\n\t\t}\n\n\t\treturn distanceFalloff;\n\n\t}\n\n\tfloat getPhotometricAttenuation( sampler2DArray iesProfiles, int iesProfile, vec3 posToLight, vec3 lightDir, vec3 u, vec3 v ) {\n\n\t\tfloat cosTheta = dot( posToLight, lightDir );\n\t\tfloat angle = acos( cosTheta ) / PI;\n\n\t\treturn texture2D( iesProfiles, vec3( angle, 0.0, iesProfile ) ).r;\n\n\t}\n\n\tstruct LightRecord {\n\n\t\tfloat dist;\n\t\tvec3 direction;\n\t\tfloat pdf;\n\t\tvec3 emission;\n\t\tint type;\n\n\t};\n\n\tbool intersectLightAtIndex( sampler2D lights, vec3 rayOrigin, vec3 rayDirection, uint l, inout LightRecord lightRec ) {\n\n\t\tbool didHit = false;\n\t\tLight light = readLightInfo( lights, l );\n\n\t\tvec3 u = light.u;\n\t\tvec3 v = light.v;\n\n\t\t// check for backface\n\t\tvec3 normal = normalize( cross( u, v ) );\n\t\tif ( dot( normal, rayDirection ) > 0.0 ) {\n\n\t\t\tu *= 1.0 / dot( u, u );\n\t\t\tv *= 1.0 / dot( v, v );\n\n\t\t\tfloat dist;\n\n\t\t\t// MIS / light intersection is not supported for punctual lights.\n\t\t\tif(\n\t\t\t\t( light.type == RECT_AREA_LIGHT_TYPE && intersectsRectangle( light.position, normal, u, v, rayOrigin, rayDirection, dist ) ) ||\n\t\t\t\t( light.type == CIRC_AREA_LIGHT_TYPE && intersectsCircle( light.position, normal, u, v, rayOrigin, rayDirection, dist ) )\n\t\t\t) {\n\n\t\t\t\tfloat cosTheta = dot( rayDirection, normal );\n\t\t\t\tdidHit = true;\n\t\t\t\tlightRec.dist = dist;\n\t\t\t\tlightRec.pdf = ( dist * dist ) / ( light.area * cosTheta );\n\t\t\t\tlightRec.emission = light.color * light.intensity;\n\t\t\t\tlightRec.direction = rayDirection;\n\t\t\t\tlightRec.type = light.type;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn didHit;\n\n\t}\n\n\tLightRecord randomAreaLightSample( Light light, vec3 rayOrigin, vec2 ruv ) {\n\n\t\tvec3 randomPos;\n\t\tif( light.type == RECT_AREA_LIGHT_TYPE ) {\n\n\t\t\t// rectangular area light\n\t\t\trandomPos = light.position + light.u * ( ruv.x - 0.5 ) + light.v * ( ruv.y - 0.5 );\n\n\t\t} else if( light.type == CIRC_AREA_LIGHT_TYPE ) {\n\n\t\t\t// circular area light\n\t\t\tfloat r = 0.5 * sqrt( ruv.x );\n\t\t\tfloat theta = ruv.y * 2.0 * PI;\n\t\t\tfloat x = r * cos( theta );\n\t\t\tfloat y = r * sin( theta );\n\n\t\t\trandomPos = light.position + light.u * x + light.v * y;\n\n\t\t}\n\n\t\tvec3 toLight = randomPos - rayOrigin;\n\t\tfloat lightDistSq = dot( toLight, toLight );\n\t\tfloat dist = sqrt( lightDistSq );\n\t\tvec3 direction = toLight / dist;\n\t\tvec3 lightNormal = normalize( cross( light.u, light.v ) );\n\n\t\tLightRecord lightRec;\n\t\tlightRec.type = light.type;\n\t\tlightRec.emission = light.color * light.intensity;\n\t\tlightRec.dist = dist;\n\t\tlightRec.direction = direction;\n\n\t\t// TODO: the denominator is potentially zero\n\t\tlightRec.pdf = lightDistSq / ( light.area * dot( direction, lightNormal ) );\n\n\t\treturn lightRec;\n\n\t}\n\n\tLightRecord randomSpotLightSample( Light light, sampler2DArray iesProfiles, vec3 rayOrigin, vec2 ruv ) {\n\n\t\tfloat radius = light.radius * sqrt( ruv.x );\n\t\tfloat theta = ruv.y * 2.0 * PI;\n\t\tfloat x = radius * cos( theta );\n\t\tfloat y = radius * sin( theta );\n\n\t\tvec3 u = light.u;\n\t\tvec3 v = light.v;\n\t\tvec3 normal = normalize( cross( u, v ) );\n\n\t\tfloat angle = acos( light.coneCos );\n\t\tfloat angleTan = tan( angle );\n\t\tfloat startDistance = light.radius / max( angleTan, EPSILON );\n\n\t\tvec3 randomPos = light.position - normal * startDistance + u * x + v * y;\n\t\tvec3 toLight = randomPos - rayOrigin;\n\t\tfloat lightDistSq = dot( toLight, toLight );\n\t\tfloat dist = sqrt( lightDistSq );\n\n\t\tvec3 direction = toLight / max( dist, EPSILON );\n\t\tfloat cosTheta = dot( direction, normal );\n\n\t\tfloat spotAttenuation = light.iesProfile != - 1 ?\n\t\t\tgetPhotometricAttenuation( iesProfiles, light.iesProfile, direction, normal, u, v ) :\n\t\t\tgetSpotAttenuation( light.coneCos, light.penumbraCos, cosTheta );\n\n\t\tfloat distanceAttenuation = getDistanceAttenuation( dist, light.distance, light.decay );\n\t\tLightRecord lightRec;\n\t\tlightRec.type = light.type;\n\t\tlightRec.dist = dist;\n\t\tlightRec.direction = direction;\n\t\tlightRec.emission = light.color * light.intensity * distanceAttenuation * spotAttenuation;\n\t\tlightRec.pdf = 1.0;\n\n\t\treturn lightRec;\n\n\t}\n\n\tLightRecord randomLightSample( sampler2D lights, sampler2DArray iesProfiles, uint lightCount, vec3 rayOrigin, vec3 ruv ) {\n\n\t\tLightRecord result;\n\n\t\t// pick a random light\n\t\tuint l = uint( ruv.x * float( lightCount ) );\n\t\tLight light = readLightInfo( lights, l );\n\n\t\tif ( light.type == SPOT_LIGHT_TYPE ) {\n\n\t\t\tresult = randomSpotLightSample( light, iesProfiles, rayOrigin, ruv.yz );\n\n\t\t} else if ( light.type == POINT_LIGHT_TYPE ) {\n\n\t\t\tvec3 lightRay = light.u - rayOrigin;\n\t\t\tfloat lightDist = length( lightRay );\n\t\t\tfloat cutoffDistance = light.distance;\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDist, light.decay ), 0.01 );\n\t\t\tif ( cutoffDistance > 0.0 ) {\n\n\t\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDist / cutoffDistance ) ) );\n\n\t\t\t}\n\n\t\t\tLightRecord rec;\n\t\t\trec.direction = normalize( lightRay );\n\t\t\trec.dist = length( lightRay );\n\t\t\trec.pdf = 1.0;\n\t\t\trec.emission = light.color * light.intensity * distanceFalloff;\n\t\t\trec.type = light.type;\n\t\t\tresult = rec;\n\n\t\t} else if ( light.type == DIR_LIGHT_TYPE ) {\n\n\t\t\tLightRecord rec;\n\t\t\trec.dist = 1e10;\n\t\t\trec.direction = light.u;\n\t\t\trec.pdf = 1.0;\n\t\t\trec.emission = light.color * light.intensity;\n\t\t\trec.type = light.type;\n\n\t\t\tresult = rec;\n\n\t\t} else {\n\n\t\t\t// sample the light\n\t\t\tresult = randomAreaLightSample( light, rayOrigin, ruv.yz );\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n`;\n","export const shape_sampling_functions = /* glsl */`\n\n\tvec3 sampleHemisphere( vec3 n, vec2 uv ) {\n\n\t\t// https://www.rorydriscoll.com/2009/01/07/better-sampling/\n\t\t// https://graphics.pixar.com/library/OrthonormalB/paper.pdf\n\t\tfloat sign = n.z == 0.0 ? 1.0 : sign( n.z );\n\t\tfloat a = - 1.0 / ( sign + n.z );\n\t\tfloat b = n.x * n.y * a;\n\t\tvec3 b1 = vec3( 1.0 + sign * n.x * n.x * a, sign * b, - sign * n.x );\n\t\tvec3 b2 = vec3( b, sign + n.y * n.y * a, - n.y );\n\n\t\tfloat r = sqrt( uv.x );\n\t\tfloat theta = 2.0 * PI * uv.y;\n\t\tfloat x = r * cos( theta );\n\t\tfloat y = r * sin( theta );\n\t\treturn x * b1 + y * b2 + sqrt( 1.0 - uv.x ) * n;\n\n\t}\n\n\tvec2 sampleTriangle( vec2 a, vec2 b, vec2 c, vec2 r ) {\n\n\t\t// get the edges of the triangle and the diagonal across the\n\t\t// center of the parallelogram\n\t\tvec2 e1 = a - b;\n\t\tvec2 e2 = c - b;\n\t\tvec2 diag = normalize( e1 + e2 );\n\n\t\t// pick the point in the parallelogram\n\t\tif ( r.x + r.y > 1.0 ) {\n\n\t\t\tr = vec2( 1.0 ) - r;\n\n\t\t}\n\n\t\treturn e1 * r.x + e2 * r.y;\n\n\t}\n\n\tvec2 sampleCircle( vec2 uv ) {\n\n\t\tfloat angle = 2.0 * PI * uv.x;\n\t\tfloat radius = sqrt( uv.y );\n\t\treturn vec2( cos( angle ), sin( angle ) ) * radius;\n\n\t}\n\n\tvec3 sampleSphere( vec2 uv ) {\n\n\t\tfloat u = ( uv.x - 0.5 ) * 2.0;\n\t\tfloat t = uv.y * PI * 2.0;\n\t\tfloat f = sqrt( 1.0 - u * u );\n\n\t\treturn vec3( f * cos( t ), f * sin( t ), u );\n\n\t}\n\n\tvec2 sampleRegularPolygon( int sides, vec3 uvw ) {\n\n\t\tsides = max( sides, 3 );\n\n\t\tvec3 r = uvw;\n\t\tfloat anglePerSegment = 2.0 * PI / float( sides );\n\t\tfloat segment = floor( float( sides ) * r.x );\n\n\t\tfloat angle1 = anglePerSegment * segment;\n\t\tfloat angle2 = angle1 + anglePerSegment;\n\t\tvec2 a = vec2( sin( angle1 ), cos( angle1 ) );\n\t\tvec2 b = vec2( 0.0, 0.0 );\n\t\tvec2 c = vec2( sin( angle2 ), cos( angle2 ) );\n\n\t\treturn sampleTriangle( a, b, c, r.yz );\n\n\t}\n\n\t// samples an aperture shape with the given number of sides. 0 means circle\n\tvec2 sampleAperture( int blades, vec3 uvw ) {\n\n\t\treturn blades == 0 ?\n\t\t\tsampleCircle( uvw.xy ) :\n\t\t\tsampleRegularPolygon( blades, uvw );\n\n\t}\n\n\n`;\n","export const fresnel_functions = /* glsl */`\n\n\tbool totalInternalReflection( float cosTheta, float eta ) {\n\n\t\tfloat sinTheta = sqrt( 1.0 - cosTheta * cosTheta );\n\t\treturn eta * sinTheta > 1.0;\n\n\t}\n\n\t// https://google.github.io/filament/Filament.md.html#materialsystem/diffusebrdf\n\tfloat schlickFresnel( float cosine, float f0 ) {\n\n\t\treturn f0 + ( 1.0 - f0 ) * pow( 1.0 - cosine, 5.0 );\n\n\t}\n\n\tvec3 schlickFresnel( float cosine, vec3 f0 ) {\n\n\t\treturn f0 + ( 1.0 - f0 ) * pow( 1.0 - cosine, 5.0 );\n\n\t}\n\n\tvec3 schlickFresnel( float cosine, vec3 f0, vec3 f90 ) {\n\n\t\treturn f0 + ( f90 - f0 ) * pow( 1.0 - cosine, 5.0 );\n\n\t}\n\n\tfloat dielectricFresnel( float cosThetaI, float eta ) {\n\n\t\t// https://schuttejoe.github.io/post/disneybsdf/\n\t\tfloat ni = eta;\n\t\tfloat nt = 1.0;\n\n\t\t// Check for total internal reflection\n\t\tfloat sinThetaISq = 1.0f - cosThetaI * cosThetaI;\n\t\tfloat sinThetaTSq = eta * eta * sinThetaISq;\n\t\tif( sinThetaTSq >= 1.0 ) {\n\n\t\t\treturn 1.0;\n\n\t\t}\n\n\t\tfloat sinThetaT = sqrt( sinThetaTSq );\n\n\t\tfloat cosThetaT = sqrt( max( 0.0, 1.0f - sinThetaT * sinThetaT ) );\n\t\tfloat rParallel = ( ( nt * cosThetaI ) - ( ni * cosThetaT ) ) / ( ( nt * cosThetaI ) + ( ni * cosThetaT ) );\n\t\tfloat rPerpendicular = ( ( ni * cosThetaI ) - ( nt * cosThetaT ) ) / ( ( ni * cosThetaI ) + ( nt * cosThetaT ) );\n\t\treturn ( rParallel * rParallel + rPerpendicular * rPerpendicular ) / 2.0;\n\n\t}\n\n\t// https://raytracing.github.io/books/RayTracingInOneWeekend.html#dielectrics/schlickapproximation\n\tfloat iorRatioToF0( float eta ) {\n\n\t\treturn pow( ( 1.0 - eta ) / ( 1.0 + eta ), 2.0 );\n\n\t}\n\n\tvec3 evaluateFresnel( float cosTheta, float eta, vec3 f0, vec3 f90 ) {\n\n\t\tif ( totalInternalReflection( cosTheta, eta ) ) {\n\n\t\t\treturn f90;\n\n\t\t}\n\n\t\treturn schlickFresnel( cosTheta, f0, f90 );\n\n\t}\n\n\t// TODO: disney fresnel was removed and replaced with this fresnel function to better align with\n\t// the glTF but is causing blown out pixels. Should be revisited\n\t// float evaluateFresnelWeight( float cosTheta, float eta, float f0 ) {\n\n\t// \tif ( totalInternalReflection( cosTheta, eta ) ) {\n\n\t// \t\treturn 1.0;\n\n\t// \t}\n\n\t// \treturn schlickFresnel( cosTheta, f0 );\n\n\t// }\n\n\t// https://schuttejoe.github.io/post/disneybsdf/\n\tfloat disneyFresnel( vec3 wo, vec3 wi, vec3 wh, float f0, float eta, float metalness ) {\n\n\t\tfloat dotHV = dot( wo, wh );\n\t\tif ( totalInternalReflection( dotHV, eta ) ) {\n\n\t\t\treturn 1.0;\n\n\t\t}\n\n\t\tfloat dotHL = dot( wi, wh );\n\t\tfloat dielectricFresnel = dielectricFresnel( abs( dotHV ), eta );\n\t\tfloat metallicFresnel = schlickFresnel( dotHL, f0 );\n\n\t\treturn mix( dielectricFresnel, metallicFresnel, metalness );\n\n\t}\n\n`;\n","export const math_functions = /* glsl */`\n\n\t// Fast arccos approximation used to remove banding artifacts caused by numerical errors in acos.\n\t// This is a cubic Lagrange interpolating polynomial for x = [-1, -1/2, 0, 1/2, 1].\n\t// For more information see: https://github.com/gkjohnson/three-gpu-pathtracer/pull/171#issuecomment-1152275248\n\tfloat acosApprox( float x ) {\n\n\t\tx = clamp( x, -1.0, 1.0 );\n\t\treturn ( - 0.69813170079773212 * x * x - 0.87266462599716477 ) * x + 1.5707963267948966;\n\n\t}\n\n\t// An acos with input values bound to the range [-1, 1].\n\tfloat acosSafe( float x ) {\n\n\t\treturn acos( clamp( x, -1.0, 1.0 ) );\n\n\t}\n\n\tfloat saturateCos( float val ) {\n\n\t\treturn clamp( val, 0.001, 1.0 );\n\n\t}\n\n\tfloat square( float t ) {\n\n\t\treturn t * t;\n\n\t}\n\n\tvec2 square( vec2 t ) {\n\n\t\treturn t * t;\n\n\t}\n\n\tvec3 square( vec3 t ) {\n\n\t\treturn t * t;\n\n\t}\n\n\tvec4 square( vec4 t ) {\n\n\t\treturn t * t;\n\n\t}\n\n\tvec2 rotateVector( vec2 v, float t ) {\n\n\t\tfloat ac = cos( t );\n\t\tfloat as = sin( t );\n\t\treturn vec2(\n\t\t\tv.x * ac - v.y * as,\n\t\t\tv.x * as + v.y * ac\n\t\t);\n\n\t}\n\n\t// forms a basis with the normal vector as Z\n\tmat3 getBasisFromNormal( vec3 normal ) {\n\n\t\tvec3 other;\n\t\tif ( abs( normal.x ) > 0.5 ) {\n\n\t\t\tother = vec3( 0.0, 1.0, 0.0 );\n\n\t\t} else {\n\n\t\t\tother = vec3( 1.0, 0.0, 0.0 );\n\n\t\t}\n\n\t\tvec3 ortho = normalize( cross( normal, other ) );\n\t\tvec3 ortho2 = normalize( cross( normal, ortho ) );\n\t\treturn mat3( ortho2, ortho, normal );\n\n\t}\n\n`;\n","export const shape_intersection_functions = /* glsl */`\n\n\t// Finds the point where the ray intersects the plane defined by u and v and checks if this point\n\t// falls in the bounds of the rectangle on that same plane.\n\t// Plane intersection: https://lousodrome.net/blog/light/2020/07/03/intersection-of-a-ray-and-a-plane/\n\tbool intersectsRectangle( vec3 center, vec3 normal, vec3 u, vec3 v, vec3 rayOrigin, vec3 rayDirection, inout float dist ) {\n\n\t\tfloat t = dot( center - rayOrigin, normal ) / dot( rayDirection, normal );\n\n\t\tif ( t > EPSILON ) {\n\n\t\t\tvec3 p = rayOrigin + rayDirection * t;\n\t\t\tvec3 vi = p - center;\n\n\t\t\t// check if p falls inside the rectangle\n\t\t\tfloat a1 = dot( u, vi );\n\t\t\tif ( abs( a1 ) <= 0.5 ) {\n\n\t\t\t\tfloat a2 = dot( v, vi );\n\t\t\t\tif ( abs( a2 ) <= 0.5 ) {\n\n\t\t\t\t\tdist = t;\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\t// Finds the point where the ray intersects the plane defined by u and v and checks if this point\n\t// falls in the bounds of the circle on that same plane. See above URL for a description of the plane intersection algorithm.\n\tbool intersectsCircle( vec3 position, vec3 normal, vec3 u, vec3 v, vec3 rayOrigin, vec3 rayDirection, inout float dist ) {\n\n\t\tfloat t = dot( position - rayOrigin, normal ) / dot( rayDirection, normal );\n\n\t\tif ( t > EPSILON ) {\n\n\t\t\tvec3 hit = rayOrigin + rayDirection * t;\n\t\t\tvec3 vi = hit - position;\n\n\t\t\tfloat a1 = dot( u, vi );\n\t\t\tfloat a2 = dot( v, vi );\n\n\t\t\tif( length( vec2( a1, a2 ) ) <= 0.5 ) {\n\n\t\t\t\tdist = t;\n\t\t\t\treturn true;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n`;\n","\nexport const texture_sample_functions = /*glsl */`\n\n\t// add texel fetch functions for texture arrays\n\tvec4 texelFetch1D( sampler2DArray tex, int layer, uint index ) {\n\n\t\tuint width = uint( textureSize( tex, 0 ).x );\n\t\tuvec2 uv;\n\t\tuv.x = index % width;\n\t\tuv.y = index / width;\n\n\t\treturn texelFetch( tex, ivec3( uv, layer ), 0 );\n\n\t}\n\n\tvec4 textureSampleBarycoord( sampler2DArray tex, int layer, vec3 barycoord, uvec3 faceIndices ) {\n\n\t\treturn\n\t\t\tbarycoord.x * texelFetch1D( tex, layer, faceIndices.x ) +\n\t\t\tbarycoord.y * texelFetch1D( tex, layer, faceIndices.y ) +\n\t\t\tbarycoord.z * texelFetch1D( tex, layer, faceIndices.z );\n\n\t}\n\n`;\n","export const util_functions = /* glsl */`\n\n\t// TODO: possibly this should be renamed something related to material or path tracing logic\n\n\t#ifndef RAY_OFFSET\n\t#define RAY_OFFSET 1e-4\n\t#endif\n\n\t// adjust the hit point by the surface normal by a factor of some offset and the\n\t// maximum component-wise value of the current point to accommodate floating point\n\t// error as values increase.\n\tvec3 stepRayOrigin( vec3 rayOrigin, vec3 rayDirection, vec3 offset, float dist ) {\n\n\t\tvec3 point = rayOrigin + rayDirection * dist;\n\t\tvec3 absPoint = abs( point );\n\t\tfloat maxPoint = max( absPoint.x, max( absPoint.y, absPoint.z ) );\n\t\treturn point + offset * ( maxPoint + 1.0 ) * RAY_OFFSET;\n\n\t}\n\n\t// https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_volume/README.md#attenuation\n\tvec3 transmissionAttenuation( float dist, vec3 attColor, float attDist ) {\n\n\t\tvec3 ot = - log( attColor ) / attDist;\n\t\treturn exp( - ot * dist );\n\n\t}\n\n\tvec3 getHalfVector( vec3 wi, vec3 wo, float eta ) {\n\n\t\t// get the half vector - assuming if the light incident vector is on the other side\n\t\t// of the that it's transmissive.\n\t\tvec3 h;\n\t\tif ( wi.z > 0.0 ) {\n\n\t\t\th = normalize( wi + wo );\n\n\t\t} else {\n\n\t\t\t// Scale by the ior ratio to retrieve the appropriate half vector\n\t\t\t// From Section 2.2 on computing the transmission half vector:\n\t\t\t// https://blog.selfshadow.com/publications/s2015-shading-course/burley/s2015_pbs_disney_bsdf_notes.pdf\n\t\t\th = normalize( wi + wo * eta );\n\n\t\t}\n\n\t\th *= sign( h.z );\n\t\treturn h;\n\n\t}\n\n\tvec3 getHalfVector( vec3 a, vec3 b ) {\n\n\t\treturn normalize( a + b );\n\n\t}\n\n\t// The discrepancy between interpolated surface normal and geometry normal can cause issues when a ray\n\t// is cast that is on the top side of the geometry normal plane but below the surface normal plane. If\n\t// we find a ray like that we ignore it to avoid artifacts.\n\t// This function returns if the direction is on the same side of both planes.\n\tbool isDirectionValid( vec3 direction, vec3 surfaceNormal, vec3 geometryNormal ) {\n\n\t\tbool aboveSurfaceNormal = dot( direction, surfaceNormal ) > 0.0;\n\t\tbool aboveGeometryNormal = dot( direction, geometryNormal ) > 0.0;\n\t\treturn aboveSurfaceNormal == aboveGeometryNormal;\n\n\t}\n\n\t// ray sampling x and z are swapped to align with expected background view\n\tvec2 equirectDirectionToUv( vec3 direction ) {\n\n\t\t// from Spherical.setFromCartesianCoords\n\t\tvec2 uv = vec2( atan( direction.z, direction.x ), acos( direction.y ) );\n\t\tuv /= vec2( 2.0 * PI, PI );\n\n\t\t// apply adjustments to get values in range [0, 1] and y right side up\n\t\tuv.x += 0.5;\n\t\tuv.y = 1.0 - uv.y;\n\t\treturn uv;\n\n\t}\n\n\tvec3 equirectUvToDirection( vec2 uv ) {\n\n\t\t// undo above adjustments\n\t\tuv.x -= 0.5;\n\t\tuv.y = 1.0 - uv.y;\n\n\t\t// from Vector3.setFromSphericalCoords\n\t\tfloat theta = uv.x * 2.0 * PI;\n\t\tfloat phi = uv.y * PI;\n\n\t\tfloat sinPhi = sin( phi );\n\n\t\treturn vec3( sinPhi * cos( theta ), cos( phi ), sinPhi * sin( theta ) );\n\n\t}\n\n\t// power heuristic for multiple importance sampling\n\tfloat misHeuristic( float a, float b ) {\n\n\t\tfloat aa = a * a;\n\t\tfloat bb = b * b;\n\t\treturn aa / ( aa + bb );\n\n\t}\n\n\t// tentFilter from Peter Shirley's 'Realistic Ray Tracing (2nd Edition)' book, pg. 60\n\t// erichlof/THREE.js-PathTracing-Renderer/\n\tfloat tentFilter( float x ) {\n\n\t\treturn x < 0.5 ? sqrt( 2.0 * x ) - 1.0 : 1.0 - sqrt( 2.0 - ( 2.0 * x ) );\n\n\t}\n`;\n","export const pcg_functions = /* glsl */`\n\n\t// https://www.shadertoy.com/view/wltcRS\n\tuvec4 WHITE_NOISE_SEED;\n\n\tvoid rng_initialize( vec2 p, int frame ) {\n\n\t\t// white noise seed\n\t\tWHITE_NOISE_SEED = uvec4( p, uint( frame ), uint( p.x ) + uint( p.y ) );\n\n\t}\n\n\t// https://www.pcg-random.org/\n\tvoid pcg4d( inout uvec4 v ) {\n\n\t\tv = v * 1664525u + 1013904223u;\n\t\tv.x += v.y * v.w;\n\t\tv.y += v.z * v.x;\n\t\tv.z += v.x * v.y;\n\t\tv.w += v.y * v.z;\n\t\tv = v ^ ( v >> 16u );\n\t\tv.x += v.y*v.w;\n\t\tv.y += v.z*v.x;\n\t\tv.z += v.x*v.y;\n\t\tv.w += v.y*v.z;\n\n\t}\n\n\t// returns [ 0, 1 ]\n\tfloat pcgRand() {\n\n\t\tpcg4d( WHITE_NOISE_SEED );\n\t\treturn float( WHITE_NOISE_SEED.x ) / float( 0xffffffffu );\n\n\t}\n\n\tvec2 pcgRand2() {\n\n\t\tpcg4d( WHITE_NOISE_SEED );\n\t\treturn vec2( WHITE_NOISE_SEED.xy ) / float(0xffffffffu);\n\n\t}\n\n\tvec3 pcgRand3() {\n\n\t\tpcg4d( WHITE_NOISE_SEED );\n\t\treturn vec3( WHITE_NOISE_SEED.xyz ) / float( 0xffffffffu );\n\n\t}\n\n\tvec4 pcgRand4() {\n\n\t\tpcg4d( WHITE_NOISE_SEED );\n\t\treturn vec4( WHITE_NOISE_SEED ) / float( 0xffffffffu );\n\n\t}\n`;\n","export const stratified_functions = /* glsl */`\n\n\tuniform sampler2D stratifiedTexture;\n\tuniform sampler2D stratifiedOffsetTexture;\n\n\tuint sobolPixelIndex = 0u;\n\tuint sobolPathIndex = 0u;\n\tuint sobolBounceIndex = 0u;\n\tvec4 pixelSeed = vec4( 0 );\n\n\tvec4 rand4( int v ) {\n\n\t\tivec2 uv = ivec2( v, sobolBounceIndex );\n\t\tvec4 stratifiedSample = texelFetch( stratifiedTexture, uv, 0 );\n\t\treturn fract( stratifiedSample + pixelSeed.r ); // blue noise + stratified samples\n\n\t}\n\n\tvec3 rand3( int v ) {\n\n\t\treturn rand4( v ).xyz;\n\n\t}\n\n\tvec2 rand2( int v ) {\n\n\t\treturn rand4( v ).xy;\n\n\t}\n\n\tfloat rand( int v ) {\n\n\t\treturn rand4( v ).x;\n\n\t}\n\n\tvoid rng_initialize( vec2 screenCoord, int frame ) {\n\n\t\t// tile the small noise texture across the entire screen\n\t\tivec2 noiseSize = ivec2( textureSize( stratifiedOffsetTexture, 0 ) );\n\t\tivec2 pixel = ivec2( screenCoord.xy ) % noiseSize;\n\t\tvec2 pixelWidth = 1.0 / vec2( noiseSize );\n\t\tvec2 uv = vec2( pixel ) * pixelWidth + pixelWidth * 0.5;\n\n\t\t// note that using \"texelFetch\" here seems to break Android for some reason\n\t\tpixelSeed = texture( stratifiedOffsetTexture, uv );\n\n\t}\n\n`;\n","/*\nwi     : incident vector or light vector (pointing toward the light)\nwo     : outgoing vector or view vector (pointing towards the camera)\nwh     : computed half vector from wo and wi\nEval   : Get the color and pdf for a direction\nSample : Get the direction, color, and pdf for a sample\neta    : Greek character used to denote the \"ratio of ior\"\nf0     : Amount of light reflected when looking at a surface head on - \"fresnel 0\"\nf90    : Amount of light reflected at grazing angles\n*/\n\nexport const bsdf_functions = /* glsl */`\n\n\t// diffuse\n\tfloat diffuseEval( vec3 wo, vec3 wi, vec3 wh, SurfaceRecord surf, inout vec3 color ) {\n\n\t\t// https://schuttejoe.github.io/post/disneybsdf/\n\t\tfloat fl = schlickFresnel( wi.z, 0.0 );\n\t\tfloat fv = schlickFresnel( wo.z, 0.0 );\n\n\t\tfloat metalFactor = ( 1.0 - surf.metalness );\n\t\tfloat transFactor = ( 1.0 - surf.transmission );\n\t\tfloat rr = 0.5 + 2.0 * surf.roughness * fl * fl;\n\t\tfloat retro = rr * ( fl + fv + fl * fv * ( rr - 1.0f ) );\n\t\tfloat lambert = ( 1.0f - 0.5f * fl ) * ( 1.0f - 0.5f * fv );\n\n\t\t// TODO: subsurface approx?\n\n\t\t// float F = evaluateFresnelWeight( dot( wo, wh ), surf.eta, surf.f0 );\n\t\tfloat F = disneyFresnel( wo, wi, wh, surf.f0, surf.eta, surf.metalness );\n\t\tcolor = ( 1.0 - F ) * transFactor * metalFactor * wi.z * surf.color * ( retro + lambert ) / PI;\n\n\t\treturn wi.z / PI;\n\n\t}\n\n\tvec3 diffuseDirection( vec3 wo, SurfaceRecord surf ) {\n\n\t\tvec3 lightDirection = sampleSphere( rand2( 11 ) );\n\t\tlightDirection.z += 1.0;\n\t\tlightDirection = normalize( lightDirection );\n\n\t\treturn lightDirection;\n\n\t}\n\n\t// specular\n\tfloat specularEval( vec3 wo, vec3 wi, vec3 wh, SurfaceRecord surf, inout vec3 color ) {\n\n\t\t// if roughness is set to 0 then D === NaN which results in black pixels\n\t\tfloat metalness = surf.metalness;\n\t\tfloat roughness = surf.filteredRoughness;\n\n\t\tfloat eta = surf.eta;\n\t\tfloat f0 = surf.f0;\n\n\t\tvec3 f0Color = mix( f0 * surf.specularColor * surf.specularIntensity, surf.color, surf.metalness );\n\t\tvec3 f90Color = vec3( mix( surf.specularIntensity, 1.0, surf.metalness ) );\n\t\tvec3 F = evaluateFresnel( dot( wo, wh ), eta, f0Color, f90Color );\n\n\t\tvec3 iridescenceF = evalIridescence( 1.0, surf.iridescenceIor, dot( wi, wh ), surf.iridescenceThickness, f0Color );\n\t\tF = mix( F, iridescenceF,  surf.iridescence );\n\n\t\t// PDF\n\t\t// See 14.1.1 Microfacet BxDFs in https://www.pbr-book.org/\n\t\tfloat incidentTheta = acos( wo.z );\n\t\tfloat G = ggxShadowMaskG2( wi, wo, roughness );\n\t\tfloat D = ggxDistribution( wh, roughness );\n\t\tfloat G1 = ggxShadowMaskG1( incidentTheta, roughness );\n\t\tfloat ggxPdf = D * G1 * max( 0.0, abs( dot( wo, wh ) ) ) / abs ( wo.z );\n\n\t\tcolor = wi.z * F * G * D / ( 4.0 * abs( wi.z * wo.z ) );\n\t\treturn ggxPdf / ( 4.0 * dot( wo, wh ) );\n\n\t}\n\n\tvec3 specularDirection( vec3 wo, SurfaceRecord surf ) {\n\n\t\t// sample ggx vndf distribution which gives a new normal\n\t\tfloat roughness = surf.filteredRoughness;\n\t\tvec3 halfVector = ggxDirection(\n\t\t\two,\n\t\t\tvec2( roughness ),\n\t\t\trand2( 12 )\n\t\t);\n\n\t\t// apply to new ray by reflecting off the new normal\n\t\treturn - reflect( wo, halfVector );\n\n\t}\n\n\n\t// transmission\n\t/*\n\tfloat transmissionEval( vec3 wo, vec3 wi, vec3 wh, SurfaceRecord surf, inout vec3 color ) {\n\n\t\t// See section 4.2 in https://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.pdf\n\n\t\tfloat filteredRoughness = surf.filteredRoughness;\n\t\tfloat eta = surf.eta;\n\t\tbool frontFace = surf.frontFace;\n\t\tbool thinFilm = surf.thinFilm;\n\n\t\tcolor = surf.transmission * surf.color;\n\n\t\tfloat denom = pow( eta * dot( wi, wh ) + dot( wo, wh ), 2.0 );\n\t\treturn ggxPDF( wo, wh, filteredRoughness ) / denom;\n\n\t}\n\n\tvec3 transmissionDirection( vec3 wo, SurfaceRecord surf ) {\n\n\t\tfloat filteredRoughness = surf.filteredRoughness;\n\t\tfloat eta = surf.eta;\n\t\tbool frontFace = surf.frontFace;\n\n\t\t// sample ggx vndf distribution which gives a new normal\n\t\tvec3 halfVector = ggxDirection(\n\t\t\two,\n\t\t\tvec2( filteredRoughness ),\n\t\t\trand2( 13 )\n\t\t);\n\n\t\tvec3 lightDirection = refract( normalize( - wo ), halfVector, eta );\n\t\tif ( surf.thinFilm ) {\n\n\t\t\tlightDirection = - refract( normalize( - lightDirection ), - vec3( 0.0, 0.0, 1.0 ), 1.0 / eta );\n\n\t\t}\n\n\t\treturn normalize( lightDirection );\n\n\t}\n\t*/\n\n\t// TODO: This is just using a basic cosine-weighted specular distribution with an\n\t// incorrect PDF value at the moment. Update it to correctly use a GGX distribution\n\tfloat transmissionEval( vec3 wo, vec3 wi, vec3 wh, SurfaceRecord surf, inout vec3 color ) {\n\n\t\tcolor = surf.transmission * surf.color;\n\n\t\t// PDF\n\t\t// float F = evaluateFresnelWeight( dot( wo, wh ), surf.eta, surf.f0 );\n\t\t// float F = disneyFresnel( wo, wi, wh, surf.f0, surf.eta, surf.metalness );\n\t\t// if ( F >= 1.0 ) {\n\n\t\t// \treturn 0.0;\n\n\t\t// }\n\n\t\t// return 1.0 / ( 1.0 - F );\n\n\t\t// reverted to previous to transmission. The above was causing black pixels\n\t\tfloat eta = surf.eta;\n\t\tfloat f0 = surf.f0;\n\t\tfloat cosTheta = min( wo.z, 1.0 );\n\t\tfloat sinTheta = sqrt( 1.0 - cosTheta * cosTheta );\n\t\tfloat reflectance = schlickFresnel( cosTheta, f0 );\n\t\tbool cannotRefract = eta * sinTheta > 1.0;\n\t\tif ( cannotRefract ) {\n\n\t\t\treturn 0.0;\n\n\t\t}\n\n\t\treturn 1.0 / ( 1.0 - reflectance );\n\n\t}\n\n\tvec3 transmissionDirection( vec3 wo, SurfaceRecord surf ) {\n\n\t\tfloat roughness = surf.filteredRoughness;\n\t\tfloat eta = surf.eta;\n\t\tvec3 halfVector = normalize( vec3( 0.0, 0.0, 1.0 ) + sampleSphere( rand2( 13 ) ) * roughness );\n\t\tvec3 lightDirection = refract( normalize( - wo ), halfVector, eta );\n\n\t\tif ( surf.thinFilm ) {\n\n\t\t\tlightDirection = - refract( normalize( - lightDirection ), - vec3( 0.0, 0.0, 1.0 ), 1.0 / eta );\n\n\t\t}\n\t\treturn normalize( lightDirection );\n\n\t}\n\n\t// clearcoat\n\tfloat clearcoatEval( vec3 wo, vec3 wi, vec3 wh, SurfaceRecord surf, inout vec3 color ) {\n\n\t\tfloat ior = 1.5;\n\t\tfloat f0 = iorRatioToF0( ior );\n\t\tbool frontFace = surf.frontFace;\n\t\tfloat roughness = surf.filteredClearcoatRoughness;\n\n\t\tfloat eta = frontFace ? 1.0 / ior : ior;\n\t\tfloat G = ggxShadowMaskG2( wi, wo, roughness );\n\t\tfloat D = ggxDistribution( wh, roughness );\n\t\tfloat F = schlickFresnel( dot( wi, wh ), f0 );\n\n\t\tfloat fClearcoat = F * D * G / ( 4.0 * abs( wi.z * wo.z ) );\n\t\tcolor = color * ( 1.0 - surf.clearcoat * F ) + fClearcoat * surf.clearcoat * wi.z;\n\n\t\t// PDF\n\t\t// See equation (27) in http://jcgt.org/published/0003/02/03/\n\t\treturn ggxPDF( wo, wh, roughness ) / ( 4.0 * dot( wi, wh ) );\n\n\t}\n\n\tvec3 clearcoatDirection( vec3 wo, SurfaceRecord surf ) {\n\n\t\t// sample ggx vndf distribution which gives a new normal\n\t\tfloat roughness = surf.filteredClearcoatRoughness;\n\t\tvec3 halfVector = ggxDirection(\n\t\t\two,\n\t\t\tvec2( roughness ),\n\t\t\trand2( 14 )\n\t\t);\n\n\t\t// apply to new ray by reflecting off the new normal\n\t\treturn - reflect( wo, halfVector );\n\n\t}\n\n\t// sheen\n\tvec3 sheenColor( vec3 wo, vec3 wi, vec3 wh, SurfaceRecord surf ) {\n\n\t\tfloat cosThetaO = saturateCos( wo.z );\n\t\tfloat cosThetaI = saturateCos( wi.z );\n\t\tfloat cosThetaH = wh.z;\n\n\t\tfloat D = velvetD( cosThetaH, surf.sheenRoughness );\n\t\tfloat G = velvetG( cosThetaO, cosThetaI, surf.sheenRoughness );\n\n\t\t// See equation (1) in http://www.aconty.com/pdf/s2017_pbs_imageworks_sheen.pdf\n\t\tvec3 color = surf.sheenColor;\n\t\tcolor *= D * G / ( 4.0 * abs( cosThetaO * cosThetaI ) );\n\t\tcolor *= wi.z;\n\n\t\treturn color;\n\n\t}\n\n\t// bsdf\n\tvoid getLobeWeights(\n\t\tvec3 wo, vec3 wi, vec3 wh, vec3 clearcoatWo, SurfaceRecord surf,\n\t\tinout float diffuseWeight, inout float specularWeight, inout float transmissionWeight, inout float clearcoatWeight\n\t) {\n\n\t\tfloat metalness = surf.metalness;\n\t\tfloat transmission = surf.transmission;\n\t\t// float fEstimate = evaluateFresnelWeight( dot( wo, wh ), surf.eta, surf.f0 );\n\t\tfloat fEstimate = disneyFresnel( wo, wi, wh, surf.f0, surf.eta, surf.metalness );\n\n\t\tfloat transSpecularProb = mix( max( 0.25, fEstimate ), 1.0, metalness );\n\t\tfloat diffSpecularProb = 0.5 + 0.5 * metalness;\n\n\t\tdiffuseWeight = ( 1.0 - transmission ) * ( 1.0 - diffSpecularProb );\n\t\tspecularWeight = transmission * transSpecularProb + ( 1.0 - transmission ) * diffSpecularProb;\n\t\ttransmissionWeight = transmission * ( 1.0 - transSpecularProb );\n\t\tclearcoatWeight = surf.clearcoat * schlickFresnel( clearcoatWo.z, 0.04 );\n\n\t\tfloat totalWeight = diffuseWeight + specularWeight + transmissionWeight + clearcoatWeight;\n\t\tdiffuseWeight /= totalWeight;\n\t\tspecularWeight /= totalWeight;\n\t\ttransmissionWeight /= totalWeight;\n\t\tclearcoatWeight /= totalWeight;\n\t}\n\n\tfloat bsdfEval(\n\t\tvec3 wo, vec3 clearcoatWo, vec3 wi, vec3 clearcoatWi, SurfaceRecord surf,\n\t\tfloat diffuseWeight, float specularWeight, float transmissionWeight, float clearcoatWeight, inout float specularPdf, inout vec3 color\n\t) {\n\n\t\tfloat metalness = surf.metalness;\n\t\tfloat transmission = surf.transmission;\n\n\t\tfloat spdf = 0.0;\n\t\tfloat dpdf = 0.0;\n\t\tfloat tpdf = 0.0;\n\t\tfloat cpdf = 0.0;\n\t\tcolor = vec3( 0.0 );\n\n\t\tvec3 halfVector = getHalfVector( wi, wo, surf.eta );\n\n\t\t// diffuse\n\t\tif ( diffuseWeight > 0.0 && wi.z > 0.0 ) {\n\n\t\t\tdpdf = diffuseEval( wo, wi, halfVector, surf, color );\n\t\t\tcolor *= 1.0 - surf.transmission;\n\n\t\t}\n\n\t\t// ggx specular\n\t\tif ( specularWeight > 0.0 && wi.z > 0.0 ) {\n\n\t\t\tvec3 outColor;\n\t\t\tspdf = specularEval( wo, wi, getHalfVector( wi, wo ), surf, outColor );\n\t\t\tcolor += outColor;\n\n\t\t}\n\n\t\t// transmission\n\t\tif ( transmissionWeight > 0.0 && wi.z < 0.0 ) {\n\n\t\t\ttpdf = transmissionEval( wo, wi, halfVector, surf, color );\n\n\t\t}\n\n\t\t// sheen\n\t\tcolor *= mix( 1.0, sheenAlbedoScaling( wo, wi, surf ), surf.sheen );\n\t\tcolor += sheenColor( wo, wi, halfVector, surf ) * surf.sheen;\n\n\t\t// clearcoat\n\t\tif ( clearcoatWi.z >= 0.0 && clearcoatWeight > 0.0 ) {\n\n\t\t\tvec3 clearcoatHalfVector = getHalfVector( clearcoatWo, clearcoatWi );\n\t\t\tcpdf = clearcoatEval( clearcoatWo, clearcoatWi, clearcoatHalfVector, surf, color );\n\n\t\t}\n\n\t\tfloat pdf =\n\t\t\tdpdf * diffuseWeight\n\t\t\t+ spdf * specularWeight\n\t\t\t+ tpdf * transmissionWeight\n\t\t\t+ cpdf * clearcoatWeight;\n\n\t\t// retrieve specular rays for the shadows flag\n\t\tspecularPdf = spdf * specularWeight + cpdf * clearcoatWeight;\n\n\t\treturn pdf;\n\n\t}\n\n\tfloat bsdfResult( vec3 worldWo, vec3 worldWi, SurfaceRecord surf, inout vec3 color ) {\n\n\t\tif ( surf.volumeParticle ) {\n\n\t\t\tcolor = surf.color / ( 4.0 * PI );\n\t\t\treturn 1.0 / ( 4.0 * PI );\n\n\t\t}\n\n\t\tvec3 wo = normalize( surf.normalInvBasis * worldWo );\n\t\tvec3 wi = normalize( surf.normalInvBasis * worldWi );\n\n\t\tvec3 clearcoatWo = normalize( surf.clearcoatInvBasis * worldWo );\n\t\tvec3 clearcoatWi = normalize( surf.clearcoatInvBasis * worldWi );\n\n\t\tvec3 wh = getHalfVector( wo, wi, surf.eta );\n\t\tfloat diffuseWeight;\n\t\tfloat specularWeight;\n\t\tfloat transmissionWeight;\n\t\tfloat clearcoatWeight;\n\t\tgetLobeWeights( wo, wi, wh, clearcoatWo, surf, diffuseWeight, specularWeight, transmissionWeight, clearcoatWeight );\n\n\t\tfloat specularPdf;\n\t\treturn bsdfEval( wo, clearcoatWo, wi, clearcoatWi, surf, diffuseWeight, specularWeight, transmissionWeight, clearcoatWeight, specularPdf, color );\n\n\t}\n\n\tScatterRecord bsdfSample( vec3 worldWo, SurfaceRecord surf ) {\n\n\t\tif ( surf.volumeParticle ) {\n\n\t\t\tScatterRecord sampleRec;\n\t\t\tsampleRec.specularPdf = 0.0;\n\t\t\tsampleRec.pdf = 1.0 / ( 4.0 * PI );\n\t\t\tsampleRec.direction = sampleSphere( rand2( 16 ) );\n\t\t\tsampleRec.color = surf.color / ( 4.0 * PI );\n\t\t\treturn sampleRec;\n\n\t\t}\n\n\t\tvec3 wo = normalize( surf.normalInvBasis * worldWo );\n\t\tvec3 clearcoatWo = normalize( surf.clearcoatInvBasis * worldWo );\n\t\tmat3 normalBasis = surf.normalBasis;\n\t\tmat3 invBasis = surf.normalInvBasis;\n\t\tmat3 clearcoatNormalBasis = surf.clearcoatBasis;\n\t\tmat3 clearcoatInvBasis = surf.clearcoatInvBasis;\n\n\t\tfloat diffuseWeight;\n\t\tfloat specularWeight;\n\t\tfloat transmissionWeight;\n\t\tfloat clearcoatWeight;\n\t\t// using normal and basically-reflected ray since we don't have proper half vector here\n\t\tgetLobeWeights( wo, wo, vec3( 0, 0, 1 ), clearcoatWo, surf, diffuseWeight, specularWeight, transmissionWeight, clearcoatWeight );\n\n\t\tfloat pdf[4];\n\t\tpdf[0] = diffuseWeight;\n\t\tpdf[1] = specularWeight;\n\t\tpdf[2] = transmissionWeight;\n\t\tpdf[3] = clearcoatWeight;\n\n\t\tfloat cdf[4];\n\t\tcdf[0] = pdf[0];\n\t\tcdf[1] = pdf[1] + cdf[0];\n\t\tcdf[2] = pdf[2] + cdf[1];\n\t\tcdf[3] = pdf[3] + cdf[2];\n\n\t\tif( cdf[3] != 0.0 ) {\n\n\t\t\tfloat invMaxCdf = 1.0 / cdf[3];\n\t\t\tcdf[0] *= invMaxCdf;\n\t\t\tcdf[1] *= invMaxCdf;\n\t\t\tcdf[2] *= invMaxCdf;\n\t\t\tcdf[3] *= invMaxCdf;\n\n\t\t} else {\n\n\t\t\tcdf[0] = 1.0;\n\t\t\tcdf[1] = 0.0;\n\t\t\tcdf[2] = 0.0;\n\t\t\tcdf[3] = 0.0;\n\n\t\t}\n\n\t\tvec3 wi;\n\t\tvec3 clearcoatWi;\n\n\t\tfloat r = rand( 15 );\n\t\tif ( r <= cdf[0] ) { // diffuse\n\n\t\t\twi = diffuseDirection( wo, surf );\n\t\t\tclearcoatWi = normalize( clearcoatInvBasis * normalize( normalBasis * wi ) );\n\n\t\t} else if ( r <= cdf[1] ) { // specular\n\n\t\t\twi = specularDirection( wo, surf );\n\t\t\tclearcoatWi = normalize( clearcoatInvBasis * normalize( normalBasis * wi ) );\n\n\t\t} else if ( r <= cdf[2] ) { // transmission / refraction\n\n\t\t\twi = transmissionDirection( wo, surf );\n\t\t\tclearcoatWi = normalize( clearcoatInvBasis * normalize( normalBasis * wi ) );\n\n\t\t} else if ( r <= cdf[3] ) { // clearcoat\n\n\t\t\tclearcoatWi = clearcoatDirection( clearcoatWo, surf );\n\t\t\twi = normalize( invBasis * normalize( clearcoatNormalBasis * clearcoatWi ) );\n\n\t\t}\n\n\t\tScatterRecord result;\n\t\tresult.pdf = bsdfEval( wo, clearcoatWo, wi, clearcoatWi, surf, diffuseWeight, specularWeight, transmissionWeight, clearcoatWeight, result.specularPdf, result.color );\n\t\tresult.direction = normalize( surf.normalBasis * wi );\n\n\t\treturn result;\n\n\t}\n\n`;\n","export const fog_functions = /* glsl */`\n\n\t// returns the hit distance given the material density\n\tfloat intersectFogVolume( Material material, float u ) {\n\n\t\t// https://raytracing.github.io/books/RayTracingTheNextWeek.html#volumes/constantdensitymediums\n\t\treturn material.opacity == 0.0 ? INFINITY : ( - 1.0 / material.opacity ) * log( u );\n\n\t}\n\n\tScatterRecord sampleFogVolume( SurfaceRecord surf, vec2 uv ) {\n\n\t\tScatterRecord sampleRec;\n\t\tsampleRec.specularPdf = 0.0;\n\t\tsampleRec.pdf = 1.0 / ( 2.0 * PI );\n\t\tsampleRec.direction = sampleSphere( uv );\n\t\tsampleRec.color = surf.color;\n\t\treturn sampleRec;\n\n\t}\n\n`;\n","export const ggx_functions = /* glsl */`\n\n\t// The GGX functions provide sampling and distribution information for normals as output so\n\t// in order to get probability of scatter direction the half vector must be computed and provided.\n\t// [0] https://www.cs.cornell.edu/~srm/publications/EGSR07-btdf.pdf\n\t// [1] https://hal.archives-ouvertes.fr/hal-01509746/document\n\t// [2] http://jcgt.org/published/0007/04/01/\n\t// [4] http://jcgt.org/published/0003/02/03/\n\n\t// trowbridge-reitz === GGX === GTR\n\n\tvec3 ggxDirection( vec3 incidentDir, vec2 roughness, vec2 uv ) {\n\n\t\t// TODO: try GGXVNDF implementation from reference [2], here. Needs to update ggxDistribution\n\t\t// function below, as well\n\n\t\t// Implementation from reference [1]\n\t\t// stretch view\n\t\tvec3 V = normalize( vec3( roughness * incidentDir.xy, incidentDir.z ) );\n\n\t\t// orthonormal basis\n\t\tvec3 T1 = ( V.z < 0.9999 ) ? normalize( cross( V, vec3( 0.0, 0.0, 1.0 ) ) ) : vec3( 1.0, 0.0, 0.0 );\n\t\tvec3 T2 = cross( T1, V );\n\n\t\t// sample point with polar coordinates (r, phi)\n\t\tfloat a = 1.0 / ( 1.0 + V.z );\n\t\tfloat r = sqrt( uv.x );\n\t\tfloat phi = ( uv.y < a ) ? uv.y / a * PI : PI + ( uv.y - a ) / ( 1.0 - a ) * PI;\n\t\tfloat P1 = r * cos( phi );\n\t\tfloat P2 = r * sin( phi ) * ( ( uv.y < a ) ? 1.0 : V.z );\n\n\t\t// compute normal\n\t\tvec3 N = P1 * T1 + P2 * T2 + V * sqrt( max( 0.0, 1.0 - P1 * P1 - P2 * P2 ) );\n\n\t\t// unstretch\n\t\tN = normalize( vec3( roughness * N.xy, max( 0.0, N.z ) ) );\n\n\t\treturn N;\n\n\t}\n\n\t// Below are PDF and related functions for use in a Monte Carlo path tracer\n\t// as specified in Appendix B of the following paper\n\t// See equation (34) from reference [0]\n\tfloat ggxLamda( float theta, float roughness ) {\n\n\t\tfloat tanTheta = tan( theta );\n\t\tfloat tanTheta2 = tanTheta * tanTheta;\n\t\tfloat alpha2 = roughness * roughness;\n\n\t\tfloat numerator = - 1.0 + sqrt( 1.0 + alpha2 * tanTheta2 );\n\t\treturn numerator / 2.0;\n\n\t}\n\n\t// See equation (34) from reference [0]\n\tfloat ggxShadowMaskG1( float theta, float roughness ) {\n\n\t\treturn 1.0 / ( 1.0 + ggxLamda( theta, roughness ) );\n\n\t}\n\n\t// See equation (125) from reference [4]\n\tfloat ggxShadowMaskG2( vec3 wi, vec3 wo, float roughness ) {\n\n\t\tfloat incidentTheta = acos( wi.z );\n\t\tfloat scatterTheta = acos( wo.z );\n\t\treturn 1.0 / ( 1.0 + ggxLamda( incidentTheta, roughness ) + ggxLamda( scatterTheta, roughness ) );\n\n\t}\n\n\t// See equation (33) from reference [0]\n\tfloat ggxDistribution( vec3 halfVector, float roughness ) {\n\n\t\tfloat a2 = roughness * roughness;\n\t\ta2 = max( EPSILON, a2 );\n\t\tfloat cosTheta = halfVector.z;\n\t\tfloat cosTheta4 = pow( cosTheta, 4.0 );\n\n\t\tif ( cosTheta == 0.0 ) return 0.0;\n\n\t\tfloat theta = acosSafe( halfVector.z );\n\t\tfloat tanTheta = tan( theta );\n\t\tfloat tanTheta2 = pow( tanTheta, 2.0 );\n\n\t\tfloat denom = PI * cosTheta4 * pow( a2 + tanTheta2, 2.0 );\n\t\treturn ( a2 / denom );\n\n\t}\n\n\t// See equation (3) from reference [2]\n\tfloat ggxPDF( vec3 wi, vec3 halfVector, float roughness ) {\n\n\t\tfloat incidentTheta = acos( wi.z );\n\t\tfloat D = ggxDistribution( halfVector, roughness );\n\t\tfloat G1 = ggxShadowMaskG1( incidentTheta, roughness );\n\n\t\treturn D * G1 * max( 0.0, dot( wi, halfVector ) ) / wi.z;\n\n\t}\n\n`;\n","export const iridescence_functions = /* glsl */`\n\n\t// XYZ to sRGB color space\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t3.2404542, -0.9692660,  0.0556434,\n\t\t-1.5371385,  1.8760108, -0.2040259,\n\t\t-0.4985314,  0.0415560,  1.0572252\n\t);\n\n\tvec3 fresnel0ToIor( vec3 fresnel0 ) {\n\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\n\t}\n\n\t// Conversion FO/IOR\n\tvec3 iorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\n\t\treturn square( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\n\t}\n\n\t// ior is a value between 1.0 and 3.0. 1.0 is air interface\n\tfloat iorToFresnel0( float transmittedIor, float incidentIor ) {\n\n\t\treturn square( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ) );\n\n\t}\n\n\t// Fresnel equations for dielectric/dielectric interfaces. See https://belcour.github.io/blog/research/2017/05/01/brdf-thin-film.html\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - square( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * square( phase ) );\n\t\txyz /= 1.0685e-7;\n\n\t\tvec3 srgb = XYZ_TO_REC709 * xyz;\n\t\treturn srgb;\n\n\t}\n\n\t// See Section 4. Analytic Spectral Integration, A Practical Extension to Microfacet Theory for the Modeling of Varying Iridescence, https://hal.archives-ouvertes.fr/hal-01518344/document\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\n\t\tvec3 I;\n\n\t\t// Force iridescenceIor -> outsideIOR when thinFilmThickness -> 0.0\n\t\tfloat iridescenceIor = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\n\t\t// Evaluate the cosTheta on the base layer (Snell law)\n\t\tfloat sinTheta2Sq = square( outsideIOR / iridescenceIor ) * ( 1.0 - square( cosTheta1 ) );\n\n\t\t// Handle TIR:\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\n\t\t\treturn vec3( 1.0 );\n\n\t\t}\n\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\n\t\t// First interface\n\t\tfloat R0 = iorToFresnel0( iridescenceIor, outsideIOR );\n\t\tfloat R12 = schlickFresnel( cosTheta1, R0 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIor < outsideIOR ) {\n\n\t\t\tphi12 = PI;\n\n\t\t}\n\n\t\tfloat phi21 = PI - phi12;\n\n\t\t// Second interface\n\t\tvec3 baseIOR = fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); // guard against 1.0\n\t\tvec3 R1 = iorToFresnel0( baseIOR, iridescenceIor );\n\t\tvec3 R23 = schlickFresnel( cosTheta2, R1 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[0] < iridescenceIor ) {\n\n\t\t\tphi23[ 0 ] = PI;\n\n\t\t}\n\n\t\tif ( baseIOR[1] < iridescenceIor ) {\n\n\t\t\tphi23[ 1 ] = PI;\n\n\t\t}\n\n\t\tif ( baseIOR[2] < iridescenceIor ) {\n\n\t\t\tphi23[ 2 ] = PI;\n\n\t\t}\n\n\t\t// Phase shift\n\t\tfloat OPD = 2.0 * iridescenceIor * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\n\t\t// Compound terms\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = square( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\n\t\t// Reflectance term for m = 0 (DC term amplitude)\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\n\t\t// Reflectance term for m > 0 (pairs of diracs)\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\n\t\t}\n\n\t\t// Since out of gamut colors might be produced, negative color values are clamped to 0.\n\t\treturn max( I, vec3( 0.0 ) );\n\n\t}\n\n`;\n","export const sheen_functions = /* glsl */`\n\n\t// See equation (2) in http://www.aconty.com/pdf/s2017_pbs_imageworks_sheen.pdf\n\tfloat velvetD( float cosThetaH, float roughness ) {\n\n\t\tfloat alpha = max( roughness, 0.07 );\n\t\talpha = alpha * alpha;\n\n\t\tfloat invAlpha = 1.0 / alpha;\n\n\t\tfloat sqrCosThetaH = cosThetaH * cosThetaH;\n\t\tfloat sinThetaH = max( 1.0 - sqrCosThetaH, 0.001 );\n\n\t\treturn ( 2.0 + invAlpha ) * pow( sinThetaH, 0.5 * invAlpha ) / ( 2.0 * PI );\n\n\t}\n\n\tfloat velvetParamsInterpolate( int i, float oneMinusAlphaSquared ) {\n\n\t\tconst float p0[5] = float[5]( 25.3245, 3.32435, 0.16801, -1.27393, -4.85967 );\n\t\tconst float p1[5] = float[5]( 21.5473, 3.82987, 0.19823, -1.97760, -4.32054 );\n\n\t\treturn mix( p1[i], p0[i], oneMinusAlphaSquared );\n\n\t}\n\n\tfloat velvetL( float x, float alpha ) {\n\n\t\tfloat oneMinusAlpha = 1.0 - alpha;\n\t\tfloat oneMinusAlphaSquared = oneMinusAlpha * oneMinusAlpha;\n\n\t\tfloat a = velvetParamsInterpolate( 0, oneMinusAlphaSquared );\n\t\tfloat b = velvetParamsInterpolate( 1, oneMinusAlphaSquared );\n\t\tfloat c = velvetParamsInterpolate( 2, oneMinusAlphaSquared );\n\t\tfloat d = velvetParamsInterpolate( 3, oneMinusAlphaSquared );\n\t\tfloat e = velvetParamsInterpolate( 4, oneMinusAlphaSquared );\n\n\t\treturn a / ( 1.0 + b * pow( abs( x ), c ) ) + d * x + e;\n\n\t}\n\n\t// See equation (3) in http://www.aconty.com/pdf/s2017_pbs_imageworks_sheen.pdf\n\tfloat velvetLambda( float cosTheta, float alpha ) {\n\n\t\treturn abs( cosTheta ) < 0.5 ? exp( velvetL( cosTheta, alpha ) ) : exp( 2.0 * velvetL( 0.5, alpha ) - velvetL( 1.0 - cosTheta, alpha ) );\n\n\t}\n\n\t// See Section 3, Shadowing Term, in http://www.aconty.com/pdf/s2017_pbs_imageworks_sheen.pdf\n\tfloat velvetG( float cosThetaO, float cosThetaI, float roughness ) {\n\n\t\tfloat alpha = max( roughness, 0.07 );\n\t\talpha = alpha * alpha;\n\n\t\treturn 1.0 / ( 1.0 + velvetLambda( cosThetaO, alpha ) + velvetLambda( cosThetaI, alpha ) );\n\n\t}\n\n\tfloat directionalAlbedoSheen( float cosTheta, float alpha ) {\n\n\t\tcosTheta = saturate( cosTheta );\n\n\t\tfloat c = 1.0 - cosTheta;\n\t\tfloat c3 = c * c * c;\n\n\t\treturn 0.65584461 * c3 + 1.0 / ( 4.16526551 + exp( -7.97291361 * sqrt( alpha ) + 6.33516894 ) );\n\n\t}\n\n\tfloat sheenAlbedoScaling( vec3 wo, vec3 wi, SurfaceRecord surf ) {\n\n\t\tfloat alpha = max( surf.sheenRoughness, 0.07 );\n\t\talpha = alpha * alpha;\n\n\t\tfloat maxSheenColor = max( max( surf.sheenColor.r, surf.sheenColor.g ), surf.sheenColor.b );\n\n\t\tfloat eWo = directionalAlbedoSheen( saturateCos( wo.z ), alpha );\n\t\tfloat eWi = directionalAlbedoSheen( saturateCos( wi.z ), alpha );\n\n\t\treturn min( 1.0 - maxSheenColor * eWo, 1.0 - maxSheenColor * eWi );\n\n\t}\n\n\t// See Section 5, Layering, in http://www.aconty.com/pdf/s2017_pbs_imageworks_sheen.pdf\n\tfloat sheenAlbedoScaling( vec3 wo, SurfaceRecord surf ) {\n\n\t\tfloat alpha = max( surf.sheenRoughness, 0.07 );\n\t\talpha = alpha * alpha;\n\n\t\tfloat maxSheenColor = max( max( surf.sheenColor.r, surf.sheenColor.g ), surf.sheenColor.b );\n\n\t\tfloat eWo = directionalAlbedoSheen( saturateCos( wo.z ), alpha );\n\n\t\treturn 1.0 - maxSheenColor * eWo;\n\n\t}\n\n`;\n","export const inside_fog_volume_function = /* glsl */`\n\n#ifndef FOG_CHECK_ITERATIONS\n#define FOG_CHECK_ITERATIONS 30\n#endif\n\n// returns whether the given material is a fog material or not\nbool isMaterialFogVolume( sampler2D materials, uint materialIndex ) {\n\n\tuint i = materialIndex * uint( MATERIAL_PIXELS );\n\tvec4 s14 = texelFetch1D( materials, i + 14u );\n\treturn bool( int( s14.b ) & 4 );\n\n}\n\n// returns true if we're within the first fog volume we hit\nbool bvhIntersectFogVolumeHit(\n\tvec3 rayOrigin, vec3 rayDirection,\n\tusampler2D materialIndexAttribute, sampler2D materials,\n\tinout Material material\n) {\n\n\tmaterial.fogVolume = false;\n\n\tfor ( int i = 0; i < FOG_CHECK_ITERATIONS; i ++ ) {\n\n\t\t// find nearest hit\n\t\tuvec4 faceIndices = uvec4( 0u );\n\t\tvec3 faceNormal = vec3( 0.0, 0.0, 1.0 );\n\t\tvec3 barycoord = vec3( 0.0 );\n\t\tfloat side = 1.0;\n\t\tfloat dist = 0.0;\n\t\tbool hit = bvhIntersectFirstHit( bvh, rayOrigin, rayDirection, faceIndices, faceNormal, barycoord, side, dist );\n\t\tif ( hit ) {\n\n\t\t\t// if it's a fog volume return whether we hit the front or back face\n\t\t\tuint materialIndex = uTexelFetch1D( materialIndexAttribute, faceIndices.x ).r;\n\t\t\tif ( isMaterialFogVolume( materials, materialIndex ) ) {\n\n\t\t\t\tmaterial = readMaterialInfo( materials, materialIndex );\n\t\t\t\treturn side == - 1.0;\n\n\t\t\t} else {\n\n\t\t\t\t// move the ray forward\n\t\t\t\trayOrigin = stepRayOrigin( rayOrigin, rayDirection, - faceNormal, dist );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t}\n\n\treturn false;\n\n}\n\n`;\n","export const ray_any_hit_function = /* glsl */`\n\n\tbool bvhIntersectAnyHit(\n\t\tvec3 rayOrigin, vec3 rayDirection,\n\n\t\t// output variables\n\t\tinout float side, inout float dist\n\t) {\n\n\t\tuvec4 faceIndices;\n\t\tvec3 faceNormal;\n\t\tvec3 barycoord;\n\n\t\t// stack needs to be twice as long as the deepest tree we expect because\n\t\t// we push both the left and right child onto the stack every traversal\n\t\tint ptr = 0;\n\t\tuint stack[ 60 ];\n\t\tstack[ 0 ] = 0u;\n\n\t\tfloat triangleDistance = 1e20;\n\t\twhile ( ptr > - 1 && ptr < 60 ) {\n\n\t\t\tuint currNodeIndex = stack[ ptr ];\n\t\t\tptr --;\n\n\t\t\t// check if we intersect the current bounds\n\t\t\tfloat boundsHitDistance = intersectsBVHNodeBounds( rayOrigin, rayDirection, bvh, currNodeIndex );\n\t\t\tif ( boundsHitDistance == INFINITY ) {\n\n\t\t\t\tcontinue;\n\n\t\t\t}\n\n\t\t\tuvec2 boundsInfo = uTexelFetch1D( bvh.bvhContents, currNodeIndex ).xy;\n\t\t\tbool isLeaf = bool( boundsInfo.x & 0xffff0000u );\n\n\t\t\tif ( isLeaf ) {\n\n\t\t\t\tuint count = boundsInfo.x & 0x0000ffffu;\n\t\t\t\tuint offset = boundsInfo.y;\n\n\t\t\t\tbool found = intersectTriangles(\n\t\t\t\t\tbvh, rayOrigin, rayDirection, offset, count, triangleDistance,\n\t\t\t\t\tfaceIndices, faceNormal, barycoord, side, dist\n\t\t\t\t);\n\n\t\t\t\tif ( found ) {\n\n\t\t\t\t\treturn true;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tuint leftIndex = currNodeIndex + 1u;\n\t\t\t\tuint splitAxis = boundsInfo.x & 0x0000ffffu;\n\t\t\t\tuint rightIndex = boundsInfo.y;\n\n\t\t\t\t// set c2 in the stack so we traverse it later. We need to keep track of a pointer in\n\t\t\t\t// the stack while we traverse. The second pointer added is the one that will be\n\t\t\t\t// traversed first\n\t\t\t\tptr ++;\n\t\t\t\tstack[ ptr ] = leftIndex;\n\n\t\t\t\tptr ++;\n\t\t\t\tstack[ ptr ] = rightIndex;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n`;\n","export const attenuate_hit_function = /* glsl */`\n\n\t// step through multiple surface hits and accumulate color attenuation based on transmissive surfaces\n\t// returns true if a solid surface was hit\n\tbool attenuateHit(\n\t\tRenderState state,\n\t\tRay ray, float rayDist,\n\t\tout vec3 color\n\t) {\n\n\t\t// store the original bounce index so we can reset it after\n\t\tuint originalBounceIndex = sobolBounceIndex;\n\n\t\tint traversals = state.traversals;\n\t\tint transmissiveTraversals = state.transmissiveTraversals;\n\t\tbool isShadowRay = state.isShadowRay;\n\t\tMaterial fogMaterial = state.fogMaterial;\n\n\t\tvec3 startPoint = ray.origin;\n\n\t\t// hit results\n\t\tSurfaceHit surfaceHit;\n\n\t\tcolor = vec3( 1.0 );\n\n\t\tbool result = true;\n\t\tfor ( int i = 0; i < traversals; i ++ ) {\n\n\t\t\tsobolBounceIndex ++;\n\n\t\t\tint hitType = traceScene( ray, fogMaterial, surfaceHit );\n\n\t\t\tif ( hitType == FOG_HIT ) {\n\n\t\t\t\tresult = true;\n\t\t\t\tbreak;\n\n\t\t\t} else if ( hitType == SURFACE_HIT ) {\n\n\t\t\t\tfloat totalDist = distance( startPoint, ray.origin + ray.direction * surfaceHit.dist );\n\t\t\t\tif ( totalDist > rayDist ) {\n\n\t\t\t\t\tresult = false;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t\t// TODO: attenuate the contribution based on the PDF of the resulting ray including refraction values\n\t\t\t\t// Should be able to work using the material BSDF functions which will take into account specularity, etc.\n\t\t\t\t// TODO: should we account for emissive surfaces here?\n\n\t\t\t\tuint materialIndex = uTexelFetch1D( materialIndexAttribute, surfaceHit.faceIndices.x ).r;\n\t\t\t\tMaterial material = readMaterialInfo( materials, materialIndex );\n\n\t\t\t\t// adjust the ray to the new surface\n\t\t\t\tbool isEntering = surfaceHit.side == 1.0;\n\t\t\t\tray.origin = stepRayOrigin( ray.origin, ray.direction, - surfaceHit.faceNormal, surfaceHit.dist );\n\n\t\t\t\t#if FEATURE_FOG\n\n\t\t\t\tif ( material.fogVolume ) {\n\n\t\t\t\t\tfogMaterial = material;\n\t\t\t\t\tfogMaterial.fogVolume = surfaceHit.side == 1.0;\n\t\t\t\t\ti -= sign( transmissiveTraversals );\n\t\t\t\t\ttransmissiveTraversals --;\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\t#endif\n\n\t\t\t\tif ( ! material.castShadow && isShadowRay ) {\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\tvec2 uv = textureSampleBarycoord( attributesArray, ATTR_UV, surfaceHit.barycoord, surfaceHit.faceIndices.xyz ).xy;\n\t\t\t\tvec4 vertexColor = textureSampleBarycoord( attributesArray, ATTR_COLOR, surfaceHit.barycoord, surfaceHit.faceIndices.xyz );\n\n\t\t\t\t// albedo\n\t\t\t\tvec4 albedo = vec4( material.color, material.opacity );\n\t\t\t\tif ( material.map != - 1 ) {\n\n\t\t\t\t\tvec3 uvPrime = material.mapTransform * vec3( uv, 1 );\n\t\t\t\t\talbedo *= texture2D( textures, vec3( uvPrime.xy, material.map ) );\n\n\t\t\t\t}\n\n\t\t\t\tif ( material.vertexColors ) {\n\n\t\t\t\t\talbedo *= vertexColor;\n\n\t\t\t\t}\n\n\t\t\t\t// alphaMap\n\t\t\t\tif ( material.alphaMap != - 1 ) {\n\n\t\t\t\t\tvec3 uvPrime = material.alphaMapTransform * vec3( uv, 1 );\n\t\t\t\t\talbedo.a *= texture2D( textures, vec3( uvPrime.xy, material.alphaMap ) ).x;\n\n\t\t\t\t}\n\n\t\t\t\t// transmission\n\t\t\t\tfloat transmission = material.transmission;\n\t\t\t\tif ( material.transmissionMap != - 1 ) {\n\n\t\t\t\t\tvec3 uvPrime = material.transmissionMapTransform * vec3( uv, 1 );\n\t\t\t\t\ttransmission *= texture2D( textures, vec3( uvPrime.xy, material.transmissionMap ) ).r;\n\n\t\t\t\t}\n\n\t\t\t\t// metalness\n\t\t\t\tfloat metalness = material.metalness;\n\t\t\t\tif ( material.metalnessMap != - 1 ) {\n\n\t\t\t\t\tvec3 uvPrime = material.metalnessMapTransform * vec3( uv, 1 );\n\t\t\t\t\tmetalness *= texture2D( textures, vec3( uvPrime.xy, material.metalnessMap ) ).b;\n\n\t\t\t\t}\n\n\t\t\t\tfloat alphaTest = material.alphaTest;\n\t\t\t\tbool useAlphaTest = alphaTest != 0.0;\n\t\t\t\tfloat transmissionFactor = ( 1.0 - metalness ) * transmission;\n\t\t\t\tif (\n\t\t\t\t\ttransmissionFactor < rand( 9 ) && ! (\n\t\t\t\t\t\t// material sidedness\n\t\t\t\t\t\tmaterial.side != 0.0 && surfaceHit.side == material.side\n\n\t\t\t\t\t\t// alpha test\n\t\t\t\t\t\t|| useAlphaTest && albedo.a < alphaTest\n\n\t\t\t\t\t\t// opacity\n\t\t\t\t\t\t|| material.transparent && ! useAlphaTest && albedo.a < rand( 10 )\n\t\t\t\t\t)\n\t\t\t\t) {\n\n\t\t\t\t\tresult = true;\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t\tif ( surfaceHit.side == 1.0 && isEntering ) {\n\n\t\t\t\t\t// only attenuate by surface color on the way in\n\t\t\t\t\tcolor *= mix( vec3( 1.0 ), albedo.rgb, transmissionFactor );\n\n\t\t\t\t} else if ( surfaceHit.side == - 1.0 ) {\n\n\t\t\t\t\t// attenuate by medium once we hit the opposite side of the model\n\t\t\t\t\tcolor *= transmissionAttenuation( surfaceHit.dist, material.attenuationColor, material.attenuationDistance );\n\n\t\t\t\t}\n\n\t\t\t\tbool isTransmissiveRay = dot( ray.direction, surfaceHit.faceNormal * surfaceHit.side ) < 0.0;\n\t\t\t\tif ( ( isTransmissiveRay || isEntering ) && transmissiveTraversals > 0 ) {\n\n\t\t\t\t\ti -= sign( transmissiveTraversals );\n\t\t\t\t\ttransmissiveTraversals --;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tresult = false;\n\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// reset the bounce index\n\t\tsobolBounceIndex = originalBounceIndex;\n\t\treturn result;\n\n\t}\n\n`;\n","export const camera_util_functions = /* glsl */`\n\n\tvec3 ndcToRayOrigin( vec2 coord ) {\n\n\t\tvec4 rayOrigin4 = cameraWorldMatrix * invProjectionMatrix * vec4( coord, - 1.0, 1.0 );\n\t\treturn rayOrigin4.xyz / rayOrigin4.w;\n\t}\n\n\tRay getCameraRay() {\n\n\t\tvec2 ssd = vec2( 1.0 ) / resolution;\n\n\t\t// Jitter the camera ray by finding a uv coordinate at a random sample\n\t\t// around this pixel's UV coordinate for AA\n\t\tvec2 ruv = rand2( 0 );\n\t\tvec2 jitteredUv = vUv + vec2( tentFilter( ruv.x ) * ssd.x, tentFilter( ruv.y ) * ssd.y );\n\t\tRay ray;\n\n\t\t#if CAMERA_TYPE == 2\n\n\t\t\t// Equirectangular projection\n\t\t\tvec4 rayDirection4 = vec4( equirectUvToDirection( jitteredUv ), 0.0 );\n\t\t\tvec4 rayOrigin4 = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\trayDirection4 = cameraWorldMatrix * rayDirection4;\n\t\t\trayOrigin4 = cameraWorldMatrix * rayOrigin4;\n\n\t\t\tray.direction = normalize( rayDirection4.xyz );\n\t\t\tray.origin = rayOrigin4.xyz / rayOrigin4.w;\n\n\t\t#else\n\n\t\t\t// get [- 1, 1] normalized device coordinates\n\t\t\tvec2 ndc = 2.0 * jitteredUv - vec2( 1.0 );\n\t\t\tray.origin = ndcToRayOrigin( ndc );\n\n\t\t\t#if CAMERA_TYPE == 1\n\n\t\t\t\t// Orthographic projection\n\t\t\t\tray.direction = ( cameraWorldMatrix * vec4( 0.0, 0.0, - 1.0, 0.0 ) ).xyz;\n\t\t\t\tray.direction = normalize( ray.direction );\n\n\t\t\t#else\n\n\t\t\t\t// Perspective projection\n\t\t\t\tray.direction = normalize( mat3( cameraWorldMatrix ) * ( invProjectionMatrix * vec4( ndc, 0.0, 1.0 ) ).xyz );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\t#if FEATURE_DOF\n\t\t{\n\n\t\t\t// depth of field\n\t\t\tvec3 focalPoint = ray.origin + normalize( ray.direction ) * physicalCamera.focusDistance;\n\n\t\t\t// get the aperture sample\n\t\t\t// if blades === 0 then we assume a circle\n\t\t\tvec3 shapeUVW= rand3( 1 );\n\t\t\tint blades = physicalCamera.apertureBlades;\n\t\t\tfloat anamorphicRatio = physicalCamera.anamorphicRatio;\n\t\t\tvec2 apertureSample = sampleAperture( blades, shapeUVW );\n\t\t\tapertureSample *= physicalCamera.bokehSize * 0.5 * 1e-3;\n\n\t\t\t// rotate the aperture shape\n\t\t\tapertureSample =\n\t\t\t\trotateVector( apertureSample, physicalCamera.apertureRotation ) *\n\t\t\t\tsaturate( vec2( anamorphicRatio, 1.0 / anamorphicRatio ) );\n\n\t\t\t// create the new ray\n\t\t\tray.origin += ( cameraWorldMatrix * vec4( apertureSample, 0.0, 0.0 ) ).xyz;\n\t\t\tray.direction = focalPoint - ray.origin;\n\n\t\t}\n\t\t#endif\n\n\t\tray.direction = normalize( ray.direction );\n\n\t\treturn ray;\n\n\t}\n\n`;\n","export const direct_light_contribution_function = /*glsl*/`\n\n\tvec3 directLightContribution( vec3 worldWo, SurfaceRecord surf, RenderState state, vec3 rayOrigin ) {\n\n\t\tvec3 result = vec3( 0.0 );\n\n\t\t// uniformly pick a light or environment map\n\t\tif( lightsDenom != 0.0 && rand( 5 ) < float( lights.count ) / lightsDenom ) {\n\n\t\t\t// sample a light or environment\n\t\t\tLightRecord lightRec = randomLightSample( lights.tex, iesProfiles, lights.count, rayOrigin, rand3( 6 ) );\n\n\t\t\tbool isSampleBelowSurface = ! surf.volumeParticle && dot( surf.faceNormal, lightRec.direction ) < 0.0;\n\t\t\tif ( isSampleBelowSurface ) {\n\n\t\t\t\tlightRec.pdf = 0.0;\n\n\t\t\t}\n\n\t\t\t// check if a ray could even reach the light area\n\t\t\tRay lightRay;\n\t\t\tlightRay.origin = rayOrigin;\n\t\t\tlightRay.direction = lightRec.direction;\n\t\t\tvec3 attenuatedColor;\n\t\t\tif (\n\t\t\t\tlightRec.pdf > 0.0 &&\n\t\t\t\tisDirectionValid( lightRec.direction, surf.normal, surf.faceNormal ) &&\n\t\t\t\t! attenuateHit( state, lightRay, lightRec.dist, attenuatedColor )\n\t\t\t) {\n\n\t\t\t\t// get the material pdf\n\t\t\t\tvec3 sampleColor;\n\t\t\t\tfloat lightMaterialPdf = bsdfResult( worldWo, lightRec.direction, surf, sampleColor );\n\t\t\t\tbool isValidSampleColor = all( greaterThanEqual( sampleColor, vec3( 0.0 ) ) );\n\t\t\t\tif ( lightMaterialPdf > 0.0 && isValidSampleColor ) {\n\n\t\t\t\t\t// weight the direct light contribution\n\t\t\t\t\tfloat lightPdf = lightRec.pdf / lightsDenom;\n\t\t\t\t\tfloat misWeight = lightRec.type == SPOT_LIGHT_TYPE || lightRec.type == DIR_LIGHT_TYPE || lightRec.type == POINT_LIGHT_TYPE ? 1.0 : misHeuristic( lightPdf, lightMaterialPdf );\n\t\t\t\t\tresult = attenuatedColor * lightRec.emission * state.throughputColor * sampleColor * misWeight / lightPdf;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else if ( envMapInfo.totalSum != 0.0 && environmentIntensity != 0.0 ) {\n\n\t\t\t// find a sample in the environment map to include in the contribution\n\t\t\tvec3 envColor, envDirection;\n\t\t\tfloat envPdf = sampleEquirectProbability( rand2( 7 ), envColor, envDirection );\n\t\t\tenvDirection = invEnvRotation3x3 * envDirection;\n\n\t\t\t// this env sampling is not set up for transmissive sampling and yields overly bright\n\t\t\t// results so we ignore the sample in this case.\n\t\t\t// TODO: this should be improved but how? The env samples could traverse a few layers?\n\t\t\tbool isSampleBelowSurface = ! surf.volumeParticle && dot( surf.faceNormal, envDirection ) < 0.0;\n\t\t\tif ( isSampleBelowSurface ) {\n\n\t\t\t\tenvPdf = 0.0;\n\n\t\t\t}\n\n\t\t\t// check if a ray could even reach the surface\n\t\t\tRay envRay;\n\t\t\tenvRay.origin = rayOrigin;\n\t\t\tenvRay.direction = envDirection;\n\t\t\tvec3 attenuatedColor;\n\t\t\tif (\n\t\t\t\tenvPdf > 0.0 &&\n\t\t\t\tisDirectionValid( envDirection, surf.normal, surf.faceNormal ) &&\n\t\t\t\t! attenuateHit( state, envRay, INFINITY, attenuatedColor )\n\t\t\t) {\n\n\t\t\t\t// get the material pdf\n\t\t\t\tvec3 sampleColor;\n\t\t\t\tfloat envMaterialPdf = bsdfResult( worldWo, envDirection, surf, sampleColor );\n\t\t\t\tbool isValidSampleColor = all( greaterThanEqual( sampleColor, vec3( 0.0 ) ) );\n\t\t\t\tif ( envMaterialPdf > 0.0 && isValidSampleColor ) {\n\n\t\t\t\t\t// weight the direct light contribution\n\t\t\t\t\tenvPdf /= lightsDenom;\n\t\t\t\t\tfloat misWeight = misHeuristic( envPdf, envMaterialPdf );\n\t\t\t\t\tresult = attenuatedColor * environmentIntensity * envColor * state.throughputColor * sampleColor * misWeight / envPdf;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t// Function changed to have a single return statement to potentially help with crashes on Mac OS.\n\t\t// See issue #470\n\t\treturn result;\n\n\t}\n\n`;\n","\nexport const get_surface_record_function = /* glsl */`\n\n\t#define SKIP_SURFACE 0\n\t#define HIT_SURFACE 1\n\tint getSurfaceRecord(\n\t\tMaterial material, SurfaceHit surfaceHit, sampler2DArray attributesArray,\n\t\tfloat accumulatedRoughness,\n\t\tinout SurfaceRecord surf\n\t) {\n\n\t\tif ( material.fogVolume ) {\n\n\t\t\tvec3 normal = vec3( 0, 0, 1 );\n\n\t\t\tSurfaceRecord fogSurface;\n\t\t\tfogSurface.volumeParticle = true;\n\t\t\tfogSurface.color = material.color;\n\t\t\tfogSurface.emission = material.emissiveIntensity * material.emissive;\n\t\t\tfogSurface.normal = normal;\n\t\t\tfogSurface.faceNormal = normal;\n\t\t\tfogSurface.clearcoatNormal = normal;\n\n\t\t\tsurf = fogSurface;\n\t\t\treturn HIT_SURFACE;\n\n\t\t}\n\n\t\t// uv coord for textures\n\t\tvec2 uv = textureSampleBarycoord( attributesArray, ATTR_UV, surfaceHit.barycoord, surfaceHit.faceIndices.xyz ).xy;\n\t\tvec4 vertexColor = textureSampleBarycoord( attributesArray, ATTR_COLOR, surfaceHit.barycoord, surfaceHit.faceIndices.xyz );\n\n\t\t// albedo\n\t\tvec4 albedo = vec4( material.color, material.opacity );\n\t\tif ( material.map != - 1 ) {\n\n\t\t\tvec3 uvPrime = material.mapTransform * vec3( uv, 1 );\n\t\t\talbedo *= texture2D( textures, vec3( uvPrime.xy, material.map ) );\n\n\t\t}\n\n\t\tif ( material.vertexColors ) {\n\n\t\t\talbedo *= vertexColor;\n\n\t\t}\n\n\t\t// alphaMap\n\t\tif ( material.alphaMap != - 1 ) {\n\n\t\t\tvec3 uvPrime = material.alphaMapTransform * vec3( uv, 1 );\n\t\t\talbedo.a *= texture2D( textures, vec3( uvPrime.xy, material.alphaMap ) ).x;\n\n\t\t}\n\n\t\t// possibly skip this sample if it's transparent, alpha test is enabled, or we hit the wrong material side\n\t\t// and it's single sided.\n\t\t// - alpha test is disabled when it === 0\n\t\t// - the material sidedness test is complicated because we want light to pass through the back side but still\n\t\t// be able to see the front side. This boolean checks if the side we hit is the front side on the first ray\n\t\t// and we're rendering the other then we skip it. Do the opposite on subsequent bounces to get incoming light.\n\t\tfloat alphaTest = material.alphaTest;\n\t\tbool useAlphaTest = alphaTest != 0.0;\n\t\tif (\n\t\t\t// material sidedness\n\t\t\tmaterial.side != 0.0 && surfaceHit.side != material.side\n\n\t\t\t// alpha test\n\t\t\t|| useAlphaTest && albedo.a < alphaTest\n\n\t\t\t// opacity\n\t\t\t|| material.transparent && ! useAlphaTest && albedo.a < rand( 3 )\n\t\t) {\n\n\t\t\treturn SKIP_SURFACE;\n\n\t\t}\n\n\t\t// fetch the interpolated smooth normal\n\t\tvec3 normal = normalize( textureSampleBarycoord(\n\t\t\tattributesArray,\n\t\t\tATTR_NORMAL,\n\t\t\tsurfaceHit.barycoord,\n\t\t\tsurfaceHit.faceIndices.xyz\n\t\t).xyz );\n\n\t\t// roughness\n\t\tfloat roughness = material.roughness;\n\t\tif ( material.roughnessMap != - 1 ) {\n\n\t\t\tvec3 uvPrime = material.roughnessMapTransform * vec3( uv, 1 );\n\t\t\troughness *= texture2D( textures, vec3( uvPrime.xy, material.roughnessMap ) ).g;\n\n\t\t}\n\n\t\t// metalness\n\t\tfloat metalness = material.metalness;\n\t\tif ( material.metalnessMap != - 1 ) {\n\n\t\t\tvec3 uvPrime = material.metalnessMapTransform * vec3( uv, 1 );\n\t\t\tmetalness *= texture2D( textures, vec3( uvPrime.xy, material.metalnessMap ) ).b;\n\n\t\t}\n\n\t\t// emission\n\t\tvec3 emission = material.emissiveIntensity * material.emissive;\n\t\tif ( material.emissiveMap != - 1 ) {\n\n\t\t\tvec3 uvPrime = material.emissiveMapTransform * vec3( uv, 1 );\n\t\t\temission *= texture2D( textures, vec3( uvPrime.xy, material.emissiveMap ) ).xyz;\n\n\t\t}\n\n\t\t// transmission\n\t\tfloat transmission = material.transmission;\n\t\tif ( material.transmissionMap != - 1 ) {\n\n\t\t\tvec3 uvPrime = material.transmissionMapTransform * vec3( uv, 1 );\n\t\t\ttransmission *= texture2D( textures, vec3( uvPrime.xy, material.transmissionMap ) ).r;\n\n\t\t}\n\n\t\t// normal\n\t\tif ( material.flatShading ) {\n\n\t\t\t// if we're rendering a flat shaded object then use the face normals - the face normal\n\t\t\t// is provided based on the side the ray hits the mesh so flip it to align with the\n\t\t\t// interpolated vertex normals.\n\t\t\tnormal = surfaceHit.faceNormal * surfaceHit.side;\n\n\t\t}\n\n\t\tvec3 baseNormal = normal;\n\t\tif ( material.normalMap != - 1 ) {\n\n\t\t\tvec4 tangentSample = textureSampleBarycoord(\n\t\t\t\tattributesArray,\n\t\t\t\tATTR_TANGENT,\n\t\t\t\tsurfaceHit.barycoord,\n\t\t\t\tsurfaceHit.faceIndices.xyz\n\t\t\t);\n\n\t\t\t// some provided tangents can be malformed (0, 0, 0) causing the normal to be degenerate\n\t\t\t// resulting in NaNs and slow path tracing.\n\t\t\tif ( length( tangentSample.xyz ) > 0.0 ) {\n\n\t\t\t\tvec3 tangent = normalize( tangentSample.xyz );\n\t\t\t\tvec3 bitangent = normalize( cross( normal, tangent ) * tangentSample.w );\n\t\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\n\t\t\t\tvec3 uvPrime = material.normalMapTransform * vec3( uv, 1 );\n\t\t\t\tvec3 texNormal = texture2D( textures, vec3( uvPrime.xy, material.normalMap ) ).xyz * 2.0 - 1.0;\n\t\t\t\ttexNormal.xy *= material.normalScale;\n\t\t\t\tnormal = vTBN * texNormal;\n\n\t\t\t}\n\n\t\t}\n\n\t\tnormal *= surfaceHit.side;\n\n\t\t// clearcoat\n\t\tfloat clearcoat = material.clearcoat;\n\t\tif ( material.clearcoatMap != - 1 ) {\n\n\t\t\tvec3 uvPrime = material.clearcoatMapTransform * vec3( uv, 1 );\n\t\t\tclearcoat *= texture2D( textures, vec3( uvPrime.xy, material.clearcoatMap ) ).r;\n\n\t\t}\n\n\t\t// clearcoatRoughness\n\t\tfloat clearcoatRoughness = material.clearcoatRoughness;\n\t\tif ( material.clearcoatRoughnessMap != - 1 ) {\n\n\t\t\tvec3 uvPrime = material.clearcoatRoughnessMapTransform * vec3( uv, 1 );\n\t\t\tclearcoatRoughness *= texture2D( textures, vec3( uvPrime.xy, material.clearcoatRoughnessMap ) ).g;\n\n\t\t}\n\n\t\t// clearcoatNormal\n\t\tvec3 clearcoatNormal = baseNormal;\n\t\tif ( material.clearcoatNormalMap != - 1 ) {\n\n\t\t\tvec4 tangentSample = textureSampleBarycoord(\n\t\t\t\tattributesArray,\n\t\t\t\tATTR_TANGENT,\n\t\t\t\tsurfaceHit.barycoord,\n\t\t\t\tsurfaceHit.faceIndices.xyz\n\t\t\t);\n\n\t\t\t// some provided tangents can be malformed (0, 0, 0) causing the normal to be degenerate\n\t\t\t// resulting in NaNs and slow path tracing.\n\t\t\tif ( length( tangentSample.xyz ) > 0.0 ) {\n\n\t\t\t\tvec3 tangent = normalize( tangentSample.xyz );\n\t\t\t\tvec3 bitangent = normalize( cross( clearcoatNormal, tangent ) * tangentSample.w );\n\t\t\t\tmat3 vTBN = mat3( tangent, bitangent, clearcoatNormal );\n\n\t\t\t\tvec3 uvPrime = material.clearcoatNormalMapTransform * vec3( uv, 1 );\n\t\t\t\tvec3 texNormal = texture2D( textures, vec3( uvPrime.xy, material.clearcoatNormalMap ) ).xyz * 2.0 - 1.0;\n\t\t\t\ttexNormal.xy *= material.clearcoatNormalScale;\n\t\t\t\tclearcoatNormal = vTBN * texNormal;\n\n\t\t\t}\n\n\t\t}\n\n\t\tclearcoatNormal *= surfaceHit.side;\n\n\t\t// sheenColor\n\t\tvec3 sheenColor = material.sheenColor;\n\t\tif ( material.sheenColorMap != - 1 ) {\n\n\t\t\tvec3 uvPrime = material.sheenColorMapTransform * vec3( uv, 1 );\n\t\t\tsheenColor *= texture2D( textures, vec3( uvPrime.xy, material.sheenColorMap ) ).rgb;\n\n\t\t}\n\n\t\t// sheenRoughness\n\t\tfloat sheenRoughness = material.sheenRoughness;\n\t\tif ( material.sheenRoughnessMap != - 1 ) {\n\n\t\t\tvec3 uvPrime = material.sheenRoughnessMapTransform * vec3( uv, 1 );\n\t\t\tsheenRoughness *= texture2D( textures, vec3( uvPrime.xy, material.sheenRoughnessMap ) ).a;\n\n\t\t}\n\n\t\t// iridescence\n\t\tfloat iridescence = material.iridescence;\n\t\tif ( material.iridescenceMap != - 1 ) {\n\n\t\t\tvec3 uvPrime = material.iridescenceMapTransform * vec3( uv, 1 );\n\t\t\tiridescence *= texture2D( textures, vec3( uvPrime.xy, material.iridescenceMap ) ).r;\n\n\t\t}\n\n\t\t// iridescence thickness\n\t\tfloat iridescenceThickness = material.iridescenceThicknessMaximum;\n\t\tif ( material.iridescenceThicknessMap != - 1 ) {\n\n\t\t\tvec3 uvPrime = material.iridescenceThicknessMapTransform * vec3( uv, 1 );\n\t\t\tfloat iridescenceThicknessSampled = texture2D( textures, vec3( uvPrime.xy, material.iridescenceThicknessMap ) ).g;\n\t\t\tiridescenceThickness = mix( material.iridescenceThicknessMinimum, material.iridescenceThicknessMaximum, iridescenceThicknessSampled );\n\n\t\t}\n\n\t\tiridescence = iridescenceThickness == 0.0 ? 0.0 : iridescence;\n\n\t\t// specular color\n\t\tvec3 specularColor = material.specularColor;\n\t\tif ( material.specularColorMap != - 1 ) {\n\n\t\t\tvec3 uvPrime = material.specularColorMapTransform * vec3( uv, 1 );\n\t\t\tspecularColor *= texture2D( textures, vec3( uvPrime.xy, material.specularColorMap ) ).rgb;\n\n\t\t}\n\n\t\t// specular intensity\n\t\tfloat specularIntensity = material.specularIntensity;\n\t\tif ( material.specularIntensityMap != - 1 ) {\n\n\t\t\tvec3 uvPrime = material.specularIntensityMapTransform * vec3( uv, 1 );\n\t\t\tspecularIntensity *= texture2D( textures, vec3( uvPrime.xy, material.specularIntensityMap ) ).a;\n\n\t\t}\n\n\t\tsurf.volumeParticle = false;\n\n\t\tsurf.faceNormal = surfaceHit.faceNormal;\n\t\tsurf.normal = normal;\n\n\t\tsurf.metalness = metalness;\n\t\tsurf.color = albedo.rgb;\n\t\tsurf.emission = emission;\n\n\t\tsurf.ior = material.ior;\n\t\tsurf.transmission = transmission;\n\t\tsurf.thinFilm = material.thinFilm;\n\t\tsurf.attenuationColor = material.attenuationColor;\n\t\tsurf.attenuationDistance = material.attenuationDistance;\n\n\t\tsurf.clearcoatNormal = clearcoatNormal;\n\t\tsurf.clearcoat = clearcoat;\n\n\t\tsurf.sheen = material.sheen;\n\t\tsurf.sheenColor = sheenColor;\n\n\t\tsurf.iridescence = iridescence;\n\t\tsurf.iridescenceIor = material.iridescenceIor;\n\t\tsurf.iridescenceThickness = iridescenceThickness;\n\n\t\tsurf.specularColor = specularColor;\n\t\tsurf.specularIntensity = specularIntensity;\n\n\t\t// apply perceptual roughness factor from gltf. sheen perceptual roughness is\n\t\t// applied by its brdf function\n\t\t// https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#microfacet-surfaces\n\t\tsurf.roughness = roughness * roughness;\n\t\tsurf.clearcoatRoughness = clearcoatRoughness * clearcoatRoughness;\n\t\tsurf.sheenRoughness = sheenRoughness;\n\n\t\t// frontFace is used to determine transmissive properties and PDF. If no transmission is used\n\t\t// then we can just always assume this is a front face.\n\t\tsurf.frontFace = surfaceHit.side == 1.0 || transmission == 0.0;\n\t\tsurf.eta = material.thinFilm || surf.frontFace ? 1.0 / material.ior : material.ior;\n\t\tsurf.f0 = iorRatioToF0( surf.eta );\n\n\t\t// Compute the filtered roughness value to use during specular reflection computations.\n\t\t// The accumulated roughness value is scaled by a user setting and a \"magic value\" of 5.0.\n\t\t// If we're exiting something transmissive then scale the factor down significantly so we can retain\n\t\t// sharp internal reflections\n\t\tsurf.filteredRoughness = applyFilteredGlossy( surf.roughness, accumulatedRoughness );\n\t\tsurf.filteredClearcoatRoughness = applyFilteredGlossy( surf.clearcoatRoughness, accumulatedRoughness );\n\n\t\t// get the normal frames\n\t\tsurf.normalBasis = getBasisFromNormal( surf.normal );\n\t\tsurf.normalInvBasis = inverse( surf.normalBasis );\n\n\t\tsurf.clearcoatBasis = getBasisFromNormal( surf.clearcoatNormal );\n\t\tsurf.clearcoatInvBasis = inverse( surf.clearcoatBasis );\n\n\t\treturn HIT_SURFACE;\n\n\t}\n`;\n","export const render_structs = /* glsl */`\n\n\tstruct Ray {\n\n\t\tvec3 origin;\n\t\tvec3 direction;\n\n\t};\n\n\tstruct SurfaceHit {\n\n\t\tuvec4 faceIndices;\n\t\tvec3 barycoord;\n\t\tvec3 faceNormal;\n\t\tfloat side;\n\t\tfloat dist;\n\n\t};\n\n\tstruct RenderState {\n\n\t\tbool firstRay;\n\t\tbool transmissiveRay;\n\t\tbool isShadowRay;\n\t\tfloat accumulatedRoughness;\n\t\tint transmissiveTraversals;\n\t\tint traversals;\n\t\tuint depth;\n\t\tvec3 throughputColor;\n\t\tMaterial fogMaterial;\n\n\t};\n\n\tRenderState initRenderState() {\n\n\t\tRenderState result;\n\t\tresult.firstRay = true;\n\t\tresult.transmissiveRay = true;\n\t\tresult.isShadowRay = false;\n\t\tresult.accumulatedRoughness = 0.0;\n\t\tresult.transmissiveTraversals = 0;\n\t\tresult.traversals = 0;\n\t\tresult.throughputColor = vec3( 1.0 );\n\t\tresult.depth = 0u;\n\t\tresult.fogMaterial.fogVolume = false;\n\t\treturn result;\n\n\t}\n\n`;\n","export const trace_scene_function = /* glsl */`\n\n\t#define NO_HIT 0\n\t#define SURFACE_HIT 1\n\t#define LIGHT_HIT 2\n\t#define FOG_HIT 3\n\n\t// Passing the global variable 'lights' into this function caused shader program errors.\n\t// So global variables like 'lights' and 'bvh' were moved out of the function parameters.\n\t// For more information, refer to: https://github.com/gkjohnson/three-gpu-pathtracer/pull/457\n\tint traceScene(\n\t\tRay ray, Material fogMaterial, inout SurfaceHit surfaceHit\n\t) {\n\n\t\tint result = NO_HIT;\n\t\tbool hit = bvhIntersectFirstHit( bvh, ray.origin, ray.direction, surfaceHit.faceIndices, surfaceHit.faceNormal, surfaceHit.barycoord, surfaceHit.side, surfaceHit.dist );\n\n\t\t#if FEATURE_FOG\n\n\t\tif ( fogMaterial.fogVolume ) {\n\n\t\t\t// offset the distance so we don't run into issues with particles on the same surface\n\t\t\t// as other objects\n\t\t\tfloat particleDist = intersectFogVolume( fogMaterial, rand( 1 ) );\n\t\t\tif ( particleDist + RAY_OFFSET < surfaceHit.dist ) {\n\n\t\t\t\tsurfaceHit.side = 1.0;\n\t\t\t\tsurfaceHit.faceNormal = normalize( - ray.direction );\n\t\t\t\tsurfaceHit.dist = particleDist;\n\t\t\t\treturn FOG_HIT;\n\n\t\t\t}\n\n\t\t}\n\n\t\t#endif\n\n\t\tif ( hit ) {\n\n\t\t\tresult = SURFACE_HIT;\n\n\t\t}\n\n\t\treturn result;\n\n\t}\n\n`;\n","import { ClampToEdgeWrapping, HalfFloatType, Matrix4, Vector2 } from 'three';\nimport { MaterialBase } from '../MaterialBase.js';\nimport {\n\tMeshBVHUniformStruct, UIntVertexAttributeTexture,\n\tBVHShaderGLSL,\n} from 'three-mesh-bvh';\n\n// uniforms\nimport { PhysicalCameraUniform } from '../../uniforms/PhysicalCameraUniform.js';\nimport { EquirectHdrInfoUniform } from '../../uniforms/EquirectHdrInfoUniform.js';\nimport { LightsInfoUniformStruct } from '../../uniforms/LightsInfoUniformStruct.js';\nimport { AttributesTextureArray } from '../../uniforms/AttributesTextureArray.js';\nimport { MaterialsTexture, MATERIAL_PIXELS } from '../../uniforms/MaterialsTexture.js';\nimport { RenderTarget2DArray } from '../../uniforms/RenderTarget2DArray.js';\nimport { StratifiedSamplesTexture } from '../../uniforms/StratifiedSamplesTexture.js';\nimport { BlueNoiseTexture } from '../../textures/BlueNoiseTexture.js';\n\n// general glsl\nimport * as StructsGLSL from '../../shader/structs/index.js';\nimport * as SamplingGLSL from '../../shader/sampling/index.js';\nimport * as CommonGLSL from '../../shader/common/index.js';\nimport * as RandomGLSL from '../../shader/rand/index.js';\nimport * as BSDFGLSL from '../../shader/bsdf/index.js';\nimport * as PTBVHGLSL from '../../shader/bvh/index.js';\n\n// path tracer glsl\nimport * as RenderGLSL from './glsl/index.js';\n\nexport class PhysicalPathTracingMaterial extends MaterialBase {\n\n\tonBeforeRender() {\n\n\t\tthis.setDefine( 'FEATURE_DOF', this.physicalCamera.bokehSize === 0 ? 0 : 1 );\n\t\tthis.setDefine( 'FEATURE_BACKGROUND_MAP', this.backgroundMap ? 1 : 0 );\n\t\tthis.setDefine( 'FEATURE_FOG', this.materials.features.isUsed( 'FOG' ) ? 1 : 0 );\n\n\t}\n\n\tconstructor( parameters ) {\n\n\t\tsuper( {\n\n\t\t\ttransparent: true,\n\t\t\tdepthWrite: false,\n\n\t\t\tdefines: {\n\t\t\t\tFEATURE_MIS: 1,\n\t\t\t\tFEATURE_RUSSIAN_ROULETTE: 1,\n\t\t\t\tFEATURE_DOF: 1,\n\t\t\t\tFEATURE_BACKGROUND_MAP: 0,\n\t\t\t\tFEATURE_FOG: 1,\n\n\t\t\t\t// 0 = PCG\n\t\t\t\t// 1 = Sobol\n\t\t\t\t// 2 = Stratified List\n\t\t\t\tRANDOM_TYPE: 2,\n\n\t\t\t\t// 0 = Perspective\n\t\t\t\t// 1 = Orthographic\n\t\t\t\t// 2 = Equirectangular\n\t\t\t\tCAMERA_TYPE: 0,\n\n\t\t\t\tDEBUG_MODE: 0,\n\n\t\t\t\tATTR_NORMAL: 0,\n\t\t\t\tATTR_TANGENT: 1,\n\t\t\t\tATTR_UV: 2,\n\t\t\t\tATTR_COLOR: 3,\n\t\t\t\tMATERIAL_PIXELS: MATERIAL_PIXELS,\n\t\t\t},\n\n\t\t\tuniforms: {\n\n\t\t\t\t// path trace uniforms\n\t\t\t\tresolution: { value: new Vector2() },\n\t\t\t\topacity: { value: 1 },\n\t\t\t\tbounces: { value: 10 },\n\t\t\t\ttransmissiveBounces: { value: 10 },\n\t\t\t\tfilterGlossyFactor: { value: 0 },\n\n\t\t\t\t// camera uniforms\n\t\t\t\tphysicalCamera: { value: new PhysicalCameraUniform() },\n\t\t\t\tcameraWorldMatrix: { value: new Matrix4() },\n\t\t\t\tinvProjectionMatrix: { value: new Matrix4() },\n\n\t\t\t\t// scene uniforms\n\t\t\t\tbvh: { value: new MeshBVHUniformStruct() },\n\t\t\t\tattributesArray: { value: new AttributesTextureArray() },\n\t\t\t\tmaterialIndexAttribute: { value: new UIntVertexAttributeTexture() },\n\t\t\t\tmaterials: { value: new MaterialsTexture() },\n\t\t\t\ttextures: { value: new RenderTarget2DArray().texture },\n\n\t\t\t\t// light uniforms\n\t\t\t\tlights: { value: new LightsInfoUniformStruct() },\n\t\t\t\tiesProfiles: { value: new RenderTarget2DArray( 360, 180, {\n\t\t\t\t\ttype: HalfFloatType,\n\t\t\t\t\twrapS: ClampToEdgeWrapping,\n\t\t\t\t\twrapT: ClampToEdgeWrapping,\n\t\t\t\t} ).texture },\n\t\t\t\tenvironmentIntensity: { value: 1.0 },\n\t\t\t\tenvironmentRotation: { value: new Matrix4() },\n\t\t\t\tenvMapInfo: { value: new EquirectHdrInfoUniform() },\n\n\t\t\t\t// background uniforms\n\t\t\t\tbackgroundBlur: { value: 0.0 },\n\t\t\t\tbackgroundMap: { value: null },\n\t\t\t\tbackgroundAlpha: { value: 1.0 },\n\t\t\t\tbackgroundIntensity: { value: 1.0 },\n\t\t\t\tbackgroundRotation: { value: new Matrix4() },\n\n\t\t\t\t// randomness uniforms\n\t\t\t\tseed: { value: 0 },\n\t\t\t\tsobolTexture: { value: null },\n\t\t\t\tstratifiedTexture: { value: new StratifiedSamplesTexture() },\n\t\t\t\tstratifiedOffsetTexture: { value: new BlueNoiseTexture( 64, 1 ) },\n\t\t\t},\n\n\t\t\tvertexShader: /* glsl */`\n\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec4 mvPosition = vec4( position, 1.0 );\n\t\t\t\t\tmvPosition = modelViewMatrix * mvPosition;\n\t\t\t\t\tgl_Position = projectionMatrix * mvPosition;\n\n\t\t\t\t\tvUv = uv;\n\n\t\t\t\t}\n\n\t\t\t`,\n\n\t\t\tfragmentShader: /* glsl */`\n\t\t\t\t#define RAY_OFFSET 1e-4\n\t\t\t\t#define INFINITY 1e20\n\n\t\t\t\tprecision highp isampler2D;\n\t\t\t\tprecision highp usampler2D;\n\t\t\t\tprecision highp sampler2DArray;\n\t\t\t\tvec4 envMapTexelToLinear( vec4 a ) { return a; }\n\t\t\t\t#include <common>\n\n\t\t\t\t// bvh intersection\n\t\t\t\t${ BVHShaderGLSL.common_functions }\n\t\t\t\t${ BVHShaderGLSL.bvh_struct_definitions }\n\t\t\t\t${ BVHShaderGLSL.bvh_ray_functions }\n\n\t\t\t\t// uniform structs\n\t\t\t\t${ StructsGLSL.camera_struct }\n\t\t\t\t${ StructsGLSL.lights_struct }\n\t\t\t\t${ StructsGLSL.equirect_struct }\n\t\t\t\t${ StructsGLSL.material_struct }\n\t\t\t\t${ StructsGLSL.surface_record_struct }\n\n\t\t\t\t// random\n\t\t\t\t#if RANDOM_TYPE == 2 \t// Stratified List\n\n\t\t\t\t\t${ RandomGLSL.stratified_functions }\n\n\t\t\t\t#elif RANDOM_TYPE == 1 \t// Sobol\n\n\t\t\t\t\t${ RandomGLSL.pcg_functions }\n\t\t\t\t\t${ RandomGLSL.sobol_common }\n\t\t\t\t\t${ RandomGLSL.sobol_functions }\n\n\t\t\t\t\t#define rand(v) sobol(v)\n\t\t\t\t\t#define rand2(v) sobol2(v)\n\t\t\t\t\t#define rand3(v) sobol3(v)\n\t\t\t\t\t#define rand4(v) sobol4(v)\n\n\t\t\t\t#else \t\t\t\t\t// PCG\n\n\t\t\t\t${ RandomGLSL.pcg_functions }\n\n\t\t\t\t\t// Using the sobol functions seems to break the the compiler on MacOS\n\t\t\t\t\t// - specifically the \"sobolReverseBits\" function.\n\t\t\t\t\tuint sobolPixelIndex = 0u;\n\t\t\t\t\tuint sobolPathIndex = 0u;\n\t\t\t\t\tuint sobolBounceIndex = 0u;\n\n\t\t\t\t\t#define rand(v) pcgRand()\n\t\t\t\t\t#define rand2(v) pcgRand2()\n\t\t\t\t\t#define rand3(v) pcgRand3()\n\t\t\t\t\t#define rand4(v) pcgRand4()\n\n\t\t\t\t#endif\n\n\t\t\t\t// common\n\t\t\t\t${ CommonGLSL.texture_sample_functions }\n\t\t\t\t${ CommonGLSL.fresnel_functions }\n\t\t\t\t${ CommonGLSL.util_functions }\n\t\t\t\t${ CommonGLSL.math_functions }\n\t\t\t\t${ CommonGLSL.shape_intersection_functions }\n\n\t\t\t\t// environment\n\t\t\t\tuniform EquirectHdrInfo envMapInfo;\n\t\t\t\tuniform mat4 environmentRotation;\n\t\t\t\tuniform float environmentIntensity;\n\n\t\t\t\t// lighting\n\t\t\t\tuniform sampler2DArray iesProfiles;\n\t\t\t\tuniform LightsInfo lights;\n\n\t\t\t\t// background\n\t\t\t\tuniform float backgroundBlur;\n\t\t\t\tuniform float backgroundAlpha;\n\t\t\t\t#if FEATURE_BACKGROUND_MAP\n\n\t\t\t\tuniform sampler2D backgroundMap;\n\t\t\t\tuniform mat4 backgroundRotation;\n\t\t\t\tuniform float backgroundIntensity;\n\n\t\t\t\t#endif\n\n\t\t\t\t// camera\n\t\t\t\tuniform mat4 cameraWorldMatrix;\n\t\t\t\tuniform mat4 invProjectionMatrix;\n\t\t\t\t#if FEATURE_DOF\n\n\t\t\t\tuniform PhysicalCamera physicalCamera;\n\n\t\t\t\t#endif\n\n\t\t\t\t// geometry\n\t\t\t\tuniform sampler2DArray attributesArray;\n\t\t\t\tuniform usampler2D materialIndexAttribute;\n\t\t\t\tuniform sampler2D materials;\n\t\t\t\tuniform sampler2DArray textures;\n\t\t\t\tuniform BVH bvh;\n\n\t\t\t\t// path tracer\n\t\t\t\tuniform int bounces;\n\t\t\t\tuniform int transmissiveBounces;\n\t\t\t\tuniform float filterGlossyFactor;\n\t\t\t\tuniform int seed;\n\n\t\t\t\t// image\n\t\t\t\tuniform vec2 resolution;\n\t\t\t\tuniform float opacity;\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\t// globals\n\t\t\t\tmat3 envRotation3x3;\n\t\t\t\tmat3 invEnvRotation3x3;\n\t\t\t\tfloat lightsDenom;\n\n\t\t\t\t// sampling\n\t\t\t\t${ SamplingGLSL.shape_sampling_functions }\n\t\t\t\t${ SamplingGLSL.equirect_functions }\n\t\t\t\t${ SamplingGLSL.light_sampling_functions }\n\n\t\t\t\t${ PTBVHGLSL.inside_fog_volume_function }\n\t\t\t\t${ BSDFGLSL.ggx_functions }\n\t\t\t\t${ BSDFGLSL.sheen_functions }\n\t\t\t\t${ BSDFGLSL.iridescence_functions }\n\t\t\t\t${ BSDFGLSL.fog_functions }\n\t\t\t\t${ BSDFGLSL.bsdf_functions }\n\n\t\t\t\tfloat applyFilteredGlossy( float roughness, float accumulatedRoughness ) {\n\n\t\t\t\t\treturn clamp(\n\t\t\t\t\t\tmax(\n\t\t\t\t\t\t\troughness,\n\t\t\t\t\t\t\taccumulatedRoughness * filterGlossyFactor * 5.0 ),\n\t\t\t\t\t\t0.0,\n\t\t\t\t\t\t1.0\n\t\t\t\t\t);\n\n\t\t\t\t}\n\n\t\t\t\tvec3 sampleBackground( vec3 direction, vec2 uv ) {\n\n\t\t\t\t\tvec3 sampleDir = sampleHemisphere( direction, uv ) * 0.5 * backgroundBlur;\n\n\t\t\t\t\t#if FEATURE_BACKGROUND_MAP\n\n\t\t\t\t\tsampleDir = normalize( mat3( backgroundRotation ) * direction + sampleDir );\n\t\t\t\t\treturn backgroundIntensity * sampleEquirectColor( backgroundMap, sampleDir );\n\n\t\t\t\t\t#else\n\n\t\t\t\t\tsampleDir = normalize( envRotation3x3 * direction + sampleDir );\n\t\t\t\t\treturn environmentIntensity * sampleEquirectColor( envMapInfo.map, sampleDir );\n\n\t\t\t\t\t#endif\n\n\t\t\t\t}\n\n\t\t\t\t${ RenderGLSL.render_structs }\n\t\t\t\t${ RenderGLSL.camera_util_functions }\n\t\t\t\t${ RenderGLSL.trace_scene_function }\n\t\t\t\t${ RenderGLSL.attenuate_hit_function }\n\t\t\t\t${ RenderGLSL.direct_light_contribution_function }\n\t\t\t\t${ RenderGLSL.get_surface_record_function }\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t// init\n\t\t\t\t\trng_initialize( gl_FragCoord.xy, seed );\n\t\t\t\t\tsobolPixelIndex = ( uint( gl_FragCoord.x ) << 16 ) | uint( gl_FragCoord.y );\n\t\t\t\t\tsobolPathIndex = uint( seed );\n\n\t\t\t\t\t// get camera ray\n\t\t\t\t\tRay ray = getCameraRay();\n\n\t\t\t\t\t// inverse environment rotation\n\t\t\t\t\tenvRotation3x3 = mat3( environmentRotation );\n\t\t\t\t\tinvEnvRotation3x3 = inverse( envRotation3x3 );\n\t\t\t\t\tlightsDenom =\n\t\t\t\t\t\t( environmentIntensity == 0.0 || envMapInfo.totalSum == 0.0 ) && lights.count != 0u ?\n\t\t\t\t\t\t\tfloat( lights.count ) :\n\t\t\t\t\t\t\tfloat( lights.count + 1u );\n\n\t\t\t\t\t// final color\n\t\t\t\t\tgl_FragColor = vec4( 0, 0, 0, 1 );\n\n\t\t\t\t\t// surface results\n\t\t\t\t\tSurfaceHit surfaceHit;\n\t\t\t\t\tScatterRecord scatterRec;\n\n\t\t\t\t\t// path tracing state\n\t\t\t\t\tRenderState state = initRenderState();\n\t\t\t\t\tstate.transmissiveTraversals = transmissiveBounces;\n\t\t\t\t\t#if FEATURE_FOG\n\n\t\t\t\t\tstate.fogMaterial.fogVolume = bvhIntersectFogVolumeHit(\n\t\t\t\t\t\tray.origin, - ray.direction,\n\t\t\t\t\t\tmaterialIndexAttribute, materials,\n\t\t\t\t\t\tstate.fogMaterial\n\t\t\t\t\t);\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tfor ( int i = 0; i < bounces; i ++ ) {\n\n\t\t\t\t\t\tsobolBounceIndex ++;\n\n\t\t\t\t\t\tstate.depth ++;\n\t\t\t\t\t\tstate.traversals = bounces - i;\n\t\t\t\t\t\tstate.firstRay = i == 0 && state.transmissiveTraversals == transmissiveBounces;\n\n\t\t\t\t\t\tint hitType = traceScene( ray, state.fogMaterial, surfaceHit );\n\n\t\t\t\t\t\t// check if we intersect any lights and accumulate the light contribution\n\t\t\t\t\t\t// TODO: we can add support for light surface rendering in the else condition if we\n\t\t\t\t\t\t// add the ability to toggle visibility of the the light\n\t\t\t\t\t\tif ( ! state.firstRay && ! state.transmissiveRay ) {\n\n\t\t\t\t\t\t\tLightRecord lightRec;\n\t\t\t\t\t\t\tfloat lightDist = hitType == NO_HIT ? INFINITY : surfaceHit.dist;\n\t\t\t\t\t\t\tfor ( uint i = 0u; i < lights.count; i ++ ) {\n\n\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\tintersectLightAtIndex( lights.tex, ray.origin, ray.direction, i, lightRec ) &&\n\t\t\t\t\t\t\t\t\tlightRec.dist < lightDist\n\t\t\t\t\t\t\t\t) {\n\n\t\t\t\t\t\t\t\t\t#if FEATURE_MIS\n\n\t\t\t\t\t\t\t\t\t// weight the contribution\n\t\t\t\t\t\t\t\t\t// NOTE: Only area lights are supported for forward sampling and can be hit\n\t\t\t\t\t\t\t\t\tfloat misWeight = misHeuristic( scatterRec.pdf, lightRec.pdf / lightsDenom );\n\t\t\t\t\t\t\t\t\tgl_FragColor.rgb += lightRec.emission * state.throughputColor * misWeight;\n\n\t\t\t\t\t\t\t\t\t#else\n\n\t\t\t\t\t\t\t\t\tgl_FragColor.rgb += lightRec.emission * state.throughputColor;\n\n\t\t\t\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( hitType == NO_HIT ) {\n\n\t\t\t\t\t\t\tif ( state.firstRay || state.transmissiveRay ) {\n\n\t\t\t\t\t\t\t\tgl_FragColor.rgb += sampleBackground( ray.direction, rand2( 2 ) ) * state.throughputColor;\n\t\t\t\t\t\t\t\tgl_FragColor.a = backgroundAlpha;\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t#if FEATURE_MIS\n\n\t\t\t\t\t\t\t\t// get the PDF of the hit envmap point\n\t\t\t\t\t\t\t\tvec3 envColor;\n\t\t\t\t\t\t\t\tfloat envPdf = sampleEquirect( envRotation3x3 * ray.direction, envColor );\n\t\t\t\t\t\t\t\tenvPdf /= lightsDenom;\n\n\t\t\t\t\t\t\t\t// and weight the contribution\n\t\t\t\t\t\t\t\tfloat misWeight = misHeuristic( scatterRec.pdf, envPdf );\n\t\t\t\t\t\t\t\tgl_FragColor.rgb += environmentIntensity * envColor * state.throughputColor * misWeight;\n\n\t\t\t\t\t\t\t\t#else\n\n\t\t\t\t\t\t\t\tgl_FragColor.rgb +=\n\t\t\t\t\t\t\t\t\tenvironmentIntensity *\n\t\t\t\t\t\t\t\t\tsampleEquirectColor( envMapInfo.map, envRotation3x3 * ray.direction ) *\n\t\t\t\t\t\t\t\t\tstate.throughputColor;\n\n\t\t\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tuint materialIndex = uTexelFetch1D( materialIndexAttribute, surfaceHit.faceIndices.x ).r;\n\t\t\t\t\t\tMaterial material = readMaterialInfo( materials, materialIndex );\n\n\t\t\t\t\t\t#if FEATURE_FOG\n\n\t\t\t\t\t\tif ( hitType == FOG_HIT ) {\n\n\t\t\t\t\t\t\tmaterial = state.fogMaterial;\n\t\t\t\t\t\t\tstate.accumulatedRoughness += 0.2;\n\n\t\t\t\t\t\t} else if ( material.fogVolume ) {\n\n\t\t\t\t\t\t\tstate.fogMaterial = material;\n\t\t\t\t\t\t\tstate.fogMaterial.fogVolume = surfaceHit.side == 1.0;\n\n\t\t\t\t\t\t\tray.origin = stepRayOrigin( ray.origin, ray.direction, - surfaceHit.faceNormal, surfaceHit.dist );\n\n\t\t\t\t\t\t\ti -= sign( state.transmissiveTraversals );\n\t\t\t\t\t\t\tstate.transmissiveTraversals -= sign( state.transmissiveTraversals );\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t// early out if this is a matte material\n\t\t\t\t\t\tif ( material.matte && state.firstRay ) {\n\n\t\t\t\t\t\t\tgl_FragColor = vec4( 0.0 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if we've determined that this is a shadow ray and we've hit an item with no shadow casting\n\t\t\t\t\t\t// then skip it\n\t\t\t\t\t\tif ( ! material.castShadow && state.isShadowRay ) {\n\n\t\t\t\t\t\t\tray.origin = stepRayOrigin( ray.origin, ray.direction, - surfaceHit.faceNormal, surfaceHit.dist );\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tSurfaceRecord surf;\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tgetSurfaceRecord(\n\t\t\t\t\t\t\t\tmaterial, surfaceHit, attributesArray, state.accumulatedRoughness,\n\t\t\t\t\t\t\t\tsurf\n\t\t\t\t\t\t\t) == SKIP_SURFACE\n\t\t\t\t\t\t) {\n\n\t\t\t\t\t\t\t// only allow a limited number of transparency discards otherwise we could\n\t\t\t\t\t\t\t// crash the context with too long a loop.\n\t\t\t\t\t\t\ti -= sign( state.transmissiveTraversals );\n\t\t\t\t\t\t\tstate.transmissiveTraversals -= sign( state.transmissiveTraversals );\n\n\t\t\t\t\t\t\tray.origin = stepRayOrigin( ray.origin, ray.direction, - surfaceHit.faceNormal, surfaceHit.dist );\n\t\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tscatterRec = bsdfSample( - ray.direction, surf );\n\t\t\t\t\t\tstate.isShadowRay = scatterRec.specularPdf < rand( 4 );\n\n\t\t\t\t\t\tbool isBelowSurface = ! surf.volumeParticle && dot( scatterRec.direction, surf.faceNormal ) < 0.0;\n\t\t\t\t\t\tvec3 hitPoint = stepRayOrigin( ray.origin, ray.direction, isBelowSurface ? - surf.faceNormal : surf.faceNormal, surfaceHit.dist );\n\n\t\t\t\t\t\t// next event estimation\n\t\t\t\t\t\t#if FEATURE_MIS\n\n\t\t\t\t\t\tgl_FragColor.rgb += directLightContribution( - ray.direction, surf, state, hitPoint );\n\n\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t// accumulate a roughness value to offset diffuse, specular, diffuse rays that have high contribution\n\t\t\t\t\t\t// to a single pixel resulting in fireflies\n\t\t\t\t\t\t// TODO: handle transmissive surfaces\n\t\t\t\t\t\tif ( ! surf.volumeParticle && ! isBelowSurface ) {\n\n\t\t\t\t\t\t\t// determine if this is a rough normal or not by checking how far off straight up it is\n\t\t\t\t\t\t\tvec3 halfVector = normalize( - ray.direction + scatterRec.direction );\n\t\t\t\t\t\t\tstate.accumulatedRoughness += max(\n\t\t\t\t\t\t\t\tsin( acosApprox( dot( halfVector, surf.normal ) ) ),\n\t\t\t\t\t\t\t\tsin( acosApprox( dot( halfVector, surf.clearcoatNormal ) ) )\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tstate.transmissiveRay = false;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// accumulate emissive color\n\t\t\t\t\t\tgl_FragColor.rgb += ( surf.emission * state.throughputColor );\n\n\t\t\t\t\t\t// skip the sample if our PDF or ray is impossible\n\t\t\t\t\t\tif ( scatterRec.pdf <= 0.0 || ! isDirectionValid( scatterRec.direction, surf.normal, surf.faceNormal ) ) {\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// if we're bouncing around the inside a transmissive material then decrement\n\t\t\t\t\t\t// perform this separate from a bounce\n\t\t\t\t\t\tbool isTransmissiveRay = ! surf.volumeParticle && dot( scatterRec.direction, surf.faceNormal * surfaceHit.side ) < 0.0;\n\t\t\t\t\t\tif ( ( isTransmissiveRay || isBelowSurface ) && state.transmissiveTraversals > 0 ) {\n\n\t\t\t\t\t\t\tstate.transmissiveTraversals --;\n\t\t\t\t\t\t\ti --;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\n\t\t\t\t\t\t// handle throughput color transformation\n\t\t\t\t\t\t// attenuate the throughput color by the medium color\n\t\t\t\t\t\tif ( ! surf.frontFace ) {\n\n\t\t\t\t\t\t\tstate.throughputColor *= transmissionAttenuation( surfaceHit.dist, surf.attenuationColor, surf.attenuationDistance );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t#if FEATURE_RUSSIAN_ROULETTE\n\n\t\t\t\t\t\t// russian roulette path termination\n\t\t\t\t\t\t// https://www.arnoldrenderer.com/research/physically_based_shader_design_in_arnold.pdf\n\t\t\t\t\t\tuint minBounces = 3u;\n\t\t\t\t\t\tfloat depthProb = float( state.depth < minBounces );\n\n\t\t\t\t\t\tfloat rrProb = luminance( state.throughputColor * scatterRec.color / scatterRec.pdf );\n\t\t\t\t\t\trrProb /= luminance( state.throughputColor );\n\t\t\t\t\t\trrProb = sqrt( rrProb );\n\t\t\t\t\t\trrProb = max( rrProb, depthProb );\n\t\t\t\t\t\trrProb = min( rrProb, 1.0 );\n\t\t\t\t\t\tif ( rand( 8 ) > rrProb ) {\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// perform sample clamping here to avoid bright pixels\n\t\t\t\t\t\tstate.throughputColor *= min( 1.0 / rrProb, 20.0 );\n\n\t\t\t\t\t\t#endif\n\n\t\t\t\t\t\t// adjust the throughput and discard and exit if we find discard the sample if there are any NaNs\n\t\t\t\t\t\tstate.throughputColor *= scatterRec.color / scatterRec.pdf;\n\t\t\t\t\t\tif ( any( isnan( state.throughputColor ) ) || any( isinf( state.throughputColor ) ) ) {\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//\n\n\t\t\t\t\t\t// prepare for next ray\n\t\t\t\t\t\tray.direction = scatterRec.direction;\n\t\t\t\t\t\tray.origin = hitPoint;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tgl_FragColor.a *= opacity;\n\n\t\t\t\t\t#if DEBUG_MODE == 1\n\n\t\t\t\t\t// output the number of rays checked in the path and number of\n\t\t\t\t\t// transmissive rays encountered.\n\t\t\t\t\tgl_FragColor.rgb = vec3(\n\t\t\t\t\t\tfloat( state.depth ),\n\t\t\t\t\t\ttransmissiveBounces - state.transmissiveTraversals,\n\t\t\t\t\t\t0.0\n\t\t\t\t\t);\n\t\t\t\t\tgl_FragColor.a = 1.0;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t}\n\n\t\t\t`\n\n\t\t} );\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n}\n","import { RGBAFormat, FloatType, Color, Vector2, WebGLRenderTarget, NoBlending, NormalBlending, Vector4, NearestFilter } from 'three';\nimport { FullScreenQuad } from 'three/examples/jsm/postprocessing/Pass.js';\nimport { BlendMaterial } from '../materials/fullscreen/BlendMaterial.js';\nimport { SobolNumberMapGenerator } from '../utils/SobolNumberMapGenerator.js';\nimport { PhysicalPathTracingMaterial } from '../materials/pathtracing/PhysicalPathTracingMaterial.js';\n\nfunction* renderTask() {\n\n\tconst {\n\t\t_renderer,\n\t\t_fsQuad,\n\t\t_blendQuad,\n\t\t_primaryTarget,\n\t\t_blendTargets,\n\t\t_sobolTarget,\n\t\t_subframe,\n\t\talpha,\n\t\tmaterial,\n\t} = this;\n\tconst _ogScissor = new Vector4();\n\tconst _ogViewport = new Vector4();\n\n\tconst blendMaterial = _blendQuad.material;\n\tlet [ blendTarget1, blendTarget2 ] = _blendTargets;\n\n\twhile ( true ) {\n\n\t\tif ( alpha ) {\n\n\t\t\tblendMaterial.opacity = this._opacityFactor / ( this.samples + 1 );\n\t\t\tmaterial.blending = NoBlending;\n\t\t\tmaterial.opacity = 1;\n\n\t\t} else {\n\n\t\t\tmaterial.opacity = this._opacityFactor / ( this.samples + 1 );\n\t\t\tmaterial.blending = NormalBlending;\n\n\t\t}\n\n\t\tconst [ subX, subY, subW, subH ] = _subframe;\n\n\t\tconst w = _primaryTarget.width;\n\t\tconst h = _primaryTarget.height;\n\t\tmaterial.resolution.set( w * subW, h * subH );\n\t\tmaterial.sobolTexture = _sobolTarget.texture;\n\t\tmaterial.stratifiedTexture.init( 20, material.bounces + material.transmissiveBounces + 5 );\n\t\tmaterial.stratifiedTexture.next();\n\t\tmaterial.seed ++;\n\n\t\tconst tilesX = this.tiles.x || 1;\n\t\tconst tilesY = this.tiles.y || 1;\n\t\tconst totalTiles = tilesX * tilesY;\n\n\t\tconst pxSubW = Math.ceil( w * subW );\n\t\tconst pxSubH = Math.ceil( h * subH );\n\t\tconst pxSubX = Math.floor( subX * w );\n\t\tconst pxSubY = Math.floor( subY * h );\n\n\t\tconst pxTileW = Math.ceil( pxSubW / tilesX );\n\t\tconst pxTileH = Math.ceil( pxSubH / tilesY );\n\n\t\tfor ( let y = 0; y < tilesY; y ++ ) {\n\n\t\t\tfor ( let x = 0; x < tilesX; x ++ ) {\n\n\t\t\t\t// store og state\n\t\t\t\tconst ogRenderTarget = _renderer.getRenderTarget();\n\t\t\t\tconst ogAutoClear = _renderer.autoClear;\n\t\t\t\tconst ogScissorTest = _renderer.getScissorTest();\n\t\t\t\t_renderer.getScissor( _ogScissor );\n\t\t\t\t_renderer.getViewport( _ogViewport );\n\n\t\t\t\tlet tx = x;\n\t\t\t\tlet ty = y;\n\t\t\t\tif ( ! this.stableTiles ) {\n\n\t\t\t\t\tconst tileIndex = ( this._currentTile ) % ( tilesX * tilesY );\n\t\t\t\t\ttx = tileIndex % tilesX;\n\t\t\t\t\tty = ~ ~ ( tileIndex / tilesX );\n\n\t\t\t\t\tthis._currentTile = tileIndex + 1;\n\n\t\t\t\t}\n\n\t\t\t\t// set the scissor and the viewport on the render target\n\t\t\t\t// note that when using the webgl renderer set viewport the device pixel ratio\n\t\t\t\t// is multiplied into the field causing some pixels to not be rendered\n\t\t\t\tconst reverseTy = tilesY - ty - 1;\n\t\t\t\t_primaryTarget.scissor.set(\n\t\t\t\t\tpxSubX + tx * pxTileW,\n\t\t\t\t\tpxSubY + reverseTy * pxTileH,\n\t\t\t\t\tMath.min( pxTileW, pxSubW - tx * pxTileW ),\n\t\t\t\t\tMath.min( pxTileH, pxSubH - reverseTy * pxTileH ),\n\t\t\t\t);\n\n\t\t\t\t_primaryTarget.viewport.set(\n\t\t\t\t\tpxSubX,\n\t\t\t\t\tpxSubY,\n\t\t\t\t\tpxSubW,\n\t\t\t\t\tpxSubH,\n\t\t\t\t);\n\n\t\t\t\t// three.js renderer takes values relative to the current pixel ratio\n\t\t\t\t_renderer.setRenderTarget( _primaryTarget );\n\t\t\t\t_renderer.setScissorTest( true );\n\n\t\t\t\t_renderer.autoClear = false;\n\t\t\t\t_fsQuad.render( _renderer );\n\n\t\t\t\t// reset original renderer state\n\t\t\t\t_renderer.setViewport( _ogViewport );\n\t\t\t\t_renderer.setScissor( _ogScissor );\n\t\t\t\t_renderer.setScissorTest( ogScissorTest );\n\t\t\t\t_renderer.setRenderTarget( ogRenderTarget );\n\t\t\t\t_renderer.autoClear = ogAutoClear;\n\n\t\t\t\t// swap and blend alpha targets\n\t\t\t\tif ( alpha ) {\n\n\t\t\t\t\tblendMaterial.target1 = blendTarget1.texture;\n\t\t\t\t\tblendMaterial.target2 = _primaryTarget.texture;\n\n\t\t\t\t\t_renderer.setRenderTarget( blendTarget2 );\n\t\t\t\t\t_blendQuad.render( _renderer );\n\t\t\t\t\t_renderer.setRenderTarget( ogRenderTarget );\n\n\t\t\t\t}\n\n\t\t\t\tthis.samples += ( 1 / totalTiles );\n\n\t\t\t\t// round the samples value if we've finished the tiles\n\t\t\t\tif ( x === tilesX - 1 && y === tilesY - 1 ) {\n\n\t\t\t\t\tthis.samples = Math.round( this.samples );\n\n\t\t\t\t}\n\n\t\t\t\tyield;\n\n\t\t\t}\n\n\t\t}\n\n\t\t[ blendTarget1, blendTarget2 ] = [ blendTarget2, blendTarget1 ];\n\n\t}\n\n}\n\nconst ogClearColor = new Color();\nexport class PathTracingRenderer {\n\n\tget material() {\n\n\t\treturn this._fsQuad.material;\n\n\t}\n\n\tset material( v ) {\n\n\t\tthis._fsQuad.material.removeEventListener( 'recompilation', this._compileFunction );\n\t\tv.addEventListener( 'recompilation', this._compileFunction );\n\n\t\tthis._fsQuad.material = v;\n\n\t}\n\n\tget target() {\n\n\t\treturn this._alpha ? this._blendTargets[ 1 ] : this._primaryTarget;\n\n\t}\n\n\tset alpha( v ) {\n\n\t\tif ( this._alpha === v ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( ! v ) {\n\n\t\t\tthis._blendTargets[ 0 ].dispose();\n\t\t\tthis._blendTargets[ 1 ].dispose();\n\n\t\t}\n\n\t\tthis._alpha = v;\n\t\tthis.reset();\n\n\t}\n\n\tget alpha() {\n\n\t\treturn this._alpha;\n\n\t}\n\n\tget isCompiling() {\n\n\t\treturn Boolean( this._compilePromise );\n\n\t}\n\n\tconstructor( renderer ) {\n\n\t\tthis.camera = null;\n\t\tthis.tiles = new Vector2( 3, 3 );\n\n\t\tthis.stableNoise = false;\n\t\tthis.stableTiles = true;\n\n\t\tthis.samples = 0;\n\t\tthis._subframe = new Vector4( 0, 0, 1, 1 );\n\t\tthis._opacityFactor = 1.0;\n\t\tthis._renderer = renderer;\n\t\tthis._alpha = false;\n\t\tthis._fsQuad = new FullScreenQuad( new PhysicalPathTracingMaterial() );\n\t\tthis._blendQuad = new FullScreenQuad( new BlendMaterial() );\n\t\tthis._task = null;\n\t\tthis._currentTile = 0;\n\t\tthis._compilePromise = null;\n\n\t\tthis._sobolTarget = new SobolNumberMapGenerator().generate( renderer );\n\n\t\tthis._primaryTarget = new WebGLRenderTarget( 1, 1, {\n\t\t\tformat: RGBAFormat,\n\t\t\ttype: FloatType,\n\t\t\tmagFilter: NearestFilter,\n\t\t\tminFilter: NearestFilter,\n\t\t} );\n\t\tthis._blendTargets = [\n\t\t\tnew WebGLRenderTarget( 1, 1, {\n\t\t\t\tformat: RGBAFormat,\n\t\t\t\ttype: FloatType,\n\t\t\t\tmagFilter: NearestFilter,\n\t\t\t\tminFilter: NearestFilter,\n\t\t\t} ),\n\t\t\tnew WebGLRenderTarget( 1, 1, {\n\t\t\t\tformat: RGBAFormat,\n\t\t\t\ttype: FloatType,\n\t\t\t\tmagFilter: NearestFilter,\n\t\t\t\tminFilter: NearestFilter,\n\t\t\t} ),\n\t\t];\n\n\t\t// function for listening to for triggered compilation so we can wait for compilation to finish\n\t\t// before starting to render\n\t\tthis._compileFunction = () => {\n\n\t\t\tconst promise = this.compileMaterial( this._fsQuad._mesh );\n\t\t\tpromise.then( () => {\n\n\t\t\t\tif ( this._compilePromise === promise ) {\n\n\t\t\t\t\tthis._compilePromise = null;\n\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\tthis._compilePromise = promise;\n\n\t\t};\n\n\t\tthis.material.addEventListener( 'recompilation', this._compileFunction );\n\n\t}\n\n\tcompileMaterial() {\n\n\t\treturn this._renderer.compileAsync( this._fsQuad._mesh );\n\n\t}\n\n\tsetCamera( camera ) {\n\n\t\tconst { material } = this;\n\t\tmaterial.cameraWorldMatrix.copy( camera.matrixWorld );\n\t\tmaterial.invProjectionMatrix.copy( camera.projectionMatrixInverse );\n\t\tmaterial.physicalCamera.updateFrom( camera );\n\n\t\t// Perspective camera (default)\n\t\tlet cameraType = 0;\n\n\t\t// An orthographic projection matrix will always have the bottom right element == 1\n\t\t// And a perspective projection matrix will always have the bottom right element == 0\n\t\tif ( camera.projectionMatrix.elements[ 15 ] > 0 ) {\n\n\t\t\t// Orthographic\n\t\t\tcameraType = 1;\n\n\t\t}\n\n\t\tif ( camera.isEquirectCamera ) {\n\n\t\t\t// Equirectangular\n\t\t\tcameraType = 2;\n\n\t\t}\n\n\t\tmaterial.setDefine( 'CAMERA_TYPE', cameraType );\n\n\t\tthis.camera = camera;\n\n\t}\n\n\tsetSize( w, h ) {\n\n\t\tw = Math.ceil( w );\n\t\th = Math.ceil( h );\n\n\t\tif ( this._primaryTarget.width === w && this._primaryTarget.height === h ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis._primaryTarget.setSize( w, h );\n\t\tthis._blendTargets[ 0 ].setSize( w, h );\n\t\tthis._blendTargets[ 1 ].setSize( w, h );\n\t\tthis.reset();\n\n\t}\n\n\tgetSize( target ) {\n\n\t\ttarget.x = this._primaryTarget.width;\n\t\ttarget.y = this._primaryTarget.height;\n\n\t}\n\n\tdispose() {\n\n\t\tthis._primaryTarget.dispose();\n\t\tthis._blendTargets[ 0 ].dispose();\n\t\tthis._blendTargets[ 1 ].dispose();\n\t\tthis._sobolTarget.dispose();\n\n\t\tthis._fsQuad.dispose();\n\t\tthis._blendQuad.dispose();\n\t\tthis._task = null;\n\n\t}\n\n\treset() {\n\n\t\tconst { _renderer, _primaryTarget, _blendTargets } = this;\n\t\tconst ogRenderTarget = _renderer.getRenderTarget();\n\t\tconst ogClearAlpha = _renderer.getClearAlpha();\n\t\t_renderer.getClearColor( ogClearColor );\n\n\t\t_renderer.setRenderTarget( _primaryTarget );\n\t\t_renderer.setClearColor( 0, 0 );\n\t\t_renderer.clearColor();\n\n\t\t_renderer.setRenderTarget( _blendTargets[ 0 ] );\n\t\t_renderer.setClearColor( 0, 0 );\n\t\t_renderer.clearColor();\n\n\t\t_renderer.setRenderTarget( _blendTargets[ 1 ] );\n\t\t_renderer.setClearColor( 0, 0 );\n\t\t_renderer.clearColor();\n\n\t\t_renderer.setClearColor( ogClearColor, ogClearAlpha );\n\t\t_renderer.setRenderTarget( ogRenderTarget );\n\n\t\tthis.samples = 0;\n\t\tthis._task = null;\n\n\t\tthis.material.stratifiedTexture.stableNoise = this.stableNoise;\n\t\tif ( this.stableNoise ) {\n\n\t\t\tthis.material.seed = 0;\n\t\t\tthis.material.stratifiedTexture.reset();\n\n\t\t}\n\n\t}\n\n\tupdate() {\n\n\t\t// ensure we've updated our defines before rendering so we can ensure we\n\t\t// can wait for compilation to finish\n\t\tthis.material.onBeforeRender();\n\t\tif ( this.isCompiling ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tif ( ! this._task ) {\n\n\t\t\tthis._task = renderTask.call( this );\n\n\t\t}\n\n\t\tthis._task.next();\n\n\t}\n\n}\n","import {\n\tClampToEdgeWrapping,\n\tColor,\n\tDataTexture,\n\tEquirectangularReflectionMapping,\n\tLinearFilter,\n\tRepeatWrapping,\n\tRGBAFormat,\n\tSpherical,\n\tVector2,\n\tFloatType\n} from 'three';\n\nconst _uv = new Vector2();\nconst _coord = new Vector2();\nconst _polar = new Spherical();\nconst _color = new Color();\nexport class ProceduralEquirectTexture extends DataTexture {\n\n\tconstructor( width = 512, height = 512 ) {\n\n\t\tsuper(\n\t\t\tnew Float32Array( width * height * 4 ),\n\t\t\twidth, height, RGBAFormat, FloatType, EquirectangularReflectionMapping,\n\t\t\tRepeatWrapping, ClampToEdgeWrapping, LinearFilter, LinearFilter,\n\t\t);\n\n\t\tthis.generationCallback = null;\n\n\t}\n\n\tupdate() {\n\n\t\tthis.dispose();\n\t\tthis.needsUpdate = true;\n\n\t\tconst { data, width, height } = this.image;\n\t\tfor ( let x = 0; x < width; x ++ ) {\n\n\t\t\tfor ( let y = 0; y < height; y ++ ) {\n\n\t\t\t\t_coord.set( width, height );\n\n\t\t\t\t_uv.set( x / width, y / height );\n\t\t\t\t_uv.x -= 0.5;\n\t\t\t\t_uv.y = 1.0 - _uv.y;\n\n\t\t\t\t_polar.theta = _uv.x * 2.0 * Math.PI;\n\t\t\t\t_polar.phi = _uv.y * Math.PI;\n\t\t\t\t_polar.radius = 1.0;\n\n\t\t\t\tthis.generationCallback( _polar, _uv, _coord, _color );\n\n\t\t\t\tconst i = y * width + x;\n\t\t\t\tconst i4 = 4 * i;\n\t\t\t\tdata[ i4 + 0 ] = ( _color.r );\n\t\t\t\tdata[ i4 + 1 ] = ( _color.g );\n\t\t\t\tdata[ i4 + 2 ] = ( _color.b );\n\t\t\t\tdata[ i4 + 3 ] = ( 1.0 );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tcopy( other ) {\n\n\t\tsuper.copy( other );\n\t\tthis.generationCallback = other.generationCallback;\n\t\treturn this;\n\n\t}\n\n}\n","import { Color, Vector3 } from 'three';\nimport { ProceduralEquirectTexture } from './ProceduralEquirectTexture.js';\n\nconst _direction = new Vector3();\nexport class GradientEquirectTexture extends ProceduralEquirectTexture {\n\n\tconstructor( resolution = 512 ) {\n\n\t\tsuper( resolution, resolution );\n\n\t\tthis.topColor = new Color().set( 0xffffff );\n\t\tthis.bottomColor = new Color().set( 0x000000 );\n\t\tthis.exponent = 2;\n\t\tthis.generationCallback = ( polar, uv, coord, color ) => {\n\n\t\t\t_direction.setFromSpherical( polar );\n\n\t\t\tconst t = _direction.y * 0.5 + 0.5;\n\t\t\tcolor.lerpColors( this.bottomColor, this.topColor, t ** this.exponent );\n\n\t\t};\n\n\t}\n\n\tcopy( other ) {\n\n\t\tsuper.copy( other );\n\n\t\tthis.topColor.copy( other.topColor );\n\t\tthis.bottomColor.copy( other.bottomColor );\n\t\treturn this;\n\n\t}\n\n}\n","import { ShaderMaterial } from 'three';\n\n// Material that tone maps a texture before performing interpolation to prevent\n// unexpected high values during texture stretching interpolation.\n// Emulates browser image stretching\nexport class ClampedInterpolationMaterial extends ShaderMaterial {\n\n\tget map() {\n\n\t\treturn this.uniforms.map.value;\n\n\t}\n\n\tset map( v ) {\n\n\t\tthis.uniforms.map.value = v;\n\n\t}\n\n\tget opacity() {\n\n\t\treturn this.uniforms.opacity.value;\n\n\t}\n\n\tset opacity( v ) {\n\n\t\tif ( this.uniforms ) {\n\n\t\t\tthis.uniforms.opacity.value = v;\n\n\t\t}\n\n\t}\n\n\tconstructor( params ) {\n\n\t\tsuper( {\n\t\t\tuniforms: {\n\n\t\t\t\tmap: { value: null },\n\t\t\t\topacity: { value: 1 },\n\n\t\t\t},\n\n\t\t\tvertexShader: /* glsl */`\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t\t}\n\t\t\t`,\n\n\t\t\tfragmentShader: /* glsl */`\n\t\t\t\tuniform sampler2D map;\n\t\t\t\tuniform float opacity;\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\tvec4 clampedTexelFatch( sampler2D map, ivec2 px, int lod ) {\n\n\t\t\t\t\tvec4 res = texelFetch( map, ivec2( px.x, px.y ), 0 );\n\n\t\t\t\t\t#if defined( TONE_MAPPING )\n\n\t\t\t\t\tres.xyz = toneMapping( res.xyz );\n\n\t\t\t\t\t#endif\n\n\t\t\t  \t\treturn linearToOutputTexel( res );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec2 size = vec2( textureSize( map, 0 ) );\n\t\t\t\t\tvec2 pxUv = vUv * size;\n\t\t\t\t\tvec2 pxCurr = floor( pxUv );\n\t\t\t\t\tvec2 pxFrac = fract( pxUv ) - 0.5;\n\t\t\t\t\tvec2 pxOffset;\n\t\t\t\t\tpxOffset.x = pxFrac.x > 0.0 ? 1.0 : - 1.0;\n\t\t\t\t\tpxOffset.y = pxFrac.y > 0.0 ? 1.0 : - 1.0;\n\n\t\t\t\t\tvec2 pxNext = clamp( pxOffset + pxCurr, vec2( 0.0 ), size - 1.0 );\n\t\t\t\t\tvec2 alpha = abs( pxFrac );\n\n\t\t\t\t\tvec4 p1 = mix(\n\t\t\t\t\t\tclampedTexelFatch( map, ivec2( pxCurr.x, pxCurr.y ), 0 ),\n\t\t\t\t\t\tclampedTexelFatch( map, ivec2( pxNext.x, pxCurr.y ), 0 ),\n\t\t\t\t\t\talpha.x\n\t\t\t\t\t);\n\n\t\t\t\t\tvec4 p2 = mix(\n\t\t\t\t\t\tclampedTexelFatch( map, ivec2( pxCurr.x, pxNext.y ), 0 ),\n\t\t\t\t\t\tclampedTexelFatch( map, ivec2( pxNext.x, pxNext.y ), 0 ),\n\t\t\t\t\t\talpha.x\n\t\t\t\t\t);\n\n\t\t\t\t\tgl_FragColor = mix( p1, p2, alpha.y );\n\t\t\t\t\tgl_FragColor.a *= opacity;\n\t\t\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t\t\t}\n\t\t\t`\n\t\t} );\n\n\t\tthis.setValues( params );\n\n\t}\n\n}\n","import {\n\tDataTexture,\n\tDataUtils,\n\tEquirectangularReflectionMapping,\n\tFloatType,\n\tHalfFloatType,\n\tLinearFilter,\n\tLinearMipMapLinearFilter,\n\tRGBAFormat,\n\tRepeatWrapping,\n\tShaderMaterial,\n\tWebGLRenderTarget,\n} from 'three';\nimport { FullScreenQuad } from 'three/examples/jsm/postprocessing/Pass.js';\nimport * as CommonGLSL from '../shader/common/index.js';\n\nclass CubeToEquirectMaterial extends ShaderMaterial {\n\n\tconstructor() {\n\n\t\tsuper( {\n\n\t\t\tuniforms: {\n\n\t\t\t\tenvMap: { value: null },\n\t\t\t\tflipEnvMap: { value: - 1 },\n\n\t\t\t},\n\n\t\t\tvertexShader: /* glsl */`\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t\t}`,\n\n\t\t\tfragmentShader: /* glsl */`\n\t\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\n\t\t\t\tuniform samplerCube envMap;\n\t\t\t\tuniform float flipEnvMap;\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\t#include <common>\n\t\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\t\t${ CommonGLSL.util_functions }\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 rayDirection = equirectUvToDirection( vUv );\n\t\t\t\t\trayDirection.x *= flipEnvMap;\n\t\t\t\t\tgl_FragColor = textureCube( envMap, rayDirection );\n\n\t\t\t\t}`\n\t\t} );\n\n\t\tthis.depthWrite = false;\n\t\tthis.depthTest = false;\n\n\t}\n\n}\n\nexport class CubeToEquirectGenerator {\n\n\tconstructor( renderer ) {\n\n\t\tthis._renderer = renderer;\n\t\tthis._quad = new FullScreenQuad( new CubeToEquirectMaterial() );\n\n\t}\n\n\tgenerate( source, width = null, height = null ) {\n\n\t\tif ( ! source.isCubeTexture ) {\n\n\t\t\tthrow new Error( 'CubeToEquirectMaterial: Source can only be cube textures.' );\n\n\t\t}\n\n\t\tconst image = source.images[ 0 ];\n\t\tconst renderer = this._renderer;\n\t\tconst quad = this._quad;\n\n\t\t// determine the dimensions if not provided\n\t\tif ( width === null ) {\n\n\t\t\twidth = 4 * image.height;\n\n\t\t}\n\n\t\tif ( height === null ) {\n\n\t\t\theight = 2 * image.height;\n\n\t\t}\n\n\t\tconst target = new WebGLRenderTarget( width, height, {\n\t\t\ttype: FloatType,\n\t\t\tcolorSpace: image.colorSpace,\n\t\t} );\n\n\t\t// prep the cube map data\n\t\tconst imageHeight = image.height;\n\t\tconst maxMip = Math.log2( imageHeight ) - 2;\n\t\tconst texelHeight = 1.0 / imageHeight;\n\t\tconst texelWidth = 1.0 / ( 3 * Math.max( Math.pow( 2, maxMip ), 7 * 16 ) );\n\n\t\tquad.material.defines.CUBEUV_MAX_MIP = `${ maxMip }.0`;\n\t\tquad.material.defines.CUBEUV_TEXEL_WIDTH = texelWidth;\n\t\tquad.material.defines.CUBEUV_TEXEL_HEIGHT = texelHeight;\n\t\tquad.material.uniforms.envMap.value = source;\n\t\tquad.material.uniforms.flipEnvMap.value = source.isRenderTargetTexture ? 1 : - 1;\n\t\tquad.material.needsUpdate = true;\n\n\t\t// save state and render the contents\n\t\tconst currentTarget = renderer.getRenderTarget();\n\t\tconst currentAutoClear = renderer.autoClear;\n\t\trenderer.autoClear = true;\n\t\trenderer.setRenderTarget( target );\n\t\tquad.render( renderer );\n\t\trenderer.setRenderTarget( currentTarget );\n\t\trenderer.autoClear = currentAutoClear;\n\n\t\t// read the data back\n\t\tconst buffer = new Uint16Array( width * height * 4 );\n\t\tconst readBuffer = new Float32Array( width * height * 4 );\n\t\trenderer.readRenderTargetPixels( target, 0, 0, width, height, readBuffer );\n\t\ttarget.dispose();\n\n\t\tfor ( let i = 0, l = readBuffer.length; i < l; i ++ ) {\n\n\t\t\tbuffer[ i ] = DataUtils.toHalfFloat( readBuffer[ i ] );\n\n\t\t}\n\n\t\t// produce the data texture\n\t\tconst result = new DataTexture( buffer, width, height, RGBAFormat, HalfFloatType );\n\t\tresult.minFilter = LinearMipMapLinearFilter;\n\t\tresult.magFilter = LinearFilter;\n\t\tresult.wrapS = RepeatWrapping;\n\t\tresult.wrapT = RepeatWrapping;\n\t\tresult.mapping = EquirectangularReflectionMapping;\n\t\tresult.needsUpdate = true;\n\n\t\treturn result;\n\n\t}\n\n\tdispose() {\n\n\t\tthis._quad.dispose();\n\n\t}\n\n}\n","import { PerspectiveCamera, Scene, Vector2, Clock, NormalBlending, NoBlending, AdditiveBlending } from 'three';\nimport { PathTracingSceneGenerator } from './PathTracingSceneGenerator.js';\nimport { PathTracingRenderer } from './PathTracingRenderer.js';\nimport { FullScreenQuad } from 'three/examples/jsm/postprocessing/Pass.js';\nimport { GradientEquirectTexture } from '../textures/GradientEquirectTexture.js';\nimport { getIesTextures, getLights, getTextures } from './utils/sceneUpdateUtils.js';\nimport { ClampedInterpolationMaterial } from '../materials/fullscreen/ClampedInterpolationMaterial.js';\nimport { CubeToEquirectGenerator } from '../utils/CubeToEquirectGenerator.js';\n\nfunction supportsFloatBlending( renderer ) {\n\n\treturn renderer.extensions.get( 'EXT_float_blend' );\n\n}\n\nconst _resolution = new Vector2();\nexport class WebGLPathTracer {\n\n\tget multipleImportanceSampling() {\n\n\t\treturn Boolean( this._pathTracer.material.defines.FEATURE_MIS );\n\n\t}\n\n\tset multipleImportanceSampling( v ) {\n\n\t\tthis._pathTracer.material.setDefine( 'FEATURE_MIS', v ? 1 : 0 );\n\n\t}\n\n\tget transmissiveBounces() {\n\n\t\treturn this._pathTracer.material.transmissiveBounces;\n\n\t}\n\n\tset transmissiveBounces( v ) {\n\n\t\tthis._pathTracer.material.transmissiveBounces = v;\n\n\t}\n\n\tget bounces() {\n\n\t\treturn this._pathTracer.material.bounces;\n\n\t}\n\n\tset bounces( v ) {\n\n\t\tthis._pathTracer.material.bounces = v;\n\n\t}\n\n\tget filterGlossyFactor() {\n\n\t\treturn this._pathTracer.material.filterGlossyFactor;\n\n\t}\n\n\tset filterGlossyFactor( v ) {\n\n\t\tthis._pathTracer.material.filterGlossyFactor = v;\n\n\t}\n\n\tget samples() {\n\n\t\treturn this._pathTracer.samples;\n\n\t}\n\n\tget target() {\n\n\t\treturn this._pathTracer.target;\n\n\t}\n\n\tget tiles() {\n\n\t\treturn this._pathTracer.tiles;\n\n\t}\n\n\tget stableNoise() {\n\n\t\treturn this._pathTracer.stableNoise;\n\n\t}\n\n\tset stableNoise( v ) {\n\n\t\tthis._pathTracer.stableNoise = v;\n\n\t}\n\n\tget isCompiling() {\n\n\t\treturn Boolean( this._pathTracer.isCompiling );\n\n\t}\n\n\tconstructor( renderer ) {\n\n\t\t// members\n\t\tthis._renderer = renderer;\n\t\tthis._generator = new PathTracingSceneGenerator();\n\t\tthis._pathTracer = new PathTracingRenderer( renderer );\n\t\tthis._queueReset = false;\n\t\tthis._clock = new Clock();\n\t\tthis._compilePromise = null;\n\n\t\tthis._lowResPathTracer = new PathTracingRenderer( renderer );\n\t\tthis._lowResPathTracer.tiles.set( 1, 1 );\n\t\tthis._quad = new FullScreenQuad( new ClampedInterpolationMaterial( {\n\t\t\tmap: null,\n\t\t\ttransparent: true,\n\t\t\tblending: NoBlending,\n\n\t\t\tpremultipliedAlpha: renderer.getContextAttributes().premultipliedAlpha,\n\t\t} ) );\n\t\tthis._materials = null;\n\n\t\tthis._previousEnvironment = null;\n\t\tthis._previousBackground = null;\n\t\tthis._internalBackground = null;\n\n\t\t// options\n\t\tthis.renderDelay = 100;\n\t\tthis.minSamples = 5;\n\t\tthis.fadeDuration = 500;\n\t\tthis.enablePathTracing = true;\n\t\tthis.pausePathTracing = false;\n\t\tthis.dynamicLowRes = false;\n\t\tthis.lowResScale = 0.25;\n\t\tthis.renderScale = 1;\n\t\tthis.synchronizeRenderSize = true;\n\t\tthis.rasterizeScene = true;\n\t\tthis.renderToCanvas = true;\n\t\tthis.textureSize = new Vector2( 1024, 1024 );\n\t\tthis.rasterizeSceneCallback = ( scene, camera ) => {\n\n\t\t\tthis._renderer.render( scene, camera );\n\n\t\t};\n\n\t\tthis.renderToCanvasCallback = ( target, renderer, quad ) => {\n\n\t\t\tconst currentAutoClear = renderer.autoClear;\n\t\t\trenderer.autoClear = false;\n\t\t\tquad.render( renderer );\n\t\t\trenderer.autoClear = currentAutoClear;\n\n\t\t};\n\n\t\t// initialize the scene so it doesn't fail\n\t\tthis.setScene( new Scene(), new PerspectiveCamera() );\n\n\t}\n\n\tsetBVHWorker( worker ) {\n\n\t\tthis._generator.setBVHWorker( worker );\n\n\t}\n\n\tsetScene( scene, camera, options = {} ) {\n\n\t\tscene.updateMatrixWorld( true );\n\t\tcamera.updateMatrixWorld();\n\n\t\tconst generator = this._generator;\n\t\tgenerator.setObjects( scene );\n\n\t\tif ( this._buildAsync ) {\n\n\t\t\treturn generator.generateAsync( options.onProgress ).then( result => {\n\n\t\t\t\treturn this._updateFromResults( scene, camera, result );\n\n\t\t\t} );\n\n\t\t} else {\n\n\t\t\tconst result = generator.generate();\n\t\t\treturn this._updateFromResults( scene, camera, result );\n\n\t\t}\n\n\t}\n\n\tsetSceneAsync( ...args ) {\n\n\t\tthis._buildAsync = true;\n\t\tconst result = this.setScene( ...args );\n\t\tthis._buildAsync = false;\n\n\t\treturn result;\n\n\t}\n\n\tsetCamera( camera ) {\n\n\t\tthis.camera = camera;\n\t\tthis.updateCamera();\n\n\t}\n\n\tupdateCamera() {\n\n\t\tconst camera = this.camera;\n\t\tcamera.updateMatrixWorld();\n\n\t\tthis._pathTracer.setCamera( camera );\n\t\tthis._lowResPathTracer.setCamera( camera );\n\t\tthis.reset();\n\n\t}\n\n\tupdateMaterials() {\n\n\t\tconst material = this._pathTracer.material;\n\t\tconst renderer = this._renderer;\n\t\tconst materials = this._materials;\n\t\tconst textureSize = this.textureSize;\n\n\t\t// reduce texture sources here - we don't want to do this in the\n\t\t// textures array because we need to pass the textures array into the\n\t\t// material target\n\t\tconst textures = getTextures( materials );\n\t\tmaterial.textures.setTextures( renderer, textures, textureSize.x, textureSize.y );\n\t\tmaterial.materials.updateFrom( materials, textures );\n\t\tthis.reset();\n\n\t}\n\n\tupdateLights() {\n\n\t\tconst scene = this.scene;\n\t\tconst renderer = this._renderer;\n\t\tconst material = this._pathTracer.material;\n\n\t\tconst lights = getLights( scene );\n\t\tconst iesTextures = getIesTextures( lights );\n\t\tmaterial.lights.updateFrom( lights, iesTextures );\n\t\tmaterial.iesProfiles.setTextures( renderer, iesTextures );\n\t\tthis.reset();\n\n\t}\n\n\tupdateEnvironment() {\n\n\t\tconst scene = this.scene;\n\t\tconst material = this._pathTracer.material;\n\n\t\tif ( this._internalBackground ) {\n\n\t\t\tthis._internalBackground.dispose();\n\t\t\tthis._internalBackground = null;\n\n\t\t}\n\n\t\t// update scene background\n\t\tmaterial.backgroundBlur = scene.backgroundBlurriness;\n\t\tmaterial.backgroundIntensity = scene.backgroundIntensity ?? 1;\n\t\tmaterial.backgroundRotation.makeRotationFromEuler( scene.backgroundRotation ).invert();\n\t\tif ( scene.background === null ) {\n\n\t\t\tmaterial.backgroundMap = null;\n\t\t\tmaterial.backgroundAlpha = 0;\n\n\t\t} else if ( scene.background.isColor ) {\n\n\t\t\tthis._colorBackground = this._colorBackground || new GradientEquirectTexture( 16 );\n\n\t\t\tconst colorBackground = this._colorBackground;\n\t\t\tif ( ! colorBackground.topColor.equals( scene.background ) ) {\n\n\t\t\t\t// set the texture color\n\t\t\t\tcolorBackground.topColor.set( scene.background );\n\t\t\t\tcolorBackground.bottomColor.set( scene.background );\n\t\t\t\tcolorBackground.update();\n\n\t\t\t}\n\n\t\t\t// assign to material\n\t\t\tmaterial.backgroundMap = colorBackground;\n\t\t\tmaterial.backgroundAlpha = 1;\n\n\t\t} else if ( scene.background.isCubeTexture ) {\n\n\t\t\tif ( scene.background !== this._previousBackground ) {\n\n\t\t\t\tconst background = new CubeToEquirectGenerator( this._renderer ).generate( scene.background );\n\t\t\t\tthis._internalBackground = background;\n\t\t\t\tmaterial.backgroundMap = background;\n\t\t\t\tmaterial.backgroundAlpha = 1;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tmaterial.backgroundMap = scene.background;\n\t\t\tmaterial.backgroundAlpha = 1;\n\n\t\t}\n\n\t\t// update scene environment\n\t\tmaterial.environmentIntensity = scene.environment !== null ? ( scene.environmentIntensity ?? 1 ) : 0;\n\t\tmaterial.environmentRotation.makeRotationFromEuler( scene.environmentRotation ).invert();\n\t\tif ( this._previousEnvironment !== scene.environment ) {\n\n\t\t\tif ( scene.environment !== null ) {\n\n\t\t\t\tif ( scene.environment.isCubeTexture ) {\n\n\t\t\t\t\tconst environment = new CubeToEquirectGenerator( this._renderer ).generate( scene.environment );\n\t\t\t\t\tmaterial.envMapInfo.updateFrom( environment );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// TODO: Consider setting this to the highest supported bit depth by checking for\n\t\t\t\t\t// OES_texture_float_linear or OES_texture_half_float_linear. Requires changes to\n\t\t\t\t\t// the equirect uniform\n\t\t\t\t\tmaterial.envMapInfo.updateFrom( scene.environment );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis._previousEnvironment = scene.environment;\n\t\tthis._previousBackground = scene.background;\n\t\tthis.reset();\n\n\t}\n\n\t_updateFromResults( scene, camera, results ) {\n\n\t\tconst {\n\t\t\tmaterials,\n\t\t\tgeometry,\n\t\t\tbvh,\n\t\t\tbvhChanged,\n\t\t\tneedsMaterialIndexUpdate,\n\t\t} = results;\n\n\t\tthis._materials = materials;\n\n\t\tconst pathTracer = this._pathTracer;\n\t\tconst material = pathTracer.material;\n\n\t\tif ( bvhChanged ) {\n\n\t\t\tmaterial.bvh.updateFrom( bvh );\n\t\t\tmaterial.attributesArray.updateFrom(\n\t\t\t\tgeometry.attributes.normal,\n\t\t\t\tgeometry.attributes.tangent,\n\t\t\t\tgeometry.attributes.uv,\n\t\t\t\tgeometry.attributes.color,\n\t\t\t);\n\n\t\t}\n\n\t\tif ( needsMaterialIndexUpdate ) {\n\n\t\t\tmaterial.materialIndexAttribute.updateFrom( geometry.attributes.materialIndex );\n\n\t\t}\n\n\t\t// save previously used items\n\t\tthis._previousScene = scene;\n\t\tthis.scene = scene;\n\t\tthis.camera = camera;\n\n\t\tthis.updateCamera();\n\t\tthis.updateMaterials();\n\t\tthis.updateEnvironment();\n\t\tthis.updateLights();\n\n\t\treturn results;\n\n\t}\n\n\trenderSample() {\n\n\t\tconst lowResPathTracer = this._lowResPathTracer;\n\t\tconst pathTracer = this._pathTracer;\n\t\tconst renderer = this._renderer;\n\t\tconst clock = this._clock;\n\t\tconst quad = this._quad;\n\n\t\tthis._updateScale();\n\n\t\tif ( this._queueReset ) {\n\n\t\t\tpathTracer.reset();\n\t\t\tlowResPathTracer.reset();\n\t\t\tthis._queueReset = false;\n\n\t\t\tquad.material.opacity = 0;\n\t\t\tclock.start();\n\n\t\t}\n\n\t\t// render the path tracing sample after enough time has passed\n\t\tconst delta = clock.getDelta() * 1e3;\n\t\tconst elapsedTime = clock.getElapsedTime() * 1e3;\n\t\tif ( ! this.pausePathTracing && this.enablePathTracing && this.renderDelay <= elapsedTime && ! this.isCompiling ) {\n\n\t\t\tpathTracer.update();\n\n\t\t}\n\n\t\t// when alpha is enabled we use a manual blending system rather than\n\t\t// rendering with a blend function\n\t\tpathTracer.alpha = pathTracer.material.backgroundAlpha !== 1 || ! supportsFloatBlending( renderer );\n\t\tlowResPathTracer.alpha = pathTracer.alpha;\n\n\t\tif ( this.renderToCanvas ) {\n\n\t\t\tconst renderer = this._renderer;\n\t\t\tconst minSamples = this.minSamples;\n\n\t\t\tif ( elapsedTime >= this.renderDelay && this.samples >= this.minSamples ) {\n\n\t\t\t\tif ( this.fadeDuration !== 0 ) {\n\n\t\t\t\t\tquad.material.opacity = Math.min( quad.material.opacity + delta / this.fadeDuration, 1 );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tquad.material.opacity = 1;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// render the fallback if we haven't rendered enough samples, are paused, or are occluded\n\t\t\tif ( ! this.enablePathTracing || this.samples < minSamples || quad.material.opacity < 1 ) {\n\n\t\t\t\tif ( this.dynamicLowRes && ! this.isCompiling ) {\n\n\t\t\t\t\tif ( lowResPathTracer.samples < 1 ) {\n\n\t\t\t\t\t\tlowResPathTracer.material = pathTracer.material;\n\t\t\t\t\t\tlowResPathTracer.update();\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst currentOpacity = quad.material.opacity;\n\t\t\t\t\tquad.material.opacity = 1 - quad.material.opacity;\n\t\t\t\t\tquad.material.map = lowResPathTracer.target.texture;\n\t\t\t\t\tquad.render( renderer );\n\t\t\t\t\tquad.material.opacity = currentOpacity;\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! this.dynamicLowRes && this.rasterizeScene || this.dynamicLowRes && this.isCompiling ) {\n\n\t\t\t\t\tthis.rasterizeSceneCallback( this.scene, this.camera );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\n\t\t\tif ( this.enablePathTracing && quad.material.opacity > 0 ) {\n\n\t\t\t\tif ( quad.material.opacity < 1 ) {\n\n\t\t\t\t\t// use additive blending when the low res texture is rendered so we can fade the\n\t\t\t\t\t// background out while the full res fades in\n\t\t\t\t\tquad.material.blending = this.dynamicLowRes ? AdditiveBlending : NormalBlending;\n\n\t\t\t\t}\n\n\t\t\t\tquad.material.map = pathTracer.target.texture;\n\t\t\t\tthis.renderToCanvasCallback( pathTracer.target, renderer, quad );\n\t\t\t\tquad.material.blending = NoBlending;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treset() {\n\n\t\tthis._queueReset = true;\n\t\tthis._pathTracer.samples = 0;\n\n\t}\n\n\tdispose() {\n\n\t\tthis._quad.dispose();\n\t\tthis._quad.material.dispose();\n\t\tthis._pathTracer.dispose();\n\n\t}\n\n\t_updateScale() {\n\n\t\t// update the path tracer scale if it has changed\n\t\tif ( this.synchronizeRenderSize ) {\n\n\t\t\tthis._renderer.getDrawingBufferSize( _resolution );\n\n\t\t\tconst w = Math.floor( this.renderScale * _resolution.x );\n\t\t\tconst h = Math.floor( this.renderScale * _resolution.y );\n\n\t\t\tthis._pathTracer.getSize( _resolution );\n\t\t\tif ( _resolution.x !== w || _resolution.y !== h ) {\n\n\t\t\t\tconst lowResScale = this.lowResScale;\n\t\t\t\tthis._pathTracer.setSize( w, h );\n\t\t\t\tthis._lowResPathTracer.setSize( Math.floor( w * lowResScale ), Math.floor( h * lowResScale ) );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n","import { Camera } from 'three';\n\nexport class EquirectCamera extends Camera {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.isEquirectCamera = true;\n\n\t}\n\n}\n","import { SpotLight } from 'three';\n\nexport class PhysicalSpotLight extends SpotLight {\n\n\tconstructor( ...args ) {\n\n\t\tsuper( ...args );\n\n\t\tthis.iesMap = null;\n\t\tthis.radius = 0;\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.iesMap = source.iesMap;\n\t\tthis.radius = source.radius;\n\n\t\treturn this;\n\n\t}\n\n}\n","import { RectAreaLight } from 'three';\n\nexport class ShapedAreaLight extends RectAreaLight {\n\n\tconstructor( ...args ) {\n\n\t\tsuper( ...args );\n\t\tthis.isCircular = false;\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.isCircular = source.isCircular;\n\n\t\treturn this;\n\n\t}\n\n}\n","import { WebGLRenderTarget, RGBAFormat, HalfFloatType, PMREMGenerator, DataTexture, EquirectangularReflectionMapping, FloatType, DataUtils } from 'three';\nimport { FullScreenQuad } from 'three/examples/jsm/postprocessing/Pass.js';\nimport { MaterialBase } from '../materials/MaterialBase.js';\nimport * as CommonGLSL from '../shader/common/index.js';\n\nclass PMREMCopyMaterial extends MaterialBase {\n\n\tconstructor() {\n\n\t\tsuper( {\n\n\t\t\tuniforms: {\n\n\t\t\t\tenvMap: { value: null },\n\t\t\t\tblur: { value: 0 },\n\n\t\t\t},\n\n\t\t\tvertexShader: /* glsl */`\n\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}\n\n\t\t\t`,\n\n\t\t\tfragmentShader: /* glsl */`\n\n\t\t\t\t#include <common>\n\t\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\t\t${ CommonGLSL.util_functions }\n\n\t\t\t\tuniform sampler2D envMap;\n\t\t\t\tuniform float blur;\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 rayDirection = equirectUvToDirection( vUv );\n\t\t\t\t\tgl_FragColor = textureCubeUV( envMap, rayDirection, blur );\n\n\t\t\t\t}\n\n\t\t\t`,\n\n\t\t} );\n\n\t}\n\n}\n\nexport class BlurredEnvMapGenerator {\n\n\tconstructor( renderer ) {\n\n\t\tthis.renderer = renderer;\n\t\tthis.pmremGenerator = new PMREMGenerator( renderer );\n\t\tthis.copyQuad = new FullScreenQuad( new PMREMCopyMaterial() );\n\t\tthis.renderTarget = new WebGLRenderTarget( 1, 1, { type: FloatType, format: RGBAFormat } );\n\n\t}\n\n\tdispose() {\n\n\t\tthis.pmremGenerator.dispose();\n\t\tthis.copyQuad.dispose();\n\t\tthis.renderTarget.dispose();\n\n\t}\n\n\tgenerate( texture, blur ) {\n\n\t\tconst { pmremGenerator, renderTarget, copyQuad, renderer } = this;\n\n\t\t// get the pmrem target\n\t\tconst pmremTarget = pmremGenerator.fromEquirectangular( texture );\n\n\t\t// set up the material\n\t\tconst { width, height } = texture.image;\n\t\trenderTarget.setSize( width, height );\n\t\tcopyQuad.material.envMap = pmremTarget.texture;\n\t\tcopyQuad.material.blur = blur;\n\n\t\t// render\n\t\tconst prevRenderTarget = renderer.getRenderTarget();\n\t\tconst prevClear = renderer.autoClear;\n\n\t\trenderer.setRenderTarget( renderTarget );\n\t\trenderer.autoClear = true;\n\t\tcopyQuad.render( renderer );\n\n\t\trenderer.setRenderTarget( prevRenderTarget );\n\t\trenderer.autoClear = prevClear;\n\n\t\t// read the data back\n\t\tconst buffer = new Uint16Array( width * height * 4 );\n\t\tconst readBuffer = new Float32Array( width * height * 4 );\n\t\trenderer.readRenderTargetPixels( renderTarget, 0, 0, width, height, readBuffer );\n\n\t\tfor ( let i = 0, l = readBuffer.length; i < l; i ++ ) {\n\n\t\t\tbuffer[ i ] = DataUtils.toHalfFloat( readBuffer[ i ] );\n\n\t\t}\n\n\t\tconst result = new DataTexture( buffer, width, height, RGBAFormat, HalfFloatType );\n\t\tresult.minFilter = texture.minFilter;\n\t\tresult.magFilter = texture.magFilter;\n\t\tresult.wrapS = texture.wrapS;\n\t\tresult.wrapT = texture.wrapT;\n\t\tresult.mapping = EquirectangularReflectionMapping;\n\t\tresult.needsUpdate = true;\n\n\t\t// dispose of the now unneeded target\n\t\tpmremTarget.dispose();\n\n\t\treturn result;\n\n\t}\n\n}\n","import { NoBlending } from 'three';\nimport { MaterialBase } from '../MaterialBase.js';\n\nexport class DenoiseMaterial extends MaterialBase {\n\n\tconstructor( parameters ) {\n\n\t\tsuper( {\n\n\t\t\tblending: NoBlending,\n\n\t\t\ttransparent: false,\n\n\t\t\tdepthWrite: false,\n\n\t\t\tdepthTest: false,\n\n\t\t\tdefines: {\n\n\t\t\t\tUSE_SLIDER: 0,\n\n\t\t\t},\n\n\t\t\tuniforms: {\n\n\t\t\t\tsigma: { value: 5.0 },\n\t\t\t\tthreshold: { value: 0.03 },\n\t\t\t\tkSigma: { value: 1.0 },\n\n\t\t\t\tmap: { value: null },\n\t\t\t\topacity: { value: 1 },\n\n\t\t\t},\n\n\t\t\tvertexShader: /* glsl */`\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t\t}\n\n\t\t\t`,\n\n\t\t\tfragmentShader: /* glsl */`\n\n\t\t\t\t//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\t\t\t\t//  Copyright (c) 2018-2019 Michele Morrone\n\t\t\t\t//  All rights reserved.\n\t\t\t\t//\n\t\t\t\t//  https://michelemorrone.eu - https://BrutPitt.com\n\t\t\t\t//\n\t\t\t\t//  me@michelemorrone.eu - brutpitt@gmail.com\n\t\t\t\t//  twitter: @BrutPitt - github: BrutPitt\n\t\t\t\t//\n\t\t\t\t//  https://github.com/BrutPitt/glslSmartDeNoise/\n\t\t\t\t//\n\t\t\t\t//  This software is distributed under the terms of the BSD 2-Clause license\n\t\t\t\t//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\t\t\t\tuniform sampler2D map;\n\n\t\t\t\tuniform float sigma;\n\t\t\t\tuniform float threshold;\n\t\t\t\tuniform float kSigma;\n\t\t\t\tuniform float opacity;\n\n\t\t\t\tvarying vec2 vUv;\n\n\t\t\t\t#define INV_SQRT_OF_2PI 0.39894228040143267793994605993439\n\t\t\t\t#define INV_PI 0.31830988618379067153776752674503\n\n\t\t\t\t// Parameters:\n\t\t\t\t//\t sampler2D tex\t - sampler image / texture\n\t\t\t\t//\t vec2 uv\t\t   - actual fragment coord\n\t\t\t\t//\t float sigma  >  0 - sigma Standard Deviation\n\t\t\t\t//\t float kSigma >= 0 - sigma coefficient\n\t\t\t\t//\t\t kSigma * sigma  -->  radius of the circular kernel\n\t\t\t\t//\t float threshold   - edge sharpening threshold\n\t\t\t\tvec4 smartDeNoise( sampler2D tex, vec2 uv, float sigma, float kSigma, float threshold ) {\n\n\t\t\t\t\tfloat radius = round( kSigma * sigma );\n\t\t\t\t\tfloat radQ = radius * radius;\n\n\t\t\t\t\tfloat invSigmaQx2 = 0.5 / ( sigma * sigma );\n\t\t\t\t\tfloat invSigmaQx2PI = INV_PI * invSigmaQx2;\n\n\t\t\t\t\tfloat invThresholdSqx2 = 0.5 / ( threshold * threshold );\n\t\t\t\t\tfloat invThresholdSqrt2PI = INV_SQRT_OF_2PI / threshold;\n\n\t\t\t\t\tvec4 centrPx = texture2D( tex, uv );\n\t\t\t\t\tcentrPx.rgb *= centrPx.a;\n\n\t\t\t\t\tfloat zBuff = 0.0;\n\t\t\t\t\tvec4 aBuff = vec4( 0.0 );\n\t\t\t\t\tvec2 size = vec2( textureSize( tex, 0 ) );\n\n\t\t\t\t\tvec2 d;\n\t\t\t\t\tfor ( d.x = - radius; d.x <= radius; d.x ++ ) {\n\n\t\t\t\t\t\tfloat pt = sqrt( radQ - d.x * d.x );\n\n\t\t\t\t\t\tfor ( d.y = - pt; d.y <= pt; d.y ++ ) {\n\n\t\t\t\t\t\t\tfloat blurFactor = exp( - dot( d, d ) * invSigmaQx2 ) * invSigmaQx2PI;\n\n\t\t\t\t\t\t\tvec4 walkPx = texture2D( tex, uv + d / size );\n\t\t\t\t\t\t\twalkPx.rgb *= walkPx.a;\n\n\t\t\t\t\t\t\tvec4 dC = walkPx - centrPx;\n\t\t\t\t\t\t\tfloat deltaFactor = exp( - dot( dC.rgba, dC.rgba ) * invThresholdSqx2 ) * invThresholdSqrt2PI * blurFactor;\n\n\t\t\t\t\t\t\tzBuff += deltaFactor;\n\t\t\t\t\t\t\taBuff += deltaFactor * walkPx;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn aBuff / zBuff;\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tgl_FragColor = smartDeNoise( map, vec2( vUv.x, vUv.y ), sigma, kSigma, threshold );\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t#include <colorspace_fragment>\n\t\t\t\t\t#include <premultiplied_alpha_fragment>\n\n\t\t\t\t\tgl_FragColor.a *= opacity;\n\n\t\t\t\t}\n\n\t\t\t`\n\n\t\t} );\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n}\n","import { Color, MeshStandardMaterial } from 'three';\n\nexport class FogVolumeMaterial extends MeshStandardMaterial {\n\n\tconstructor( params ) {\n\n\t\tsuper( params );\n\n\t\tthis.isFogVolumeMaterial = true;\n\n\t\tthis.density = 0.015;\n\t\tthis.emissive = new Color();\n\t\tthis.emissiveIntensity = 0.0;\n\t\tthis.opacity = 0.15;\n\t\tthis.transparent = true;\n\t\tthis.roughness = 1.0;\n\t\tthis.metalness = 0.0;\n\n\t\tthis.setValues( params );\n\n\t}\n\n}\n","// core\nexport * from './core/PathTracingSceneGenerator.js';\nexport * from './core/WebGLPathTracer.js';\n\n// objects\nexport * from './objects/PhysicalCamera.js';\nexport * from './objects/EquirectCamera.js';\nexport * from './objects/PhysicalSpotLight.js';\nexport * from './objects/ShapedAreaLight.js';\n\n// textures\nexport * from './textures/ProceduralEquirectTexture.js';\nexport * from './textures/GradientEquirectTexture.js';\n\n// utils\nexport * from './utils/BlurredEnvMapGenerator.js';\n\n// materials\nexport * from './materials/fullscreen/DenoiseMaterial.js';\nexport * from './materials/surface/FogVolumeMaterial.js';\n\n// deprecated\nexport * from './materials/pathtracing/PhysicalPathTracingMaterial.js';\nexport * from './core/PathTracingRenderer.js';\n"],"names":["BufferAttribute","BufferGeometry","Matrix4","Vector3","Vector4","Matrix3","MeshBasicMaterial","Mesh","getTextures","getLights","SAH","MeshBVH","ShaderMaterial","NoBlending","Vector2","WebGLRenderTarget","FloatType","RGBAFormat","NearestFilter","FullScreenQuad","PerspectiveCamera","DataUtils","HalfFloatType","Source","DataTexture","LinearFilter","RepeatWrapping","RedFormat","ClampToEdgeWrapping","Quaternion","DataArrayTexture","FloatVertexAttributeTexture","getTextureHash","FrontSide","BackSide","DoubleSide","Color","WebGLArrayRenderTarget","UnsignedByteType","NoToneMapping","RGFormat","MeshBVHUniformStruct","UIntVertexAttributeTexture","BVHShaderGLSL","StructsGLSL.camera_struct","StructsGLSL.lights_struct","StructsGLSL.equirect_struct","StructsGLSL.material_struct","StructsGLSL.surface_record_struct","RandomGLSL.stratified_functions","RandomGLSL.pcg_functions","RandomGLSL.sobol_common","RandomGLSL.sobol_functions","CommonGLSL.texture_sample_functions","CommonGLSL.fresnel_functions","CommonGLSL.util_functions","CommonGLSL.math_functions","CommonGLSL.shape_intersection_functions","SamplingGLSL.shape_sampling_functions","SamplingGLSL.equirect_functions","SamplingGLSL.light_sampling_functions","PTBVHGLSL.inside_fog_volume_function","BSDFGLSL.ggx_functions","BSDFGLSL.sheen_functions","BSDFGLSL.iridescence_functions","BSDFGLSL.fog_functions","BSDFGLSL.bsdf_functions","RenderGLSL.render_structs","RenderGLSL.camera_util_functions","RenderGLSL.trace_scene_function","RenderGLSL.attenuate_hit_function","RenderGLSL.direct_light_contribution_function","RenderGLSL.get_surface_record_function","NormalBlending","Spherical","EquirectangularReflectionMapping","LinearMipMapLinearFilter","Clock","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Aa,EAAE;AAChE;AACA;AACA,yBAAyB,GAAG,KAAK,EAAE;AACnC;AACA;AACA,CAAC,CAAC,CAAC;AACH;CACA,CAAC;AACD;CACO,MAAM,YAAY,aAAa,CAAC;AACvC;AACA;AACA;AACA;AACA;AACA,CAAC,GAAG,6BAA6B,EAAE,CAAC,EAAE,EAAE;AACxC,CAAC,GAAG,6BAA6B,EAAE,CAAC,EAAE,EAAE;AACxC,CAAC,GAAG,6BAA6B,EAAE,CAAC,EAAE,EAAE;AACxC,CAAC,GAAG,6BAA6B,EAAE,CAAC,EAAE,EAAE;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC;AACF;CACO,MAAM,sBAAsB,aAAa,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,CAAC;AACF;CACO,MAAM,eAAe,aAAa,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,GAAG,4BAA4B,EAAE,CAAC,EAAE,EAAE;AACvC,CAAC,GAAG,4BAA4B,EAAE,CAAC,EAAE,EAAE;AACvC,CAAC,GAAG,4BAA4B,EAAE,CAAC,EAAE,EAAE;A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AAE,CAAC;CACvC,GAAG,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC;CAC3B,GAAG,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AACpC;CACA,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG;AACpD;CACA,IAAI,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,EAAE,GAAG,QAAQ,CAAC;CACtC,IAAI,IAAI,EAAE,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC;AACnC;CACA,IAAI;AACJ;CACA,GAAG;AACH;CACA,EAAE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;AAC1B;CACA,EAAE;AACF;CACA;;CCtFO,MAAM,aAAa,aAAa,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCZM,MAAM,eAAe,aAAa,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCZM,MAAM,aAAa,aAAa,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCtFM,MAAM,eAAe,cAAc,CAAC;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCjNM,MAAM,qBAAqB,aAAa,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CC9DM,MAAM,kBAAkB,aAAa,CAAC;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCnEM,MAAM,wBAAwB,aAAa,CAAC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCvNM,MAAM,wBAAwB,aAAa,CAAC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCrFM,MAAM,iBAAiB,aAAa,CAAC;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCvGM,MAAM,cAAc,aAAa,CAAC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CChFM,MAAM,4BAA4B,aAAa,CAAC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CC5DM,MAAM,wBAAwB,YAAY,CAAC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCxBM,MAAM,cAAc,aAAa,CAAC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCnHM,MAAM,aAAa,aAAa,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCxDM,MAAM,oBAAoB,aAAa,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCjDD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACA;CACO,MAAM,cAAc,aAAa,CAAC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCjcM,MAAM,aAAa,aAAa,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCrBM,MAAM,aAAa,aAAa,CAAC;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCrGM,MAAM,qBAAqB,aAAa,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCtIM,MAAM,eAAe,aAAa,CAAC;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCjGM,MAAM,0BAA0B,aAAa,CAAC;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CC7DM,MAAM,oBAAoB,aAAa,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CC3EM,MAAM,sBAAsB,aAAa,CAAC;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CClLM,MAAM,qBAAqB,aAAa,CAAC;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCnFM,MAAM,kCAAkC,WAAW,CAAC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CC/FM,MAAM,2BAA2B,aAAa,CAAC;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCpUM,MAAM,cAAc,aAAa,CAAC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCjDM,MAAM,oBAAoB,aAAa,CAAC;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;CCnBM,MAAM,2BAA2B,SAAS,YAAY,CAAC;AAC9D;CACA,CAAC,cAAc,GAAG;AAClB;CACA,EAAE,IAAI,CAAC,SAAS,EAAE,aAAa,EAAE,IAAI,CAAC,cAAc,CA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,GAAGF,aAAwB,EAAE;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,GAAGG,wBAAmC,EAAE;AAC5C,IAAI,GAAGC,iBAA4B,EAAE;AACrC,IAAI,GAAGC,cAAyB,EAAE;AAClC,IAAI,GAAGC,cAAyB,EAAE;AAClC,IAAI,GAAGC,4BAAuC,EAAE;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,GAAGC,wBAAqC,EAAE;AAC9C,IAAI,GAAGC,kBAA+B,EAAE;AACxC,IAAI,GAAGC,wBAAqC,EAAE;AAC9C;AACA,IAAI,GAAGC,0BAAoC,EAAE;AAC7C,IAAI,GAAGC,aAAsB,EAAE;AAC/B,IAAI,GAAGC,eAAwB,EAAE;AACjC,IAAI,GAAGC,qBAA8B,EAAE;AACvC,IAAI,GAAGC,aAAsB,EAAE;AAC/B,IAAI,GAAGC,cAAuB,EAAE;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,GAAGC,cAAyB,EAAE;AAClC,IAAI,GAAGC,qBAAgC,EAAE;AACzC,IAAI,GAAGC,oBAA+B,EAAE;AACxC,IAAI,GAAGC,sBAAiC,EAAE;AAC1C,IAAI,GAAGC,kCAA6C,EAAE;AACtD,IAAI,GAAGC,2BAAsC,EAAE;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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EAAE,MAAM,GAAG;AACvB;CACA,EAAE,KAAK,EAAE;CACT,GAAG,QAAQ,EAAE;AACb;CACA,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;CACxB,IAAI,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;AACzB;CACA,IAAI;AACJ;CACA,GAAG,YAAY,YAAY,CAAC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ;CACA,GAAG,cAAc,YAAY,CAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;CACJ,GAAG,EAAE,CAAC;AACN;CACA,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;AAC3B;CACA,EAAE;AACF;CACA;;CC/FA,MAAM,sBAAsB,SAASA,oBAAc,CAAC;AACpD;CACA,CAAC,WAAW,GAAG;AACf;CACA,EAAE,KAAK,EAAE;AACT;CACA,GAAG,QAAQ,EAAE;AACb;CACA,IAAI,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;CAC3B,IAAI,UAAU,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,EAAE;AAC9B;CACA,IAAI;AACJ;CACA,GAAG,YAAY,YAAY,CAAC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;AACN;CACA,GAAG,cAAc,YAAY,CAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,GAAG2C,cAAyB,EAAE;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,CAAC;CACN,GAAG,EAAE,CAAC;AACN;CACA,EAAE,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C;AAClD;CACA,CAAC,WAAW,EAAE,UAAU,GAAG;AAC3B;CACA,EAAE,KAAK,EAAE;AACT;CACA,GAAG,QAAQ,EAAE9D,gBAAU;AACvB;CACA,GAAG,WAAW,EAAE,KAAK;AACrB;CACA,GAAG,UAAU,EAAE,KAAK;AACpB;CACA,GAAG,SAAS,EAAE,KAAK;AACnB;CACA,GAAG,OAAO,EAAE;AACZ;CACA,IAAI,UAAU,EAAE,CAAC;AACjB;CACA,IAAI;AACJ;CACA,GAAG,QAAQ,EAAE;AACb;CACA,IAAI,KAAK,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE;CACzB,IAAI,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;CAC9B,IAAI,MAAM,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE;AAC1B;CACA,IAAI,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE;CACxB,IAAI,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE;AACzB;CACA,IAAI;AACJ;CACA,GAAG,YAAY,YAAY,CAAC;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ;CACA,GAAG,cAAc,YAAY,CAAC;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG,CAAC;AACJ;CACA,GAAG,EAAE,CAAC;AACN;CACA,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,EAAE,CAAC;AAC/B;CACA,EAAE;AACF;CACA;;CC/IO,MAAM,iBAAiB,SAASuE,0BAAoB,CAAC;AAC5D;CACA,CAAC,WAAW,EAAE,MAAM,GAAG;AACvB;CACA,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAClB;CACA,EAAE,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;AAClC;CACA,EAAE,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;CACvB,EAAE,IAAI,CAAC,QAAQ,GAAG,IAAIhD,WAAK,EAAE,CAAC;CAC9B,EAAE,IAAI,CAAC,iBAAiB,GAAG,GAAG,CAAC;CAC/B,EAAE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;CACtB,EAAE,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;CAC1B,EAAE,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;CACvB,EAAE,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;AACvB;CACA,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC;AAC3B;CACA,EAAE;AACF;CACA;;CCtBA;;;;;;;;;;;;;;;;;;;;;;;;"}