@meimu/mutracer 0.1.5 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSES/Classroom-CC0.txt +121 -0
- package/README.md +10 -7
- package/THIRD_PARTY_NOTICES.md +13 -8
- package/dist/assets/bvh.worker.js +1 -1
- package/dist/mutracer.umd.js +12316 -9228
- package/docs/api.md +232 -21
- package/docs/caustics.md +80 -0
- package/docs/denoising.md +30 -15
- package/docs/materials.md +6 -5
- package/docs/performance.md +5 -2
- package/docs/progressive-rendering.md +73 -1
- package/docs/technical/continuous-spectrum.md +93 -0
- package/docs/threejs.md +14 -5
- package/docs/updates.md +46 -2
- package/docs/viewer-checklist.md +65 -0
- package/docs/viewer.md +15 -8
- package/lib/Display.d.ts +13 -2
- package/lib/Display.js +28 -7
- package/lib/Display.js.map +1 -1
- package/lib/Engine.d.ts +4 -0
- package/lib/Engine.js +99 -37
- package/lib/Engine.js.map +1 -1
- package/lib/Render.d.ts +98 -15
- package/lib/Render.js +275 -27
- package/lib/Render.js.map +1 -1
- package/lib/RenderLoop.d.ts +11 -1
- package/lib/RenderLoop.js +120 -15
- package/lib/RenderLoop.js.map +1 -1
- package/lib/main.d.ts +6 -3
- package/lib/main.js +1 -0
- package/lib/main.js.map +1 -1
- package/lib/math/access.d.ts +4 -0
- package/lib/math/access.js +10 -0
- package/lib/math/access.js.map +1 -0
- package/lib/math/mat3.d.ts +4 -0
- package/lib/math/mat3.js +54 -0
- package/lib/math/mat3.js.map +1 -0
- package/lib/math/mat4.d.ts +19 -0
- package/lib/math/mat4.js +413 -0
- package/lib/math/mat4.js.map +1 -0
- package/lib/math/storage.d.ts +6 -0
- package/lib/math/storage.js +22 -0
- package/lib/math/storage.js.map +1 -0
- package/lib/math/types.d.ts +3 -0
- package/lib/math/types.js +2 -0
- package/lib/math/types.js.map +1 -0
- package/lib/math/vec2.d.ts +13 -0
- package/lib/math/vec2.js +52 -0
- package/lib/math/vec2.js.map +1 -0
- package/lib/math/vec3.d.ts +23 -0
- package/lib/math/vec3.js +139 -0
- package/lib/math/vec3.js.map +1 -0
- package/lib/math.d.ts +5 -17
- package/lib/math.js +5 -55
- package/lib/math.js.map +1 -1
- package/lib/oidn.d.ts +1 -1
- package/lib/oidn.js +4 -2
- package/lib/oidn.js.map +1 -1
- package/lib/oidnBundledWeights.cdn.d.ts +2 -2
- package/lib/renderer/AovPrimitiveCache.d.ts +10 -0
- package/lib/renderer/AovPrimitiveCache.js +48 -0
- package/lib/renderer/AovPrimitiveCache.js.map +1 -0
- package/lib/renderer/Box3.d.ts +5 -0
- package/lib/renderer/Box3.js +9 -0
- package/lib/renderer/Box3.js.map +1 -0
- package/lib/renderer/GPUTraceQueue.d.ts +11 -0
- package/lib/renderer/GPUTraceQueue.js +33 -0
- package/lib/renderer/GPUTraceQueue.js.map +1 -0
- package/lib/renderer/MaterialData.d.ts +15 -0
- package/lib/renderer/MaterialData.js +61 -0
- package/lib/renderer/MaterialData.js.map +1 -0
- package/lib/renderer/MaterialTable.d.ts +11 -98
- package/lib/renderer/MaterialTable.js +34 -412
- package/lib/renderer/MaterialTable.js.map +1 -1
- package/lib/renderer/RenderingPipeline.d.ts +36 -13
- package/lib/renderer/RenderingPipeline.js +1 -17
- package/lib/renderer/RenderingPipeline.js.map +1 -1
- package/lib/renderer/TileRender.d.ts +0 -1
- package/lib/renderer/TileRender.js +14 -1
- package/lib/renderer/TileRender.js.map +1 -1
- package/lib/renderer/WGPUAov.d.ts +39 -0
- package/lib/renderer/WGPUAov.js +239 -0
- package/lib/renderer/WGPUAov.js.map +1 -0
- package/lib/renderer/WGPUBindlessMaterialData.d.ts +17 -0
- package/lib/renderer/WGPUBindlessMaterialData.js +48 -0
- package/lib/renderer/WGPUBindlessMaterialData.js.map +1 -0
- package/lib/renderer/WGPUBindlessTextures.d.ts +47 -0
- package/lib/renderer/WGPUBindlessTextures.js +180 -0
- package/lib/renderer/WGPUBindlessTextures.js.map +1 -0
- package/lib/renderer/WGPUBloomPass.js +17 -97
- package/lib/renderer/WGPUBloomPass.js.map +1 -1
- package/lib/renderer/WGPUCausticLightPass.d.ts +48 -0
- package/lib/renderer/WGPUCausticLightPass.js +217 -0
- package/lib/renderer/WGPUCausticLightPass.js.map +1 -0
- package/lib/renderer/WGPUComputePass.d.ts +1 -1
- package/lib/renderer/WGPUComputePass.js.map +1 -1
- package/lib/renderer/WGPUEnvMapDistribution.d.ts +12 -0
- package/lib/renderer/WGPUEnvMapDistribution.js +150 -0
- package/lib/renderer/WGPUEnvMapDistribution.js.map +1 -0
- package/lib/renderer/WGPUFullQuadPass.js +10 -9
- package/lib/renderer/WGPUFullQuadPass.js.map +1 -1
- package/lib/renderer/WGPUJNLMDenoiser.d.ts +1 -20
- package/lib/renderer/WGPUJNLMDenoiser.js +4 -267
- package/lib/renderer/WGPUJNLMDenoiser.js.map +1 -1
- package/lib/renderer/WGPUPhotonMap.d.ts +37 -0
- package/lib/renderer/WGPUPhotonMap.js +191 -0
- package/lib/renderer/WGPUPhotonMap.js.map +1 -0
- package/lib/renderer/WGPURayTraceOutput.d.ts +13 -1
- package/lib/renderer/WGPURayTraceOutput.js +132 -29
- package/lib/renderer/WGPURayTraceOutput.js.map +1 -1
- package/lib/renderer/WGPURayTracePass.d.ts +83 -56
- package/lib/renderer/WGPURayTracePass.js +884 -837
- package/lib/renderer/WGPURayTracePass.js.map +1 -1
- package/lib/renderer/WGPURenderingPipeline.d.ts +5 -3
- package/lib/renderer/WGPURenderingPipeline.js +297 -82
- package/lib/renderer/WGPURenderingPipeline.js.map +1 -1
- package/lib/renderer/WGPUShaderCache.d.ts +2 -2
- package/lib/renderer/WGPUShaderCache.js +10 -5
- package/lib/renderer/WGPUShaderCache.js.map +1 -1
- package/lib/renderer/WGPUShaderCapabilities.d.ts +10 -0
- package/lib/renderer/WGPUShaderCapabilities.js +54 -0
- package/lib/renderer/WGPUShaderCapabilities.js.map +1 -0
- package/lib/renderer/WGPUSkyBaker.d.ts +13 -0
- package/lib/renderer/WGPUSkyBaker.js +85 -0
- package/lib/renderer/WGPUSkyBaker.js.map +1 -0
- package/lib/renderer/WebGLAov.d.ts +41 -0
- package/lib/renderer/WebGLAov.js +106 -0
- package/lib/renderer/WebGLAov.js.map +1 -0
- package/lib/renderer/WebGLFullQuadPass.d.ts +7 -4
- package/lib/renderer/WebGLFullQuadPass.js +22 -2
- package/lib/renderer/WebGLFullQuadPass.js.map +1 -1
- package/lib/renderer/WebGLJNLMDenoiser.d.ts +1 -1
- package/lib/renderer/WebGLJNLMDenoiser.js +83 -74
- package/lib/renderer/WebGLJNLMDenoiser.js.map +1 -1
- package/lib/renderer/WebGLRayTraceOutputPass.js +7 -4
- package/lib/renderer/WebGLRayTraceOutputPass.js.map +1 -1
- package/lib/renderer/WebGLRayTracePass.d.ts +18 -3
- package/lib/renderer/WebGLRayTracePass.js +121 -9
- package/lib/renderer/WebGLRayTracePass.js.map +1 -1
- package/lib/renderer/WebGLRenderingPipeline.js +126 -22
- package/lib/renderer/WebGLRenderingPipeline.js.map +1 -1
- package/lib/renderer/WebGLSkyBaker.d.ts +39 -0
- package/lib/renderer/WebGLSkyBaker.js +422 -0
- package/lib/renderer/WebGLSkyBaker.js.map +1 -0
- package/lib/renderer/WebGLSkySource.d.ts +9 -0
- package/lib/renderer/WebGLSkySource.js +28 -0
- package/lib/renderer/WebGLSkySource.js.map +1 -0
- package/lib/renderer/accumulationTarget.d.ts +6 -0
- package/lib/renderer/accumulationTarget.js.map +1 -1
- package/lib/renderer/aov.d.ts +42 -0
- package/lib/renderer/aov.js +50 -0
- package/lib/renderer/aov.js.map +1 -0
- package/lib/renderer/aovDisplay.d.ts +14 -0
- package/lib/renderer/aovDisplay.js +32 -0
- package/lib/renderer/aovDisplay.js.map +1 -0
- package/lib/renderer/aovScene.d.ts +21 -0
- package/lib/renderer/aovScene.js +139 -0
- package/lib/renderer/aovScene.js.map +1 -0
- package/lib/renderer/binnedSahBvh.js +2 -1
- package/lib/renderer/binnedSahBvh.js.map +1 -1
- package/lib/renderer/bvhAccel.d.ts +20 -10
- package/lib/renderer/bvhAccel.js +168 -58
- package/lib/renderer/bvhAccel.js.map +1 -1
- package/lib/renderer/bvhWorkerBuild.d.ts +1 -0
- package/lib/renderer/cameraSnapshot.js +2 -1
- package/lib/renderer/cameraSnapshot.js.map +1 -1
- package/lib/renderer/cameraUniform.d.ts +2 -0
- package/lib/renderer/cameraUniform.js +12 -0
- package/lib/renderer/cameraUniform.js.map +1 -0
- package/lib/renderer/causticDiagnostics.d.ts +31 -0
- package/lib/renderer/causticDiagnostics.js +5 -0
- package/lib/renderer/causticDiagnostics.js.map +1 -0
- package/lib/renderer/causticEmission.d.ts +10 -0
- package/lib/renderer/causticEmission.js +40 -0
- package/lib/renderer/causticEmission.js.map +1 -0
- package/lib/renderer/causticUniform.d.ts +12 -0
- package/lib/renderer/causticUniform.js +22 -0
- package/lib/renderer/causticUniform.js.map +1 -0
- package/lib/renderer/caustics.d.ts +16 -0
- package/lib/renderer/caustics.js +93 -0
- package/lib/renderer/caustics.js.map +1 -0
- package/lib/renderer/committedScene.js +4 -0
- package/lib/renderer/committedScene.js.map +1 -1
- package/lib/renderer/denoiser.d.ts +3 -11
- package/lib/renderer/denoiser.js.map +1 -1
- package/lib/renderer/depthQuery.js +4 -1
- package/lib/renderer/depthQuery.js.map +1 -1
- package/lib/renderer/displacementPreparation.d.ts +11 -0
- package/lib/renderer/displacementPreparation.js +351 -0
- package/lib/renderer/displacementPreparation.js.map +1 -0
- package/lib/renderer/displacementRange.d.ts +1 -0
- package/lib/renderer/displacementRange.js +9 -0
- package/lib/renderer/displacementRange.js.map +1 -0
- package/lib/renderer/displayParityDiagnostics.d.ts +11 -0
- package/lib/renderer/displayParityDiagnostics.js +2 -0
- package/lib/renderer/displayParityDiagnostics.js.map +1 -0
- package/lib/renderer/envMapCreation.d.ts +9 -8
- package/lib/renderer/envMapCreation.js +36 -12
- package/lib/renderer/envMapCreation.js.map +1 -1
- package/lib/renderer/envMapDistribution.d.ts +12 -2
- package/lib/renderer/envMapDistribution.js +43 -34
- package/lib/renderer/envMapDistribution.js.map +1 -1
- package/lib/renderer/geometryBvhBounds.d.ts +4 -0
- package/lib/renderer/geometryBvhBounds.js +82 -0
- package/lib/renderer/geometryBvhBounds.js.map +1 -0
- package/lib/renderer/geometryUpdateState.d.ts +32 -0
- package/lib/renderer/geometryUpdateState.js +2 -0
- package/lib/renderer/geometryUpdateState.js.map +1 -0
- package/lib/renderer/geometryUpdates.d.ts +17 -9
- package/lib/renderer/geometryUpdates.js +92 -33
- package/lib/renderer/geometryUpdates.js.map +1 -1
- package/lib/renderer/glsl/aovDisplay.frag.d.ts +3 -0
- package/lib/renderer/glsl/aovDisplay.frag.js +54 -0
- package/lib/renderer/glsl/aovDisplay.frag.js.map +1 -0
- package/lib/renderer/glsl/aovReflectance.glsl.d.ts +2 -0
- package/lib/renderer/glsl/aovReflectance.glsl.js +87 -0
- package/lib/renderer/glsl/aovReflectance.glsl.js.map +1 -0
- package/lib/renderer/glsl/aovReflectanceSamples.glsl.d.ts +2 -0
- package/lib/renderer/glsl/aovReflectanceSamples.glsl.js +135 -0
- package/lib/renderer/glsl/aovReflectanceSamples.glsl.js.map +1 -0
- package/lib/renderer/glsl/aovTrace.frag.d.ts +2 -0
- package/lib/renderer/glsl/aovTrace.frag.js +121 -0
- package/lib/renderer/glsl/aovTrace.frag.js.map +1 -0
- package/lib/renderer/glsl/chunks/cameraRay.glsl.js +12 -12
- package/lib/renderer/glsl/chunks/emissiveLight.glsl.d.ts +2 -0
- package/lib/renderer/glsl/chunks/emissiveLight.glsl.js +35 -0
- package/lib/renderer/glsl/chunks/emissiveLight.glsl.js.map +1 -0
- package/lib/renderer/glsl/chunks/envMap.glsl.js +73 -67
- package/lib/renderer/glsl/chunks/envMap.glsl.js.map +1 -1
- package/lib/renderer/glsl/chunks/intersect.glsl.js +432 -434
- package/lib/renderer/glsl/chunks/intersect.glsl.js.map +1 -1
- package/lib/renderer/glsl/chunks/materialBuffer.glsl.d.ts +1 -0
- package/lib/renderer/glsl/chunks/materialBuffer.glsl.js +160 -157
- package/lib/renderer/glsl/chunks/materialBuffer.glsl.js.map +1 -1
- package/lib/renderer/glsl/chunks/openPbrBsdf.glsl.js +802 -802
- package/lib/renderer/glsl/chunks/rand.glsl.js +3 -3
- package/lib/renderer/glsl/chunks/random.glsl.js +6 -6
- package/lib/renderer/glsl/chunks/rayTraceCore.glsl.d.ts +1 -0
- package/lib/renderer/glsl/chunks/rayTraceCore.glsl.js +72 -67
- package/lib/renderer/glsl/chunks/rayTraceCore.glsl.js.map +1 -1
- package/lib/renderer/glsl/chunks/sampleLight.glsl.js +94 -76
- package/lib/renderer/glsl/chunks/sampleLight.glsl.js.map +1 -1
- package/lib/renderer/glsl/chunks/sampleMaterial.glsl.d.ts +1 -0
- package/lib/renderer/glsl/chunks/sampleMaterial.glsl.js +143 -120
- package/lib/renderer/glsl/chunks/sampleMaterial.glsl.js.map +1 -1
- package/lib/renderer/glsl/chunks/sampleShadowCatcher.glsl.js +21 -18
- package/lib/renderer/glsl/chunks/sampleShadowCatcher.glsl.js.map +1 -1
- package/lib/renderer/glsl/chunks/sampling.glsl.js +91 -94
- package/lib/renderer/glsl/chunks/sampling.glsl.js.map +1 -1
- package/lib/renderer/glsl/chunks/sobol.glsl.js +79 -79
- package/lib/renderer/glsl/chunks/textureLinear.glsl.js +5 -5
- package/lib/renderer/glsl/chunks/uvProjection.glsl.js +12 -12
- package/lib/renderer/glsl/chunks/uvProjection.glsl.js.map +1 -1
- package/lib/renderer/glsl/depthQuery.frag.js +7 -7
- package/lib/renderer/glsl/normalizeRayTraceOutput.frag.js +17 -9
- package/lib/renderer/glsl/normalizeRayTraceOutput.frag.js.map +1 -1
- package/lib/renderer/glsl/rayTrace.frag.d.ts +1 -1
- package/lib/renderer/glsl/rayTrace.frag.js +271 -248
- package/lib/renderer/glsl/rayTrace.frag.js.map +1 -1
- package/lib/renderer/glsl/shadowCatcher.frag.js +37 -32
- package/lib/renderer/glsl/shadowCatcher.frag.js.map +1 -1
- package/lib/renderer/glsl/webglPipeline.frag.js +65 -60
- package/lib/renderer/glsl/webglPipeline.frag.js.map +1 -1
- package/lib/renderer/lightConstants.d.ts +10 -0
- package/lib/renderer/lightConstants.js +11 -0
- package/lib/renderer/lightConstants.js.map +1 -0
- package/lib/renderer/lightCore.d.ts +12 -0
- package/lib/renderer/lightCore.js +13 -0
- package/lib/renderer/lightCore.js.map +1 -0
- package/lib/renderer/lightSampling.d.ts +22 -18
- package/lib/renderer/lightSampling.js +135 -62
- package/lib/renderer/lightSampling.js.map +1 -1
- package/lib/renderer/lightsData.d.ts +21 -0
- package/lib/renderer/lightsData.js +192 -0
- package/lib/renderer/lightsData.js.map +1 -0
- package/lib/renderer/lightsUtil.d.ts +3 -26
- package/lib/renderer/lightsUtil.js +3 -153
- package/lib/renderer/lightsUtil.js.map +1 -1
- package/lib/renderer/materialBufferData.d.ts +70 -0
- package/lib/renderer/materialBufferData.js +2 -0
- package/lib/renderer/materialBufferData.js.map +1 -0
- package/lib/renderer/materialConstants.d.ts +11 -0
- package/lib/renderer/materialConstants.js +11 -0
- package/lib/renderer/materialConstants.js.map +1 -1
- package/lib/renderer/materialCore.d.ts +8 -0
- package/lib/renderer/materialCore.js +9 -0
- package/lib/renderer/materialCore.js.map +1 -0
- package/lib/renderer/materialEmission.d.ts +2 -2
- package/lib/renderer/materialEmission.js +3 -3
- package/lib/renderer/materialEmission.js.map +1 -1
- package/lib/renderer/materialLayout.d.ts +2 -101
- package/lib/renderer/materialLayout.js +110 -172
- package/lib/renderer/materialLayout.js.map +1 -1
- package/lib/renderer/materialLayoutSchema.d.ts +26 -0
- package/lib/renderer/materialLayoutSchema.js +172 -0
- package/lib/renderer/materialLayoutSchema.js.map +1 -0
- package/lib/renderer/materialParams.d.ts +69 -0
- package/lib/renderer/materialParams.js +272 -0
- package/lib/renderer/materialParams.js.map +1 -0
- package/lib/renderer/materialTextureSlots.d.ts +14 -324
- package/lib/renderer/materialTextureSlots.js +21 -8
- package/lib/renderer/materialTextureSlots.js.map +1 -1
- package/lib/renderer/materialTextures.d.ts +6 -0
- package/lib/renderer/{texturesFromMaterials.js → materialTextures.js} +1 -2
- package/lib/renderer/materialTextures.js.map +1 -0
- package/lib/renderer/mergeMeshesToGeometry.js +6 -147
- package/lib/renderer/mergeMeshesToGeometry.js.map +1 -1
- package/lib/renderer/meshInstances.d.ts +4 -21
- package/lib/renderer/meshInstances.js +10 -56
- package/lib/renderer/meshInstances.js.map +1 -1
- package/lib/renderer/oidnNetwork.d.ts +2 -2
- package/lib/renderer/oidnNetwork.js +1 -1
- package/lib/renderer/oidnNetwork.js.map +1 -1
- package/lib/renderer/openPbrEnergyLut.js +850 -846
- package/lib/renderer/openPbrEnergyLut.js.map +1 -1
- package/lib/renderer/ownedDenoiser.d.ts +9 -0
- package/lib/renderer/ownedDenoiser.js +2 -0
- package/lib/renderer/ownedDenoiser.js.map +1 -0
- package/lib/renderer/packedMeshInstances.d.ts +23 -0
- package/lib/renderer/packedMeshInstances.js +80 -0
- package/lib/renderer/packedMeshInstances.js.map +1 -0
- package/lib/renderer/prepareMeshBVH.d.ts +12 -47
- package/lib/renderer/prepareMeshBVH.js +21 -642
- package/lib/renderer/prepareMeshBVH.js.map +1 -1
- package/lib/renderer/proceduralEnvironmentPower.d.ts +3 -0
- package/lib/renderer/proceduralEnvironmentPower.js +8 -0
- package/lib/renderer/proceduralEnvironmentPower.js.map +1 -0
- package/lib/renderer/progressiveScheduler.d.ts +1 -0
- package/lib/renderer/progressiveScheduler.js +7 -3
- package/lib/renderer/progressiveScheduler.js.map +1 -1
- package/lib/renderer/renderPipeline.d.ts +4 -1
- package/lib/renderer/renderPipeline.js.map +1 -1
- package/lib/renderer/renderingLimits.d.ts +9 -0
- package/lib/renderer/renderingLimits.js +18 -0
- package/lib/renderer/renderingLimits.js.map +1 -0
- package/lib/renderer/researchTransport.d.ts +31 -0
- package/lib/renderer/researchTransport.js +5 -0
- package/lib/renderer/researchTransport.js.map +1 -0
- package/lib/renderer/sceneAssembly.d.ts +73 -0
- package/lib/renderer/sceneAssembly.js +109 -0
- package/lib/renderer/sceneAssembly.js.map +1 -0
- package/lib/renderer/sceneChangeCore.d.ts +39 -0
- package/lib/renderer/sceneChangeCore.js +307 -0
- package/lib/renderer/sceneChangeCore.js.map +1 -0
- package/lib/renderer/sceneChangeDetector.d.ts +3 -6
- package/lib/renderer/sceneChangeDetector.js +24 -150
- package/lib/renderer/sceneChangeDetector.js.map +1 -1
- package/lib/renderer/sceneLayoutSchema.d.ts +119 -0
- package/lib/renderer/sceneLayoutSchema.js +111 -0
- package/lib/renderer/sceneLayoutSchema.js.map +1 -0
- package/lib/renderer/sceneLightChanges.d.ts +3 -3
- package/lib/renderer/sceneLightChanges.js.map +1 -1
- package/lib/renderer/scenePreparation.d.ts +55 -0
- package/lib/renderer/scenePreparation.js +360 -0
- package/lib/renderer/scenePreparation.js.map +1 -0
- package/lib/renderer/scratchSampling.js +18 -18
- package/lib/renderer/scratchSampling.js.map +1 -1
- package/lib/renderer/shader.d.ts +2 -0
- package/lib/renderer/shader.js +2 -0
- package/lib/renderer/shader.js.map +1 -1
- package/lib/renderer/shaderCapabilities.d.ts +23 -0
- package/lib/renderer/shaderCapabilities.js +55 -0
- package/lib/renderer/shaderCapabilities.js.map +1 -0
- package/lib/renderer/shaderCapacity.d.ts +2 -0
- package/lib/renderer/shaderCapacity.js +5 -0
- package/lib/renderer/shaderCapacity.js.map +1 -0
- package/lib/renderer/skyModel.d.ts +9 -0
- package/lib/renderer/skyModel.js +10 -0
- package/lib/renderer/skyModel.js.map +1 -0
- package/lib/renderer/spectrum.d.ts +21 -0
- package/lib/renderer/spectrum.js +154 -0
- package/lib/renderer/spectrum.js.map +1 -0
- package/lib/renderer/textureAtlas.d.ts +60 -0
- package/lib/renderer/textureAtlas.js +145 -0
- package/lib/renderer/textureAtlas.js.map +1 -0
- package/lib/renderer/textureAtlasPixels.d.ts +7 -0
- package/lib/renderer/textureAtlasPixels.js +68 -0
- package/lib/renderer/textureAtlasPixels.js.map +1 -0
- package/lib/renderer/util.d.ts +1 -1
- package/lib/renderer/util.js.map +1 -1
- package/lib/renderer/webgl.d.ts +9 -2
- package/lib/renderer/webgl.js +54 -9
- package/lib/renderer/webgl.js.map +1 -1
- package/lib/renderer/webglLightSampling.d.ts +39 -0
- package/lib/renderer/webglLightSampling.js +15 -0
- package/lib/renderer/webglLightSampling.js.map +1 -0
- package/lib/renderer/wgpuBindless.d.ts +26 -0
- package/lib/renderer/wgpuBindless.js +95 -0
- package/lib/renderer/wgpuBindless.js.map +1 -0
- package/lib/renderer/wgpuBindlessSource.d.ts +2 -0
- package/lib/renderer/wgpuBindlessSource.js +51 -0
- package/lib/renderer/wgpuBindlessSource.js.map +1 -0
- package/lib/renderer/wgpuMaterialConstants.d.ts +4 -0
- package/lib/renderer/wgpuMaterialConstants.js +52 -0
- package/lib/renderer/wgpuMaterialConstants.js.map +1 -0
- package/lib/renderer/wgpuSceneUniform.d.ts +42 -0
- package/lib/renderer/wgpuSceneUniform.js +125 -0
- package/lib/renderer/wgpuSceneUniform.js.map +1 -0
- package/lib/renderer/wgpuShaderSource.d.ts +22 -0
- package/lib/renderer/wgpuShaderSource.js +33 -0
- package/lib/renderer/wgpuShaderSource.js.map +1 -0
- package/lib/renderer/wgsl/aovDisplay.wgsl.d.ts +1 -0
- package/lib/renderer/wgsl/aovDisplay.wgsl.js +70 -0
- package/lib/renderer/wgsl/aovDisplay.wgsl.js.map +1 -0
- package/lib/renderer/wgsl/aovReflectance.wgsl.d.ts +2 -0
- package/lib/renderer/wgsl/aovReflectance.wgsl.js +98 -0
- package/lib/renderer/wgsl/aovReflectance.wgsl.js.map +1 -0
- package/lib/renderer/wgsl/aovReflectanceSamples.wgsl.d.ts +2 -0
- package/lib/renderer/wgsl/aovReflectanceSamples.wgsl.js +135 -0
- package/lib/renderer/wgsl/aovReflectanceSamples.wgsl.js.map +1 -0
- package/lib/renderer/wgsl/aovResolve.wgsl.d.ts +5 -0
- package/lib/renderer/wgsl/aovResolve.wgsl.js +38 -0
- package/lib/renderer/wgsl/aovResolve.wgsl.js.map +1 -0
- package/lib/renderer/wgsl/aovSnapshot.wgsl.d.ts +4 -0
- package/lib/renderer/wgsl/aovSnapshot.wgsl.js +21 -0
- package/lib/renderer/wgsl/aovSnapshot.wgsl.js.map +1 -0
- package/lib/renderer/wgsl/aovTrace.wgsl.d.ts +2 -0
- package/lib/renderer/wgsl/aovTrace.wgsl.js +115 -0
- package/lib/renderer/wgsl/aovTrace.wgsl.js.map +1 -0
- package/lib/renderer/wgsl/bloom.wgsl.d.ts +13 -0
- package/lib/renderer/wgsl/bloom.wgsl.js +92 -0
- package/lib/renderer/wgsl/bloom.wgsl.js.map +1 -0
- package/lib/renderer/wgsl/causticLight.compute.d.ts +6 -0
- package/lib/renderer/wgsl/causticLight.compute.js +537 -0
- package/lib/renderer/wgsl/causticLight.compute.js.map +1 -0
- package/lib/renderer/wgsl/chunks/background.wgsl.d.ts +2 -0
- package/lib/renderer/wgsl/chunks/background.wgsl.js +102 -0
- package/lib/renderer/wgsl/chunks/background.wgsl.js.map +1 -0
- package/lib/renderer/wgsl/chunks/causticAdjoint.wgsl.d.ts +2 -0
- package/lib/renderer/wgsl/chunks/causticAdjoint.wgsl.js +12 -0
- package/lib/renderer/wgsl/chunks/causticAdjoint.wgsl.js.map +1 -0
- package/lib/renderer/wgsl/chunks/causticAtomic.wgsl.d.ts +2 -0
- package/lib/renderer/wgsl/chunks/causticAtomic.wgsl.js +16 -0
- package/lib/renderer/wgsl/chunks/causticAtomic.wgsl.js.map +1 -0
- package/lib/renderer/wgsl/chunks/caustics.wgsl.d.ts +1 -0
- package/lib/renderer/wgsl/chunks/caustics.wgsl.js +62 -0
- package/lib/renderer/wgsl/chunks/caustics.wgsl.js.map +1 -0
- package/lib/renderer/wgsl/chunks/common.wgsl.js +4 -4
- package/lib/renderer/wgsl/chunks/envMap.wgsl.d.ts +1 -1
- package/lib/renderer/wgsl/chunks/envMap.wgsl.js +41 -35
- package/lib/renderer/wgsl/chunks/envMap.wgsl.js.map +1 -1
- package/lib/renderer/wgsl/chunks/intersect.wgsl.d.ts +13 -1
- package/lib/renderer/wgsl/chunks/intersect.wgsl.js +747 -704
- package/lib/renderer/wgsl/chunks/intersect.wgsl.js.map +1 -1
- package/lib/renderer/wgsl/chunks/intersectionAlpha.wgsl.js +16 -16
- package/lib/renderer/wgsl/chunks/intersectionAlpha.wgsl.js.map +1 -1
- package/lib/renderer/wgsl/chunks/materialBuffer.wgsl.d.ts +4 -1
- package/lib/renderer/wgsl/chunks/materialBuffer.wgsl.js +83 -79
- package/lib/renderer/wgsl/chunks/materialBuffer.wgsl.js.map +1 -1
- package/lib/renderer/wgsl/chunks/openPbrBsdf.wgsl.js +855 -857
- package/lib/renderer/wgsl/chunks/openPbrBsdf.wgsl.js.map +1 -1
- package/lib/renderer/wgsl/chunks/pdm_displacement.wgsl.js +137 -137
- package/lib/renderer/wgsl/chunks/rand.wgsl.js +3 -3
- package/lib/renderer/wgsl/chunks/rayTraceCore.wgsl.d.ts +3 -1
- package/lib/renderer/wgsl/chunks/rayTraceCore.wgsl.js +52 -32
- package/lib/renderer/wgsl/chunks/rayTraceCore.wgsl.js.map +1 -1
- package/lib/renderer/wgsl/chunks/sampleLight.wgsl.d.ts +1 -1
- package/lib/renderer/wgsl/chunks/sampleLight.wgsl.js +152 -144
- package/lib/renderer/wgsl/chunks/sampleLight.wgsl.js.map +1 -1
- package/lib/renderer/wgsl/chunks/sampleMaterial.wgsl.d.ts +1 -1
- package/lib/renderer/wgsl/chunks/sampleMaterial.wgsl.js +269 -245
- package/lib/renderer/wgsl/chunks/sampleMaterial.wgsl.js.map +1 -1
- package/lib/renderer/wgsl/chunks/sampleShadowCatcher.wgsl.d.ts +1 -1
- package/lib/renderer/wgsl/chunks/sampleShadowCatcher.wgsl.js +27 -14
- package/lib/renderer/wgsl/chunks/sampleShadowCatcher.wgsl.js.map +1 -1
- package/lib/renderer/wgsl/chunks/sampling.wgsl.d.ts +1 -1
- package/lib/renderer/wgsl/chunks/sampling.wgsl.js +91 -95
- package/lib/renderer/wgsl/chunks/sampling.wgsl.js.map +1 -1
- package/lib/renderer/wgsl/chunks/shadowCatcherAccumulation.wgsl.d.ts +1 -1
- package/lib/renderer/wgsl/chunks/shadowCatcherAccumulation.wgsl.js +1 -0
- package/lib/renderer/wgsl/chunks/shadowCatcherAccumulation.wgsl.js.map +1 -1
- package/lib/renderer/wgsl/chunks/sobol.wgsl.js +83 -83
- package/lib/renderer/wgsl/chunks/uvProjection.wgsl.js +12 -12
- package/lib/renderer/wgsl/chunks/uvProjection.wgsl.js.map +1 -1
- package/lib/renderer/wgsl/compose.frag.wgsl.d.ts +8 -3
- package/lib/renderer/wgsl/compose.frag.wgsl.js +143 -118
- package/lib/renderer/wgsl/compose.frag.wgsl.js.map +1 -1
- package/lib/renderer/wgsl/customDenoise.wgsl.js +10 -10
- package/lib/renderer/wgsl/depthQuery.wgsl.js +7 -7
- package/lib/renderer/wgsl/jnlm.compute.d.ts +25 -0
- package/lib/renderer/wgsl/jnlm.compute.js +315 -0
- package/lib/renderer/wgsl/jnlm.compute.js.map +1 -0
- package/lib/renderer/wgsl/offlineAdaptive.compute.js +28 -28
- package/lib/renderer/wgsl/oidnAuxiliary.wgsl.d.ts +1 -0
- package/lib/renderer/wgsl/oidnAuxiliary.wgsl.js +17 -0
- package/lib/renderer/wgsl/oidnAuxiliary.wgsl.js.map +1 -0
- package/lib/renderer/wgsl/photonMap.compute.d.ts +29 -0
- package/lib/renderer/wgsl/photonMap.compute.js +352 -0
- package/lib/renderer/wgsl/photonMap.compute.js.map +1 -0
- package/lib/renderer/wgsl/proceduralSky.compute.d.ts +1 -0
- package/lib/renderer/wgsl/proceduralSky.compute.js +198 -0
- package/lib/renderer/wgsl/proceduralSky.compute.js.map +1 -0
- package/lib/renderer/wgsl/rayTrace.compute.d.ts +25 -1
- package/lib/renderer/wgsl/rayTrace.compute.js +645 -500
- package/lib/renderer/wgsl/rayTrace.compute.js.map +1 -1
- package/lib/scene/Camera.js +7 -3
- package/lib/scene/Camera.js.map +1 -1
- package/lib/scene/EnvironmentLight.d.ts +5 -9
- package/lib/scene/EnvironmentLight.js +4 -14
- package/lib/scene/EnvironmentLight.js.map +1 -1
- package/lib/scene/EnvironmentLightState.d.ts +18 -0
- package/lib/scene/EnvironmentLightState.js +19 -0
- package/lib/scene/EnvironmentLightState.js.map +1 -0
- package/lib/scene/Geometry.d.ts +12 -6
- package/lib/scene/Geometry.js +37 -13
- package/lib/scene/Geometry.js.map +1 -1
- package/lib/scene/InstanceState.d.ts +39 -0
- package/lib/scene/InstanceState.js +77 -0
- package/lib/scene/InstanceState.js.map +1 -0
- package/lib/scene/InstancedMesh.d.ts +1 -1
- package/lib/scene/InstancedMesh.js +3 -0
- package/lib/scene/InstancedMesh.js.map +1 -1
- package/lib/scene/MaterialState.d.ts +209 -0
- package/lib/scene/MaterialState.js +231 -0
- package/lib/scene/MaterialState.js.map +1 -0
- package/lib/scene/Mesh.d.ts +4 -6
- package/lib/scene/Mesh.js +3 -11
- package/lib/scene/Mesh.js.map +1 -1
- package/lib/scene/MeshState.d.ts +20 -0
- package/lib/scene/MeshState.js +35 -0
- package/lib/scene/MeshState.js.map +1 -0
- package/lib/scene/OpenPBRMaterial.d.ts +6 -168
- package/lib/scene/OpenPBRMaterial.js +5 -223
- package/lib/scene/OpenPBRMaterial.js.map +1 -1
- package/lib/scene/PixelTexture.d.ts +6 -0
- package/lib/scene/PixelTexture.js +10 -0
- package/lib/scene/PixelTexture.js.map +1 -0
- package/lib/scene/ProceduralSky.d.ts +24 -0
- package/lib/scene/ProceduralSky.js +40 -0
- package/lib/scene/ProceduralSky.js.map +1 -0
- package/lib/scene/RectLight.d.ts +2 -13
- package/lib/scene/RectLight.js +3 -21
- package/lib/scene/RectLight.js.map +1 -1
- package/lib/scene/RectLightState.d.ts +31 -0
- package/lib/scene/RectLightState.js +26 -0
- package/lib/scene/RectLightState.js.map +1 -0
- package/lib/scene/Scene.d.ts +15 -4
- package/lib/scene/Scene.js.map +1 -1
- package/lib/scene/SceneNode.js +7 -6
- package/lib/scene/SceneNode.js.map +1 -1
- package/lib/scene/Texture.d.ts +10 -41
- package/lib/scene/Texture.js +4 -33
- package/lib/scene/Texture.js.map +1 -1
- package/lib/scene/TextureState.d.ts +35 -0
- package/lib/scene/TextureState.js +35 -0
- package/lib/scene/TextureState.js.map +1 -0
- package/lib/scene/attributeData.d.ts +4 -0
- package/lib/scene/attributeData.js +10 -0
- package/lib/scene/attributeData.js.map +1 -0
- package/lib/scene/lightState.d.ts +8 -0
- package/lib/scene/lightState.js +2 -0
- package/lib/scene/lightState.js.map +1 -0
- package/lib/scene/openPbrSchema.d.ts +7 -12
- package/lib/scene/openPbrSchema.js +273 -28
- package/lib/scene/openPbrSchema.js.map +1 -1
- package/lib/scene/skyParameters.d.ts +20 -0
- package/lib/scene/skyParameters.js +28 -0
- package/lib/scene/skyParameters.js.map +1 -0
- package/lib/scene/textureData.d.ts +9 -0
- package/lib/scene/textureData.js +2 -0
- package/lib/scene/textureData.js.map +1 -0
- package/lib/scene/texturePixels.d.ts +6 -0
- package/lib/scene/texturePixels.js +10 -0
- package/lib/scene/texturePixels.js.map +1 -0
- package/lib/settings/display.d.ts +33 -0
- package/lib/settings/display.js +7 -0
- package/lib/settings/display.js.map +1 -1
- package/lib/settings/render.d.ts +36 -3
- package/lib/settings/render.js +4 -1
- package/lib/settings/render.js.map +1 -1
- package/lib/tinybvh/tinybvh.wasm +0 -0
- package/lib/util/commonGeometry.js +7 -7
- package/lib/util/commonGeometry.js.map +1 -1
- package/lib/util/fromTHREE.d.ts +4 -1
- package/lib/util/fromTHREE.js +20 -7
- package/lib/util/fromTHREE.js.map +1 -1
- package/lib/util/geometry.js +42 -29
- package/lib/util/geometry.js.map +1 -1
- package/lib/util/loadRGBE.js +3 -4
- package/lib/util/loadRGBE.js.map +1 -1
- package/lib/util/studioLighting.d.ts +18 -0
- package/lib/util/studioLighting.js +36 -0
- package/lib/util/studioLighting.js.map +1 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/llms.txt +5 -0
- package/package.json +33 -7
- package/lib/renderer/texturesFromMaterials.d.ts +0 -6
- package/lib/renderer/texturesFromMaterials.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaterialState.js","sourceRoot":"","sources":["../../src/scene/MaterialState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKlE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAO1E,iFAAiF;AACjF,MAAM,MAAM,GAAG,IAAI,OAAO,EAAyB,CAAC;AACpD,MAAM,CAAC,OAAO,OAAO,aAAa;IAChC,kIAAkI;IAClI,IAAI,KAAK,KAAa,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,CAAE,CAAC,CAAC,CAAC;IACjD,IAAI,KAAK,CAAC,KAAa,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACpE,4EAA4E;IAC5E,YAAY,SAA8B,EAAE;QAC1C,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE,aAAa,EAAE,CAAC,CAAC;QAClC,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAClC,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3E,CAAC;IAED,OAAO;IACP,yJAAyJ;IACzJ,UAAU,GAAW,eAAe,CAAC,YAAY,CAAC,CAAC;IACnD,sDAAsD;IACtD,SAAS,GAAa,eAAe,CAAC,WAAW,CAAC,CAAC;IACn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AAyE;IACzE,wBAAwB,GAAiB,eAAe,CAAC,0BAA0B,CAAC,CAAC;IACrF,kEAAkE;IAClE,6BAA6B,GAAW,eAAe,CAAC,+BAA+B,CAAC,CAAC;IACzF,uEAAuE;IACvE,iBAAiB,GAAW,eAAe,CAAC,mBAAmB,CAAC,CAAC;IACjE,iIAAiI;IACjI,gBAAgB,GAAW,eAAe,CAAC,kBAAkB,CAAC,CAAC;IAC/D,4GAA4G;IAC5G,oBAAoB,GAAW,eAAe,CAAC,sBAAsB,CAAC,CAAC;CAExE;AACD,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAI9E,MAAM,UAAU,wBAAwB,CACtC,QAAuB;IAEvB,IAAI,QAAQ,CAAC,SAAS,KAAK,MAAM;QAAE,OAAO,QAAQ,CAAC,SAAS,CAAC;IAC7D,IAAI,QAAQ,CAAC,WAAW,GAAG,CAAC;QAAE,OAAO,MAAM,CAAC;IAC5C,IACE,QAAQ,CAAC,OAAO,GAAG,CAAC;QACpB,QAAQ,CAAC,aAAa,KAAK,OAAO;QAClC,QAAQ,CAAC,QAAQ,EACjB,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["import { allocateAovId, validateAovId } from '../renderer/aov.js';\nimport type { Vec2 } from '../types.js';\nimport type { ColorRGB } from '../types.js';\nimport type TextureState from './TextureState.js';\nimport type { ThinFilmMapChannel } from './thinFilmParameters.js';\nimport { materialDefault, applyMaterialParams } from './openPbrSchema.js';\n\nexport type UVProjection = 'none' | 'triplanar' | 'spherical' | 'cylindrical';\nexport type MaterialAlphaMode = 'auto' | 'opaque' | 'mask' | 'blend';\n\nexport type { MaterialTextureName } from './materialTextureNames.js';\n\n// Shared material state; browser texture types are refined by the public facade.\nconst aovIds = new WeakMap<MaterialState, number>();\nexport default class MaterialState {\n /** Stable unsigned material ID, excluding 0xFFFFFFFF. Default process-unique monotonic ID; assign before committing the scene. */\n get aovId(): number { return aovIds.get(this)!; }\n set aovId(value: number) { aovIds.set(this, validateAovId(value)); }\n /** Creates a material. Omitted properties use their documented defaults. */\n constructor(params: MaterialStateParams = {}) {\n aovIds.set(this, allocateAovId());\n applyMaterialParams(this, params);\n if (params.aovId !== undefined) this.aovId = validateAovId(params.aovId);\n }\n\n // Base\n /** Multiplier of diffuse reflection and metallic normal-incidence color; does not scale dielectric specular, transmission or subsurface. Default `1`. */\n baseWeight: number = materialDefault('baseWeight');\n /** Diffuse/metal color. Default `[0.8, 0.8, 0.8]`. */\n baseColor: ColorRGB = materialDefault('baseColor');\n /** Oren-Nayar style roughness of the diffuse lobe. Default `0`. */\n baseDiffuseRoughness: number = materialDefault('baseDiffuseRoughness');\n /** `0` dielectric, `1` metal. Default `0`. */\n baseMetalness: number = materialDefault('baseMetalness');\n\n // Specular\n /** Dielectric specular strength (via IOR) and overall metallic Fresnel multiplier. Default `1`. */\n specularWeight: number = materialDefault('specularWeight');\n /** Dielectric specular tint and metallic F82 near-grazing tint. Default `[1, 1, 1]`. */\n specularColor: ColorRGB = materialDefault('specularColor');\n /** Microfacet roughness, `0` mirror to `1` rough; retains source perceptual roughness in `gltf` anisotropy mode. Default `0.3`. */\n specularRoughness: number = materialDefault('specularRoughness');\n /** Index of refraction. Default `1.5`. */\n specularIor: number = materialDefault('specularIor');\n /**\n * GGX anisotropy strength, 0 to 1 (requires tangents); native OpenPBR or source glTF strength according to specularAnisotropyModel. Default `0`.\n * @deprecated Use specularRoughnessAnisotropy.\n */\n specularAnisotropy: number = materialDefault('specularAnisotropy');\n\n // Transmission\n /** `1` makes the dielectric base fully transmissive (glass). Default `0`. */\n transmissionWeight: number = materialDefault('transmissionWeight');\n /** Transmission tint, or the medium color at `transmissionDepth`. Default `[1, 1, 1]`. */\n transmissionColor: ColorRGB = materialDefault('transmissionColor');\n /** Depth at which `transmissionColor` is reached; `0` tints at the surface. Default `0`. */\n transmissionDepth: number = materialDefault('transmissionDepth');\n /** Volume scattering color of the transmissive medium. Default `[0, 0, 0]`. */\n transmissionScatter: ColorRGB = materialDefault('transmissionScatter');\n /** Henyey-Greenstein anisotropy of the medium, -1 to 1. Default `0`. */\n transmissionScatterAnisotropy: number = materialDefault('transmissionScatterAnisotropy');\n /** Nonnegative dispersion strength; values above `1` are supported. `0` disables wavelength-dependent refraction. Default `0`. */\n transmissionDispersionScale: number = materialDefault('transmissionDispersionScale');\n /** Abbe number controlling dispersion. Default `20`. */\n transmissionDispersionAbbeNumber: number = materialDefault('transmissionDispersionAbbeNumber');\n\n // Subsurface\n /** Subsurface scattering weight. Default `0`. */\n subsurfaceWeight: number = materialDefault('subsurfaceWeight');\n /** Subsurface color. Default `[0.8, 0.8, 0.8]`. */\n subsurfaceColor: ColorRGB = materialDefault('subsurfaceColor');\n /** Mean free path in scene units. Default `1`. */\n subsurfaceRadius: number = materialDefault('subsurfaceRadius');\n /** Per-channel multiplier of `subsurfaceRadius`. Default `[1, 0.5, 0.25]`. */\n subsurfaceRadiusScale: ColorRGB = materialDefault('subsurfaceRadiusScale');\n /**\n * Scattering anisotropy, -1 to 1. Default `0`.\n * @deprecated Use subsurfaceScatterAnisotropy.\n */\n subsurfaceAnisotropy: number = materialDefault('subsurfaceAnisotropy');\n\n // Fuzz (sheen)\n /** Fuzz (sheen) layer weight. Default `0`. */\n fuzzWeight: number = materialDefault('fuzzWeight');\n /** Fuzz reflection color; substrate attenuation uses white fuzz albedo. Default `[1, 1, 1]`. */\n fuzzColor: ColorRGB = materialDefault('fuzzColor');\n /** Fuzz roughness; imported from Three.js `sheenRoughness`. Default `0.5`. */\n fuzzRoughness: number = materialDefault('fuzzRoughness');\n\n // Coat\n /** Clear coat weight. Default `0`. */\n coatWeight: number = materialDefault('coatWeight');\n /** Squared coat transmittance at normal incidence; colors the base and emission, not coat reflection. Default `[1, 1, 1]`. */\n coatColor: ColorRGB = materialDefault('coatColor');\n /** Coat roughness. Default `0`. */\n coatRoughness: number = materialDefault('coatRoughness');\n /**\n * OpenPBR GGX coat anisotropy, 0 to 1; uses the base geometry tangent. Default `0`.\n * @deprecated Use coatRoughnessAnisotropy.\n */\n coatAnisotropy: number = materialDefault('coatAnisotropy');\n /** Coat index of refraction. Default `1.6`. */\n coatIor: number = materialDefault('coatIor');\n /** Internal-reflection darkening: 0 compensates darkening, 1 is physical; absorption remains at 0. Default `1`. */\n coatDarkening: number = materialDefault('coatDarkening');\n\n // Thin film\n /** Thin-film interference weight (iridescence). Default `0`. */\n thinFilmWeight: number = materialDefault('thinFilmWeight');\n /** Film thickness in micrometres; maximum endpoint when thinFilmMap is present. Default `0.5`. */\n thinFilmThickness: number = materialDefault('thinFilmThickness');\n /** Film index of refraction. Default `1.4`. */\n thinFilmIor: number = materialDefault('thinFilmIor');\n\n /** Thickness at a thinFilmMap sample of zero, in micrometres; ignored without a map. May exceed thinFilmThickness. Default `0`. */\n thinFilmThicknessMinimum: number = materialDefault('thinFilmThicknessMinimum');\n /** Linear channel sampled by thinFilmMap. Default `r`. */\n thinFilmMapChannel: ThinFilmMapChannel = materialDefault('thinFilmMapChannel');\n\n // Emission and geometry\n /** Emission color. Default `[1, 1, 1]`. */\n emissionColor: ColorRGB = materialDefault('emissionColor');\n /** Emitted radiance scale; `0` disables emission. Default `0`. */\n emissionLuminance: number = materialDefault('emissionLuminance');\n /**\n * Coverage, `1` opaque. See `alphaMode`. Default `1`.\n * @deprecated Use geometryOpacity.\n */\n opacity: number = materialDefault('opacity');\n /**\n * Treat the surface as an infinitely thin shell (leaves, paper). Default `false`.\n * @deprecated Use geometryThinWalled.\n */\n thinWalled: boolean = materialDefault('thinWalled');\n /** Disables geometric back-face culling and permits back-face emission. Default `false`. */\n doubleSided: boolean = materialDefault('doubleSided');\n\n // Textures\n /** Base color texture, multiplied with `baseColor` using Texture color encoding. Default `undefined`. */\n map?: TextureState;\n /** Standalone opacity texture sampled from its green channel, matching Three.js. Default `undefined`. */\n alphaMap?: TextureState;\n /**\n * Coverage for surface and shadow rays: `opaque` ignores alpha inputs,\n * `mask` uses binary alpha testing, `blend` retains fractional coverage.\n * `auto` derives the mode from the alpha inputs. Default `auto`.\n */\n alphaMode: MaterialAlphaMode = materialDefault('alphaMode');\n /** Alpha-test threshold for `mask` mode; equality is fully covered. Default `0`. */\n alphaCutoff: number = materialDefault('alphaCutoff');\n /** Emission texture multiplied with `emissionColor`. Default `undefined`. */\n emissiveMap?: TextureState;\n /** Tangent-space normal map. Default `undefined`. */\n normalMap?: TextureState;\n /** Normal map strength per axis. Default `[1, 1]`. */\n normalScale: Vec2 = materialDefault('normalScale');\n /** glTF-compatible B=metalness, G=specular roughness texture. Default `undefined`. */\n metallicRoughnessMap?: TextureState;\n /** Standalone roughness texture sampled from its green channel. Default `undefined`. */\n roughnessMap?: TextureState;\n /** Standalone metalness texture sampled from its blue channel. Default `undefined`. */\n metalnessMap?: TextureState;\n /** Multiplies transmission weight using the texture's red channel. Default `undefined`. */\n transmissionMap?: TextureState;\n /** Linear thickness-range texture; R and zero minimum preserve multiplication semantics. Default `undefined`. */\n thinFilmMap?: TextureState;\n\n /** Multiplies coatWeight by the linear red channel. Default `undefined`. */\n coatWeightMap?: TextureState;\n /** Multiplies coatRoughness by the linear green channel. Default `undefined`. */\n coatRoughnessMap?: TextureState;\n /** Multiplies fuzzColor by RGB channels using Texture color encoding. Default `undefined`. */\n fuzzColorMap?: TextureState;\n /** Multiplies fuzzRoughness by the linear alpha channel. Default `undefined`. */\n fuzzRoughnessMap?: TextureState;\n /** Multiplies specularWeight by the linear alpha channel. Default `undefined`. */\n specularWeightMap?: TextureState;\n /** Multiplies specularColor by RGB channels using Texture color encoding. Default `undefined`. */\n specularColorMap?: TextureState;\n\n\n /** Source convention for base specular anisotropy. `gltf` converts textured roughness and strength before coat roughening; `openpbr` uses native parameters. Default `openpbr`. */\n specularAnisotropyModel: 'openpbr' | 'gltf' = 'openpbr';\n /** Linear RG tangent direction and B strength multiplier for the base specular layer. Default `undefined`. */\n anisotropyMap?: TextureState;\n /** Independent tangent-space coat normal in linear RGB. Without a map, coat uses the surface normal before base normal mapping. Default `undefined`. */\n coatNormalMap?: TextureState;\n /** XY strength of coatNormalMap; independent of normalScale. Default `[1, 1]`. */\n coatNormalScale: Vec2 = materialDefault('coatNormalScale');\n /** Base direction rotation in radians, counter-clockwise in tangent/bitangent space after RG decoding. Default `0`. */\n specularAnisotropyRotation: number = 0;\n /** Coat direction rotation in radians relative to the geometry tangent. Default `0`. */\n coatAnisotropyRotation: number = 0;\n\n /** GGX roughness anisotropy in [0, 1]; native OpenPBR or source glTF strength according to specularAnisotropyModel. Requires tangents. Default `0`. */\n get specularRoughnessAnisotropy(): number { return this.specularAnisotropy; }\n set specularRoughnessAnisotropy(value: number) { this.specularAnisotropy = value; }\n\n /** OpenPBR coat GGX roughness anisotropy in [0, 1]. Default `0`. */\n get coatRoughnessAnisotropy(): number { return this.coatAnisotropy; }\n set coatRoughnessAnisotropy(value: number) { this.coatAnisotropy = value; }\n\n /** Subsurface scattering anisotropy in [-1, 1]. Default `0`. */\n get subsurfaceScatterAnisotropy(): number { return this.subsurfaceAnisotropy; }\n set subsurfaceScatterAnisotropy(value: number) { this.subsurfaceAnisotropy = value; }\n\n /** Surface coverage; alphaMode controls testing and blending. Default `1`. */\n get geometryOpacity(): number { return this.opacity; }\n set geometryOpacity(value: number) { this.opacity = value; }\n\n /** Treat the surface as an infinitely thin shell. Default `false`. */\n get geometryThinWalled(): boolean { return this.thinWalled; }\n set geometryThinWalled(value: boolean) { this.thinWalled = value; }\n\n // Renderer extensions\n /**\n * Invisible ground that only receives shadows, composited over the\n * background. Default `false`.\n */\n shadowCatcher: boolean = materialDefault('shadowCatcher');\n /** Displays emission without scattering or illuminating other surfaces. Default `false`. */\n unlit: boolean = materialDefault('unlit');\n /** Radius of rounded-edge shading (shader bevel) in scene units. `0` disables it. Default `0`. */\n bevelSize: number = materialDefault('bevelSize');\n /** How map alpha is used: ignored, opacity or transmission. Default `opaque`. */\n mapAlphaUsage: 'opaque' | 'alpha' | 'transmission' = materialDefault('mapAlphaUsage');\n /** Procedural UV projection for textures without (good) UVs. Default `none`. */\n uvProjection: UVProjection = materialDefault('uvProjection');\n /** UV scale used with `uvProjection`. Default `[1, 1]`. */\n uvProjectionScale: Vec2 = materialDefault('uvProjectionScale');\n\n // Displacement\n /** Height texture (red channel) for displacement. Default `undefined`. */\n displacementMap?: TextureState;\n /** Procedural UV projection for the displacement map. Default `none`. */\n displacementUvProjection: UVProjection = materialDefault('displacementUvProjection');\n /** UV scale used with `displacementUvProjection`. Default `1`. */\n displacementUvProjectionScale: number = materialDefault('displacementUvProjectionScale');\n /** Height multiplier in mesh-local coordinate units. Default `0.1`. */\n displacementScale: number = materialDefault('displacementScale');\n /** Offset added after scaling the height map, along the normal in mesh-local units; requires a displacement map. Default `0`. */\n displacementBias: number = materialDefault('displacementBias');\n /** Ray-marching step in mesh-local units; 0 automatically uses abs(displacementScale) / 32. Default `0`. */\n displacementStepSize: number = materialDefault('displacementStepSize');\n\n}\nexport { materialAlphaModeConstants } from '../renderer/materialConstants.js';\n\nexport type ResolvedMaterialAlphaMode = Exclude<MaterialAlphaMode, 'auto'>;\n\nexport function resolveMaterialAlphaMode(\n material: MaterialState\n): ResolvedMaterialAlphaMode {\n if (material.alphaMode !== 'auto') return material.alphaMode;\n if (material.alphaCutoff > 0) return 'mask';\n if (\n material.opacity < 1 ||\n material.mapAlphaUsage === \"alpha\" ||\n material.alphaMap\n ) {\n return 'blend';\n }\n return 'opaque';\n}\n\nexport { materialKeys, materialTextureKeys, materialGeometryKeys, materialParamKeys, getMaterialHashKey, resetMaterialTextureId } from './openPbrSchema.js';\n\n/** Optional material properties; defaults are documented on MaterialState. */\nexport type MaterialStateParams = Partial<MaterialState>;\n"]}
|
package/lib/scene/Mesh.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import OpenPBRMaterial from './OpenPBRMaterial.js';
|
|
1
|
+
import MeshState from './MeshState.js';
|
|
2
|
+
import type Geometry from './Geometry.js';
|
|
3
|
+
import type OpenPBRMaterial from './OpenPBRMaterial.js';
|
|
4
4
|
/**
|
|
5
5
|
* A geometry rendered with one or more materials. With several materials,
|
|
6
6
|
* `geometry.materialIndex` selects the material of each triangle.
|
|
7
7
|
*/
|
|
8
|
-
export default class Mesh extends
|
|
8
|
+
export default class Mesh extends MeshState {
|
|
9
9
|
/** Materials supplied to the constructor, indexed by per-vertex materialIndex. */
|
|
10
10
|
materials: OpenPBRMaterial[];
|
|
11
|
-
/** Indexed triangle geometry supplied to the constructor; no default. */
|
|
12
|
-
geometry: Geometry;
|
|
13
11
|
constructor(geometry: Geometry, material: OpenPBRMaterial[] | OpenPBRMaterial);
|
|
14
12
|
}
|
package/lib/scene/Mesh.js
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import MeshState from './MeshState.js';
|
|
2
2
|
/**
|
|
3
3
|
* A geometry rendered with one or more materials. With several materials,
|
|
4
4
|
* `geometry.materialIndex` selects the material of each triangle.
|
|
5
5
|
*/
|
|
6
|
-
export default class Mesh extends
|
|
7
|
-
|
|
8
|
-
materials;
|
|
9
|
-
/** Indexed triangle geometry supplied to the constructor; no default. */
|
|
10
|
-
geometry;
|
|
11
|
-
constructor(geometry, material) {
|
|
12
|
-
super();
|
|
13
|
-
this.geometry = geometry;
|
|
14
|
-
this.materials = Array.isArray(material) ? material : [material];
|
|
15
|
-
}
|
|
6
|
+
export default class Mesh extends MeshState {
|
|
7
|
+
constructor(geometry, material) { super(geometry, material); }
|
|
16
8
|
}
|
|
17
9
|
//# sourceMappingURL=Mesh.js.map
|
package/lib/scene/Mesh.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mesh.js","sourceRoot":"","sources":["../../src/scene/Mesh.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Mesh.js","sourceRoot":"","sources":["../../src/scene/Mesh.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAIvC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,SAAS;IAGzC,YAAY,QAAkB,EAAE,QAA6C,IAAI,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;CAC9G","sourcesContent":["import MeshState from './MeshState.js';\nimport type Geometry from './Geometry.js';\nimport type OpenPBRMaterial from './OpenPBRMaterial.js';\n\n/**\n * A geometry rendered with one or more materials. With several materials,\n * `geometry.materialIndex` selects the material of each triangle.\n */\nexport default class Mesh extends MeshState {\n /** Materials supplied to the constructor, indexed by per-vertex materialIndex. */\n declare materials: OpenPBRMaterial[];\n constructor(geometry: Geometry, material: OpenPBRMaterial[] | OpenPBRMaterial) { super(geometry, material); }\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Geometry from './Geometry.js';
|
|
2
|
+
import SceneNode from './SceneNode.js';
|
|
3
|
+
import type MaterialState from './MaterialState.js';
|
|
4
|
+
export interface InstanceData {
|
|
5
|
+
count: number;
|
|
6
|
+
transforms: Float32Array;
|
|
7
|
+
colors: Float32Array | undefined;
|
|
8
|
+
transformsVersion: number;
|
|
9
|
+
colorsVersion: number;
|
|
10
|
+
}
|
|
11
|
+
export default class MeshState extends SceneNode {
|
|
12
|
+
/** Stable unsigned object ID, excluding 0xFFFFFFFF. Default process-unique monotonic ID; assign before committing the scene. */
|
|
13
|
+
get aovId(): number;
|
|
14
|
+
set aovId(value: number);
|
|
15
|
+
/** Materials supplied to the constructor, indexed by per-vertex materialIndex. */
|
|
16
|
+
materials: MaterialState[];
|
|
17
|
+
/** Indexed triangle geometry supplied to the constructor; no default. */
|
|
18
|
+
geometry: Geometry;
|
|
19
|
+
constructor(geometry: Geometry, material: MaterialState[] | MaterialState);
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { allocateAovId, validateAovId } from '../renderer/aov.js';
|
|
2
|
+
import SceneNode from './SceneNode.js';
|
|
3
|
+
/**
|
|
4
|
+
* A geometry rendered with one or more materials. With several materials,
|
|
5
|
+
* `geometry.materialIndex` selects the material of each triangle.
|
|
6
|
+
*/
|
|
7
|
+
const aovIds = new WeakMap();
|
|
8
|
+
export default class MeshState extends SceneNode {
|
|
9
|
+
/** Stable unsigned object ID, excluding 0xFFFFFFFF. Default process-unique monotonic ID; assign before committing the scene. */
|
|
10
|
+
get aovId() { return aovIds.get(this); }
|
|
11
|
+
set aovId(value) { aovIds.set(this, validateAovId(value)); }
|
|
12
|
+
/** Materials supplied to the constructor, indexed by per-vertex materialIndex. */
|
|
13
|
+
materials;
|
|
14
|
+
/** Indexed triangle geometry supplied to the constructor; no default. */
|
|
15
|
+
geometry;
|
|
16
|
+
/** @internal */
|
|
17
|
+
_instances;
|
|
18
|
+
/** @internal */
|
|
19
|
+
get instanceData() {
|
|
20
|
+
const state = this._instances;
|
|
21
|
+
return state ? { count: state.count, transforms: state.transforms, colors: state.colors,
|
|
22
|
+
transformsVersion: state.transformsVersion, colorsVersion: state.colorsVersion } : undefined;
|
|
23
|
+
}
|
|
24
|
+
/** @internal Mutable instance state for in-place native updates. */
|
|
25
|
+
get instanceState() { return this._instances; }
|
|
26
|
+
/** @internal */
|
|
27
|
+
setInstanceState(state) { this._instances = state; }
|
|
28
|
+
constructor(geometry, material) {
|
|
29
|
+
super();
|
|
30
|
+
aovIds.set(this, allocateAovId());
|
|
31
|
+
this.geometry = geometry;
|
|
32
|
+
this.materials = Array.isArray(material) ? material : [material];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=MeshState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MeshState.js","sourceRoot":"","sources":["../../src/scene/MeshState.ts"],"names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AQ,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACnE,CAAC;CAEF","sourcesContent":["import { allocateAovId, validateAovId } from '../renderer/aov.js';\nimport Geometry from './Geometry.js';\nimport SceneNode from './SceneNode.js';\nimport type MaterialState from './MaterialState.js';\nimport type InstanceState from './InstanceState.js';\nexport interface InstanceData { count: number; transforms: Float32Array; colors: Float32Array | undefined; transformsVersion: number; colorsVersion: number; }\n\n/**\n * A geometry rendered with one or more materials. With several materials,\n * `geometry.materialIndex` selects the material of each triangle.\n */\nconst aovIds = new WeakMap<MeshState, number>();\nexport default class MeshState extends SceneNode {\n /** Stable unsigned object ID, excluding 0xFFFFFFFF. Default process-unique monotonic ID; assign before committing the scene. */\n get aovId(): number { return aovIds.get(this)!; }\n set aovId(value: number) { aovIds.set(this, validateAovId(value)); }\n /** Materials supplied to the constructor, indexed by per-vertex materialIndex. */\n materials: MaterialState[];\n /** Indexed triangle geometry supplied to the constructor; no default. */\n geometry: Geometry;\n\n /** @internal */\n private _instances?: InstanceState;\n /** @internal */\n get instanceData(): InstanceData | undefined {\n const state = this._instances;\n return state ? {count: state.count, transforms: state.transforms, colors: state.colors,\n transformsVersion: state.transformsVersion, colorsVersion: state.colorsVersion} : undefined;\n }\n /** @internal Mutable instance state for in-place native updates. */\n get instanceState(): InstanceState | undefined { return this._instances; }\n /** @internal */\n setInstanceState(state: InstanceState | undefined) { this._instances = state; }\n\n constructor(\n geometry: Geometry,\n material: MaterialState[] | MaterialState\n ) {\n super();\n aovIds.set(this, allocateAovId());\n\n this.geometry = geometry;\n this.materials = Array.isArray(material) ? material : [material];\n }\n\n}\n"]}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { ColorRGB } from '../types.js';
|
|
1
|
+
import MaterialState from './MaterialState.js';
|
|
3
2
|
import type Texture from './Texture.js';
|
|
4
|
-
|
|
5
|
-
export type UVProjection = 'none' | 'triplanar' | 'spherical' | 'cylindrical';
|
|
6
|
-
export type MaterialAlphaMode = 'auto' | 'opaque' | 'mask' | 'blend';
|
|
3
|
+
export type { UVProjection, MaterialAlphaMode, ResolvedMaterialAlphaMode } from './MaterialState.js';
|
|
7
4
|
export type { MaterialTextureName } from './materialTextureNames.js';
|
|
5
|
+
export { materialAlphaModeConstants, resolveMaterialAlphaMode } from './MaterialState.js';
|
|
6
|
+
export { materialKeys, materialTextureKeys, materialGeometryKeys, materialParamKeys, getMaterialHashKey, resetMaterialTextureId } from './openPbrSchema.js';
|
|
8
7
|
/**
|
|
9
8
|
* OpenPBR 1.1 surface material.
|
|
10
9
|
*
|
|
@@ -21,122 +20,17 @@ export type { MaterialTextureName } from './materialTextureNames.js';
|
|
|
21
20
|
*
|
|
22
21
|
* Edit parameters in place; the next `engine.update()` detects the changes.
|
|
23
22
|
*/
|
|
24
|
-
export default class OpenPBRMaterial {
|
|
23
|
+
export default class OpenPBRMaterial extends MaterialState {
|
|
25
24
|
/** Creates a material. Omitted properties use their documented defaults. */
|
|
26
25
|
constructor(params?: OpenPBRMaterialParams);
|
|
27
|
-
/** Multiplier of diffuse reflection and metallic normal-incidence color; does not scale dielectric specular, transmission or subsurface. Default `1`. */
|
|
28
|
-
baseWeight: number;
|
|
29
|
-
/** Diffuse/metal color. Default `[0.8, 0.8, 0.8]`. */
|
|
30
|
-
baseColor: ColorRGB;
|
|
31
|
-
/** Oren-Nayar style roughness of the diffuse lobe. Default `0`. */
|
|
32
|
-
baseDiffuseRoughness: number;
|
|
33
|
-
/** `0` dielectric, `1` metal. Default `0`. */
|
|
34
|
-
baseMetalness: number;
|
|
35
|
-
/** Dielectric specular strength (via IOR) and overall metallic Fresnel multiplier. Default `1`. */
|
|
36
|
-
specularWeight: number;
|
|
37
|
-
/** Dielectric specular tint and metallic F82 near-grazing tint. Default `[1, 1, 1]`. */
|
|
38
|
-
specularColor: ColorRGB;
|
|
39
|
-
/** Microfacet roughness, `0` mirror to `1` rough; retains source perceptual roughness in `gltf` anisotropy mode. Default `0.3`. */
|
|
40
|
-
specularRoughness: number;
|
|
41
|
-
/** Index of refraction. Default `1.5`. */
|
|
42
|
-
specularIor: number;
|
|
43
|
-
/**
|
|
44
|
-
* GGX anisotropy strength, 0 to 1 (requires tangents); native OpenPBR or source glTF strength according to specularAnisotropyModel. Default `0`.
|
|
45
|
-
* @deprecated Use specularRoughnessAnisotropy.
|
|
46
|
-
*/
|
|
47
|
-
specularAnisotropy: number;
|
|
48
|
-
/** `1` makes the dielectric base fully transmissive (glass). Default `0`. */
|
|
49
|
-
transmissionWeight: number;
|
|
50
|
-
/** Transmission tint, or the medium color at `transmissionDepth`. Default `[1, 1, 1]`. */
|
|
51
|
-
transmissionColor: ColorRGB;
|
|
52
|
-
/** Depth at which `transmissionColor` is reached; `0` tints at the surface. Default `0`. */
|
|
53
|
-
transmissionDepth: number;
|
|
54
|
-
/** Volume scattering color of the transmissive medium. Default `[0, 0, 0]`. */
|
|
55
|
-
transmissionScatter: ColorRGB;
|
|
56
|
-
/** Henyey-Greenstein anisotropy of the medium, -1 to 1. Default `0`. */
|
|
57
|
-
transmissionScatterAnisotropy: number;
|
|
58
|
-
/** Dispersion strength; `> 0` enables spectral rendering. Default `0`. */
|
|
59
|
-
transmissionDispersionScale: number;
|
|
60
|
-
/** Abbe number controlling dispersion. Default `20`. */
|
|
61
|
-
transmissionDispersionAbbeNumber: number;
|
|
62
|
-
/** Subsurface scattering weight. Default `0`. */
|
|
63
|
-
subsurfaceWeight: number;
|
|
64
|
-
/** Subsurface color. Default `[0.8, 0.8, 0.8]`. */
|
|
65
|
-
subsurfaceColor: ColorRGB;
|
|
66
|
-
/** Mean free path in scene units. Default `1`. */
|
|
67
|
-
subsurfaceRadius: number;
|
|
68
|
-
/** Per-channel multiplier of `subsurfaceRadius`. Default `[1, 0.5, 0.25]`. */
|
|
69
|
-
subsurfaceRadiusScale: ColorRGB;
|
|
70
|
-
/**
|
|
71
|
-
* Scattering anisotropy, -1 to 1. Default `0`.
|
|
72
|
-
* @deprecated Use subsurfaceScatterAnisotropy.
|
|
73
|
-
*/
|
|
74
|
-
subsurfaceAnisotropy: number;
|
|
75
|
-
/** Fuzz (sheen) layer weight. Default `0`. */
|
|
76
|
-
fuzzWeight: number;
|
|
77
|
-
/** Fuzz reflection color; substrate attenuation uses white fuzz albedo. Default `[1, 1, 1]`. */
|
|
78
|
-
fuzzColor: ColorRGB;
|
|
79
|
-
/** Fuzz roughness; imported from Three.js `sheenRoughness`. Default `0.5`. */
|
|
80
|
-
fuzzRoughness: number;
|
|
81
|
-
/** Clear coat weight. Default `0`. */
|
|
82
|
-
coatWeight: number;
|
|
83
|
-
/** Squared coat transmittance at normal incidence; colors the base and emission, not coat reflection. Default `[1, 1, 1]`. */
|
|
84
|
-
coatColor: ColorRGB;
|
|
85
|
-
/** Coat roughness. Default `0`. */
|
|
86
|
-
coatRoughness: number;
|
|
87
|
-
/**
|
|
88
|
-
* OpenPBR GGX coat anisotropy, 0 to 1; uses the base geometry tangent. Default `0`.
|
|
89
|
-
* @deprecated Use coatRoughnessAnisotropy.
|
|
90
|
-
*/
|
|
91
|
-
coatAnisotropy: number;
|
|
92
|
-
/** Coat index of refraction. Default `1.6`. */
|
|
93
|
-
coatIor: number;
|
|
94
|
-
/** Internal-reflection darkening: 0 compensates darkening, 1 is physical; absorption remains at 0. Default `1`. */
|
|
95
|
-
coatDarkening: number;
|
|
96
|
-
/** Thin-film interference weight (iridescence). Default `0`. */
|
|
97
|
-
thinFilmWeight: number;
|
|
98
|
-
/** Film thickness in micrometres; maximum endpoint when thinFilmMap is present. Default `0.5`. */
|
|
99
|
-
thinFilmThickness: number;
|
|
100
|
-
/** Film index of refraction. Default `1.4`. */
|
|
101
|
-
thinFilmIor: number;
|
|
102
|
-
/** Thickness at a thinFilmMap sample of zero, in micrometres; ignored without a map. May exceed thinFilmThickness. Default `0`. */
|
|
103
|
-
thinFilmThicknessMinimum: number;
|
|
104
|
-
/** Linear channel sampled by thinFilmMap. Default `r`. */
|
|
105
|
-
thinFilmMapChannel: ThinFilmMapChannel;
|
|
106
|
-
/** Emission color. Default `[1, 1, 1]`. */
|
|
107
|
-
emissionColor: ColorRGB;
|
|
108
|
-
/** Emitted radiance scale; `0` disables emission. Default `0`. */
|
|
109
|
-
emissionLuminance: number;
|
|
110
|
-
/**
|
|
111
|
-
* Coverage, `1` opaque. See `alphaMode`. Default `1`.
|
|
112
|
-
* @deprecated Use geometryOpacity.
|
|
113
|
-
*/
|
|
114
|
-
opacity: number;
|
|
115
|
-
/**
|
|
116
|
-
* Treat the surface as an infinitely thin shell (leaves, paper). Default `false`.
|
|
117
|
-
* @deprecated Use geometryThinWalled.
|
|
118
|
-
*/
|
|
119
|
-
thinWalled: boolean;
|
|
120
|
-
/** Disables geometric back-face culling for this material. Default `false`. */
|
|
121
|
-
doubleSided: boolean;
|
|
122
26
|
/** Base color texture, multiplied with `baseColor` using Texture color encoding. Default `undefined`. */
|
|
123
27
|
map?: Texture;
|
|
124
28
|
/** Standalone opacity texture sampled from its green channel, matching Three.js. Default `undefined`. */
|
|
125
29
|
alphaMap?: Texture;
|
|
126
|
-
/**
|
|
127
|
-
* Coverage for surface and shadow rays: `opaque` ignores alpha inputs,
|
|
128
|
-
* `mask` uses binary alpha testing, `blend` retains fractional coverage.
|
|
129
|
-
* `auto` derives the mode from the alpha inputs. Default `auto`.
|
|
130
|
-
*/
|
|
131
|
-
alphaMode: MaterialAlphaMode;
|
|
132
|
-
/** Alpha-test threshold for `mask` mode; equality is fully covered. Default `0`. */
|
|
133
|
-
alphaCutoff: number;
|
|
134
30
|
/** Emission texture multiplied with `emissionColor`. Default `undefined`. */
|
|
135
31
|
emissiveMap?: Texture;
|
|
136
|
-
/** Tangent-space normal map. */
|
|
32
|
+
/** Tangent-space normal map. Default `undefined`. */
|
|
137
33
|
normalMap?: Texture;
|
|
138
|
-
/** Normal map strength per axis. Default `[1, 1]`. */
|
|
139
|
-
normalScale: Vec2;
|
|
140
34
|
/** glTF-compatible B=metalness, G=specular roughness texture. Default `undefined`. */
|
|
141
35
|
metallicRoughnessMap?: Texture;
|
|
142
36
|
/** Standalone roughness texture sampled from its green channel. Default `undefined`. */
|
|
@@ -159,68 +53,12 @@ export default class OpenPBRMaterial {
|
|
|
159
53
|
specularWeightMap?: Texture;
|
|
160
54
|
/** Multiplies specularColor by RGB channels using Texture color encoding. Default `undefined`. */
|
|
161
55
|
specularColorMap?: Texture;
|
|
162
|
-
/** Source convention for base specular anisotropy. `gltf` converts textured roughness and strength before coat roughening; `openpbr` uses native parameters. Default `openpbr`. */
|
|
163
|
-
specularAnisotropyModel: 'openpbr' | 'gltf';
|
|
164
56
|
/** Linear RG tangent direction and B strength multiplier for the base specular layer. Default `undefined`. */
|
|
165
57
|
anisotropyMap?: Texture;
|
|
166
58
|
/** Independent tangent-space coat normal in linear RGB. Without a map, coat uses the surface normal before base normal mapping. Default `undefined`. */
|
|
167
59
|
coatNormalMap?: Texture;
|
|
168
|
-
/** XY strength of coatNormalMap; independent of normalScale. Default `[1, 1]`. */
|
|
169
|
-
coatNormalScale: Vec2;
|
|
170
|
-
/** Base direction rotation in radians, counter-clockwise in tangent/bitangent space after RG decoding. Default `0`. */
|
|
171
|
-
specularAnisotropyRotation: number;
|
|
172
|
-
/** Coat direction rotation in radians relative to the geometry tangent. Default `0`. */
|
|
173
|
-
coatAnisotropyRotation: number;
|
|
174
|
-
/** GGX roughness anisotropy in [0, 1]; native OpenPBR or source glTF strength according to specularAnisotropyModel. Requires tangents. Default `0`. */
|
|
175
|
-
get specularRoughnessAnisotropy(): number;
|
|
176
|
-
set specularRoughnessAnisotropy(value: number);
|
|
177
|
-
/** OpenPBR coat GGX roughness anisotropy in [0, 1]. Default `0`. */
|
|
178
|
-
get coatRoughnessAnisotropy(): number;
|
|
179
|
-
set coatRoughnessAnisotropy(value: number);
|
|
180
|
-
/** Subsurface scattering anisotropy in [-1, 1]. Default `0`. */
|
|
181
|
-
get subsurfaceScatterAnisotropy(): number;
|
|
182
|
-
set subsurfaceScatterAnisotropy(value: number);
|
|
183
|
-
/** Surface coverage; alphaMode controls testing and blending. Default `1`. */
|
|
184
|
-
get geometryOpacity(): number;
|
|
185
|
-
set geometryOpacity(value: number);
|
|
186
|
-
/** Treat the surface as an infinitely thin shell. Default `false`. */
|
|
187
|
-
get geometryThinWalled(): boolean;
|
|
188
|
-
set geometryThinWalled(value: boolean);
|
|
189
|
-
/**
|
|
190
|
-
* Invisible ground that only receives shadows, composited over the
|
|
191
|
-
* background. Default `false`.
|
|
192
|
-
*/
|
|
193
|
-
shadowCatcher: boolean;
|
|
194
|
-
/** Displays emission without scattering or illuminating other surfaces. Default `false`. */
|
|
195
|
-
unlit: boolean;
|
|
196
|
-
/** Radius of rounded-edge shading (shader bevel) in scene units. `0` disables it. Default `0`. */
|
|
197
|
-
bevelSize: number;
|
|
198
|
-
/** How map alpha is used: ignored, opacity or transmission. Default `opaque`. */
|
|
199
|
-
mapAlphaUsage: 'opaque' | 'alpha' | 'transmission';
|
|
200
|
-
/** Procedural UV projection for textures without (good) UVs. Default `none`. */
|
|
201
|
-
uvProjection: UVProjection;
|
|
202
|
-
/** UV scale used with `uvProjection`. Default `[1, 1]`. */
|
|
203
|
-
uvProjectionScale: Vec2;
|
|
204
60
|
/** Height texture (red channel) for displacement. Default `undefined`. */
|
|
205
61
|
displacementMap?: Texture;
|
|
206
|
-
/** Procedural UV projection for the displacement map. Default `none`. */
|
|
207
|
-
displacementUvProjection: UVProjection;
|
|
208
|
-
/** UV scale used with `displacementUvProjection`. Default `1`. */
|
|
209
|
-
displacementUvProjectionScale: number;
|
|
210
|
-
/** Height multiplier in mesh-local units; 0 removes height variation. Default `0.1`. */
|
|
211
|
-
displacementScale: number;
|
|
212
|
-
/** Offset added after scaling the height map, along the normal in mesh-local units; requires a displacement map. Default `0`. */
|
|
213
|
-
displacementBias: number;
|
|
214
|
-
/** Ray-marching step in mesh-local units; 0 automatically uses abs(displacementScale) / 32. Default `0`. */
|
|
215
|
-
displacementStepSize: number;
|
|
216
62
|
}
|
|
217
|
-
export declare const materialAlphaModeConstants: {
|
|
218
|
-
readonly opaque: 0;
|
|
219
|
-
readonly mask: 1;
|
|
220
|
-
readonly blend: 2;
|
|
221
|
-
};
|
|
222
|
-
export type ResolvedMaterialAlphaMode = Exclude<MaterialAlphaMode, 'auto'>;
|
|
223
|
-
export declare function resolveMaterialAlphaMode(material: OpenPBRMaterial): ResolvedMaterialAlphaMode;
|
|
224
|
-
export { materialKeys, materialTextureKeys, materialGeometryKeys, materialParamKeys, getMaterialHashKey, resetMaterialTextureId } from './openPbrSchema.js';
|
|
225
63
|
/** Optional material properties; defaults are documented on OpenPBRMaterial. */
|
|
226
64
|
export type OpenPBRMaterialParams = Partial<OpenPBRMaterial>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import MaterialState from './MaterialState.js';
|
|
2
|
+
export { materialAlphaModeConstants, resolveMaterialAlphaMode } from './MaterialState.js';
|
|
3
|
+
export { materialKeys, materialTextureKeys, materialGeometryKeys, materialParamKeys, getMaterialHashKey, resetMaterialTextureId } from './openPbrSchema.js';
|
|
2
4
|
/**
|
|
3
5
|
* OpenPBR 1.1 surface material.
|
|
4
6
|
*
|
|
@@ -15,228 +17,8 @@ import { materialDefault, applyMaterialParams } from './openPbrSchema.js';
|
|
|
15
17
|
*
|
|
16
18
|
* Edit parameters in place; the next `engine.update()` detects the changes.
|
|
17
19
|
*/
|
|
18
|
-
export default class OpenPBRMaterial {
|
|
20
|
+
export default class OpenPBRMaterial extends MaterialState {
|
|
19
21
|
/** Creates a material. Omitted properties use their documented defaults. */
|
|
20
|
-
constructor(params = {}) {
|
|
21
|
-
applyMaterialParams(this, params);
|
|
22
|
-
}
|
|
23
|
-
// Base
|
|
24
|
-
/** Multiplier of diffuse reflection and metallic normal-incidence color; does not scale dielectric specular, transmission or subsurface. Default `1`. */
|
|
25
|
-
baseWeight = materialDefault('baseWeight');
|
|
26
|
-
/** Diffuse/metal color. Default `[0.8, 0.8, 0.8]`. */
|
|
27
|
-
baseColor = materialDefault('baseColor');
|
|
28
|
-
/** Oren-Nayar style roughness of the diffuse lobe. Default `0`. */
|
|
29
|
-
baseDiffuseRoughness = materialDefault('baseDiffuseRoughness');
|
|
30
|
-
/** `0` dielectric, `1` metal. Default `0`. */
|
|
31
|
-
baseMetalness = materialDefault('baseMetalness');
|
|
32
|
-
// Specular
|
|
33
|
-
/** Dielectric specular strength (via IOR) and overall metallic Fresnel multiplier. Default `1`. */
|
|
34
|
-
specularWeight = materialDefault('specularWeight');
|
|
35
|
-
/** Dielectric specular tint and metallic F82 near-grazing tint. Default `[1, 1, 1]`. */
|
|
36
|
-
specularColor = materialDefault('specularColor');
|
|
37
|
-
/** Microfacet roughness, `0` mirror to `1` rough; retains source perceptual roughness in `gltf` anisotropy mode. Default `0.3`. */
|
|
38
|
-
specularRoughness = materialDefault('specularRoughness');
|
|
39
|
-
/** Index of refraction. Default `1.5`. */
|
|
40
|
-
specularIor = materialDefault('specularIor');
|
|
41
|
-
/**
|
|
42
|
-
* GGX anisotropy strength, 0 to 1 (requires tangents); native OpenPBR or source glTF strength according to specularAnisotropyModel. Default `0`.
|
|
43
|
-
* @deprecated Use specularRoughnessAnisotropy.
|
|
44
|
-
*/
|
|
45
|
-
specularAnisotropy = materialDefault('specularAnisotropy');
|
|
46
|
-
// Transmission
|
|
47
|
-
/** `1` makes the dielectric base fully transmissive (glass). Default `0`. */
|
|
48
|
-
transmissionWeight = materialDefault('transmissionWeight');
|
|
49
|
-
/** Transmission tint, or the medium color at `transmissionDepth`. Default `[1, 1, 1]`. */
|
|
50
|
-
transmissionColor = materialDefault('transmissionColor');
|
|
51
|
-
/** Depth at which `transmissionColor` is reached; `0` tints at the surface. Default `0`. */
|
|
52
|
-
transmissionDepth = materialDefault('transmissionDepth');
|
|
53
|
-
/** Volume scattering color of the transmissive medium. Default `[0, 0, 0]`. */
|
|
54
|
-
transmissionScatter = materialDefault('transmissionScatter');
|
|
55
|
-
/** Henyey-Greenstein anisotropy of the medium, -1 to 1. Default `0`. */
|
|
56
|
-
transmissionScatterAnisotropy = materialDefault('transmissionScatterAnisotropy');
|
|
57
|
-
/** Dispersion strength; `> 0` enables spectral rendering. Default `0`. */
|
|
58
|
-
transmissionDispersionScale = materialDefault('transmissionDispersionScale');
|
|
59
|
-
/** Abbe number controlling dispersion. Default `20`. */
|
|
60
|
-
transmissionDispersionAbbeNumber = materialDefault('transmissionDispersionAbbeNumber');
|
|
61
|
-
// Subsurface
|
|
62
|
-
/** Subsurface scattering weight. Default `0`. */
|
|
63
|
-
subsurfaceWeight = materialDefault('subsurfaceWeight');
|
|
64
|
-
/** Subsurface color. Default `[0.8, 0.8, 0.8]`. */
|
|
65
|
-
subsurfaceColor = materialDefault('subsurfaceColor');
|
|
66
|
-
/** Mean free path in scene units. Default `1`. */
|
|
67
|
-
subsurfaceRadius = materialDefault('subsurfaceRadius');
|
|
68
|
-
/** Per-channel multiplier of `subsurfaceRadius`. Default `[1, 0.5, 0.25]`. */
|
|
69
|
-
subsurfaceRadiusScale = materialDefault('subsurfaceRadiusScale');
|
|
70
|
-
/**
|
|
71
|
-
* Scattering anisotropy, -1 to 1. Default `0`.
|
|
72
|
-
* @deprecated Use subsurfaceScatterAnisotropy.
|
|
73
|
-
*/
|
|
74
|
-
subsurfaceAnisotropy = materialDefault('subsurfaceAnisotropy');
|
|
75
|
-
// Fuzz (sheen)
|
|
76
|
-
/** Fuzz (sheen) layer weight. Default `0`. */
|
|
77
|
-
fuzzWeight = materialDefault('fuzzWeight');
|
|
78
|
-
/** Fuzz reflection color; substrate attenuation uses white fuzz albedo. Default `[1, 1, 1]`. */
|
|
79
|
-
fuzzColor = materialDefault('fuzzColor');
|
|
80
|
-
/** Fuzz roughness; imported from Three.js `sheenRoughness`. Default `0.5`. */
|
|
81
|
-
fuzzRoughness = materialDefault('fuzzRoughness');
|
|
82
|
-
// Coat
|
|
83
|
-
/** Clear coat weight. Default `0`. */
|
|
84
|
-
coatWeight = materialDefault('coatWeight');
|
|
85
|
-
/** Squared coat transmittance at normal incidence; colors the base and emission, not coat reflection. Default `[1, 1, 1]`. */
|
|
86
|
-
coatColor = materialDefault('coatColor');
|
|
87
|
-
/** Coat roughness. Default `0`. */
|
|
88
|
-
coatRoughness = materialDefault('coatRoughness');
|
|
89
|
-
/**
|
|
90
|
-
* OpenPBR GGX coat anisotropy, 0 to 1; uses the base geometry tangent. Default `0`.
|
|
91
|
-
* @deprecated Use coatRoughnessAnisotropy.
|
|
92
|
-
*/
|
|
93
|
-
coatAnisotropy = materialDefault('coatAnisotropy');
|
|
94
|
-
/** Coat index of refraction. Default `1.6`. */
|
|
95
|
-
coatIor = materialDefault('coatIor');
|
|
96
|
-
/** Internal-reflection darkening: 0 compensates darkening, 1 is physical; absorption remains at 0. Default `1`. */
|
|
97
|
-
coatDarkening = materialDefault('coatDarkening');
|
|
98
|
-
// Thin film
|
|
99
|
-
/** Thin-film interference weight (iridescence). Default `0`. */
|
|
100
|
-
thinFilmWeight = materialDefault('thinFilmWeight');
|
|
101
|
-
/** Film thickness in micrometres; maximum endpoint when thinFilmMap is present. Default `0.5`. */
|
|
102
|
-
thinFilmThickness = materialDefault('thinFilmThickness');
|
|
103
|
-
/** Film index of refraction. Default `1.4`. */
|
|
104
|
-
thinFilmIor = materialDefault('thinFilmIor');
|
|
105
|
-
/** Thickness at a thinFilmMap sample of zero, in micrometres; ignored without a map. May exceed thinFilmThickness. Default `0`. */
|
|
106
|
-
thinFilmThicknessMinimum = materialDefault('thinFilmThicknessMinimum');
|
|
107
|
-
/** Linear channel sampled by thinFilmMap. Default `r`. */
|
|
108
|
-
thinFilmMapChannel = materialDefault('thinFilmMapChannel');
|
|
109
|
-
// Emission and geometry
|
|
110
|
-
/** Emission color. Default `[1, 1, 1]`. */
|
|
111
|
-
emissionColor = materialDefault('emissionColor');
|
|
112
|
-
/** Emitted radiance scale; `0` disables emission. Default `0`. */
|
|
113
|
-
emissionLuminance = materialDefault('emissionLuminance');
|
|
114
|
-
/**
|
|
115
|
-
* Coverage, `1` opaque. See `alphaMode`. Default `1`.
|
|
116
|
-
* @deprecated Use geometryOpacity.
|
|
117
|
-
*/
|
|
118
|
-
opacity = materialDefault('opacity');
|
|
119
|
-
/**
|
|
120
|
-
* Treat the surface as an infinitely thin shell (leaves, paper). Default `false`.
|
|
121
|
-
* @deprecated Use geometryThinWalled.
|
|
122
|
-
*/
|
|
123
|
-
thinWalled = materialDefault('thinWalled');
|
|
124
|
-
/** Disables geometric back-face culling for this material. Default `false`. */
|
|
125
|
-
doubleSided = materialDefault('doubleSided');
|
|
126
|
-
// Textures
|
|
127
|
-
/** Base color texture, multiplied with `baseColor` using Texture color encoding. Default `undefined`. */
|
|
128
|
-
map;
|
|
129
|
-
/** Standalone opacity texture sampled from its green channel, matching Three.js. Default `undefined`. */
|
|
130
|
-
alphaMap;
|
|
131
|
-
/**
|
|
132
|
-
* Coverage for surface and shadow rays: `opaque` ignores alpha inputs,
|
|
133
|
-
* `mask` uses binary alpha testing, `blend` retains fractional coverage.
|
|
134
|
-
* `auto` derives the mode from the alpha inputs. Default `auto`.
|
|
135
|
-
*/
|
|
136
|
-
alphaMode = materialDefault('alphaMode');
|
|
137
|
-
/** Alpha-test threshold for `mask` mode; equality is fully covered. Default `0`. */
|
|
138
|
-
alphaCutoff = materialDefault('alphaCutoff');
|
|
139
|
-
/** Emission texture multiplied with `emissionColor`. Default `undefined`. */
|
|
140
|
-
emissiveMap;
|
|
141
|
-
/** Tangent-space normal map. */
|
|
142
|
-
normalMap;
|
|
143
|
-
/** Normal map strength per axis. Default `[1, 1]`. */
|
|
144
|
-
normalScale = materialDefault('normalScale');
|
|
145
|
-
/** glTF-compatible B=metalness, G=specular roughness texture. Default `undefined`. */
|
|
146
|
-
metallicRoughnessMap;
|
|
147
|
-
/** Standalone roughness texture sampled from its green channel. Default `undefined`. */
|
|
148
|
-
roughnessMap;
|
|
149
|
-
/** Standalone metalness texture sampled from its blue channel. Default `undefined`. */
|
|
150
|
-
metalnessMap;
|
|
151
|
-
/** Multiplies transmission weight using the texture's red channel. Default `undefined`. */
|
|
152
|
-
transmissionMap;
|
|
153
|
-
/** Linear thickness-range texture; R and zero minimum preserve multiplication semantics. Default `undefined`. */
|
|
154
|
-
thinFilmMap;
|
|
155
|
-
/** Multiplies coatWeight by the linear red channel. Default `undefined`. */
|
|
156
|
-
coatWeightMap;
|
|
157
|
-
/** Multiplies coatRoughness by the linear green channel. Default `undefined`. */
|
|
158
|
-
coatRoughnessMap;
|
|
159
|
-
/** Multiplies fuzzColor by RGB channels using Texture color encoding. Default `undefined`. */
|
|
160
|
-
fuzzColorMap;
|
|
161
|
-
/** Multiplies fuzzRoughness by the linear alpha channel. Default `undefined`. */
|
|
162
|
-
fuzzRoughnessMap;
|
|
163
|
-
/** Multiplies specularWeight by the linear alpha channel. Default `undefined`. */
|
|
164
|
-
specularWeightMap;
|
|
165
|
-
/** Multiplies specularColor by RGB channels using Texture color encoding. Default `undefined`. */
|
|
166
|
-
specularColorMap;
|
|
167
|
-
/** Source convention for base specular anisotropy. `gltf` converts textured roughness and strength before coat roughening; `openpbr` uses native parameters. Default `openpbr`. */
|
|
168
|
-
specularAnisotropyModel = 'openpbr';
|
|
169
|
-
/** Linear RG tangent direction and B strength multiplier for the base specular layer. Default `undefined`. */
|
|
170
|
-
anisotropyMap;
|
|
171
|
-
/** Independent tangent-space coat normal in linear RGB. Without a map, coat uses the surface normal before base normal mapping. Default `undefined`. */
|
|
172
|
-
coatNormalMap;
|
|
173
|
-
/** XY strength of coatNormalMap; independent of normalScale. Default `[1, 1]`. */
|
|
174
|
-
coatNormalScale = materialDefault('coatNormalScale');
|
|
175
|
-
/** Base direction rotation in radians, counter-clockwise in tangent/bitangent space after RG decoding. Default `0`. */
|
|
176
|
-
specularAnisotropyRotation = 0;
|
|
177
|
-
/** Coat direction rotation in radians relative to the geometry tangent. Default `0`. */
|
|
178
|
-
coatAnisotropyRotation = 0;
|
|
179
|
-
/** GGX roughness anisotropy in [0, 1]; native OpenPBR or source glTF strength according to specularAnisotropyModel. Requires tangents. Default `0`. */
|
|
180
|
-
get specularRoughnessAnisotropy() { return this.specularAnisotropy; }
|
|
181
|
-
set specularRoughnessAnisotropy(value) { this.specularAnisotropy = value; }
|
|
182
|
-
/** OpenPBR coat GGX roughness anisotropy in [0, 1]. Default `0`. */
|
|
183
|
-
get coatRoughnessAnisotropy() { return this.coatAnisotropy; }
|
|
184
|
-
set coatRoughnessAnisotropy(value) { this.coatAnisotropy = value; }
|
|
185
|
-
/** Subsurface scattering anisotropy in [-1, 1]. Default `0`. */
|
|
186
|
-
get subsurfaceScatterAnisotropy() { return this.subsurfaceAnisotropy; }
|
|
187
|
-
set subsurfaceScatterAnisotropy(value) { this.subsurfaceAnisotropy = value; }
|
|
188
|
-
/** Surface coverage; alphaMode controls testing and blending. Default `1`. */
|
|
189
|
-
get geometryOpacity() { return this.opacity; }
|
|
190
|
-
set geometryOpacity(value) { this.opacity = value; }
|
|
191
|
-
/** Treat the surface as an infinitely thin shell. Default `false`. */
|
|
192
|
-
get geometryThinWalled() { return this.thinWalled; }
|
|
193
|
-
set geometryThinWalled(value) { this.thinWalled = value; }
|
|
194
|
-
// Renderer extensions
|
|
195
|
-
/**
|
|
196
|
-
* Invisible ground that only receives shadows, composited over the
|
|
197
|
-
* background. Default `false`.
|
|
198
|
-
*/
|
|
199
|
-
shadowCatcher = materialDefault('shadowCatcher');
|
|
200
|
-
/** Displays emission without scattering or illuminating other surfaces. Default `false`. */
|
|
201
|
-
unlit = materialDefault('unlit');
|
|
202
|
-
/** Radius of rounded-edge shading (shader bevel) in scene units. `0` disables it. Default `0`. */
|
|
203
|
-
bevelSize = materialDefault('bevelSize');
|
|
204
|
-
/** How map alpha is used: ignored, opacity or transmission. Default `opaque`. */
|
|
205
|
-
mapAlphaUsage = materialDefault('mapAlphaUsage');
|
|
206
|
-
/** Procedural UV projection for textures without (good) UVs. Default `none`. */
|
|
207
|
-
uvProjection = materialDefault('uvProjection');
|
|
208
|
-
/** UV scale used with `uvProjection`. Default `[1, 1]`. */
|
|
209
|
-
uvProjectionScale = materialDefault('uvProjectionScale');
|
|
210
|
-
// Displacement
|
|
211
|
-
/** Height texture (red channel) for displacement. Default `undefined`. */
|
|
212
|
-
displacementMap;
|
|
213
|
-
/** Procedural UV projection for the displacement map. Default `none`. */
|
|
214
|
-
displacementUvProjection = materialDefault('displacementUvProjection');
|
|
215
|
-
/** UV scale used with `displacementUvProjection`. Default `1`. */
|
|
216
|
-
displacementUvProjectionScale = materialDefault('displacementUvProjectionScale');
|
|
217
|
-
/** Height multiplier in mesh-local units; 0 removes height variation. Default `0.1`. */
|
|
218
|
-
displacementScale = materialDefault('displacementScale');
|
|
219
|
-
/** Offset added after scaling the height map, along the normal in mesh-local units; requires a displacement map. Default `0`. */
|
|
220
|
-
displacementBias = materialDefault('displacementBias');
|
|
221
|
-
/** Ray-marching step in mesh-local units; 0 automatically uses abs(displacementScale) / 32. Default `0`. */
|
|
222
|
-
displacementStepSize = materialDefault('displacementStepSize');
|
|
223
|
-
}
|
|
224
|
-
export const materialAlphaModeConstants = {
|
|
225
|
-
opaque: 0,
|
|
226
|
-
mask: 1,
|
|
227
|
-
blend: 2
|
|
228
|
-
};
|
|
229
|
-
export function resolveMaterialAlphaMode(material) {
|
|
230
|
-
if (material.alphaMode !== 'auto')
|
|
231
|
-
return material.alphaMode;
|
|
232
|
-
if (material.alphaCutoff > 0)
|
|
233
|
-
return 'mask';
|
|
234
|
-
if (material.opacity < 1 ||
|
|
235
|
-
material.mapAlphaUsage === "alpha" ||
|
|
236
|
-
material.alphaMap) {
|
|
237
|
-
return 'blend';
|
|
238
|
-
}
|
|
239
|
-
return 'opaque';
|
|
22
|
+
constructor(params = {}) { super(params); }
|
|
240
23
|
}
|
|
241
|
-
export { materialKeys, materialTextureKeys, materialGeometryKeys, materialParamKeys, getMaterialHashKey, resetMaterialTextureId } from './openPbrSchema.js';
|
|
242
24
|
//# sourceMappingURL=OpenPBRMaterial.js.map
|