@aura3d/assets 1.0.6
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/README.md +17 -0
- package/dist/AdvancedAssetCorpus.d.ts +124 -0
- package/dist/AdvancedAssetCorpus.d.ts.map +1 -0
- package/dist/AdvancedAssetCorpus.js +266 -0
- package/dist/AdvancedAssetCorpus.js.map +1 -0
- package/dist/AssetBundleCacheFixtures.d.ts +62 -0
- package/dist/AssetBundleCacheFixtures.d.ts.map +1 -0
- package/dist/AssetBundleCacheFixtures.js +222 -0
- package/dist/AssetBundleCacheFixtures.js.map +1 -0
- package/dist/AssetCache.d.ts +21 -0
- package/dist/AssetCache.d.ts.map +1 -0
- package/dist/AssetCache.js +54 -0
- package/dist/AssetCache.js.map +1 -0
- package/dist/AssetCompatibility.d.ts +54 -0
- package/dist/AssetCompatibility.d.ts.map +1 -0
- package/dist/AssetCompatibility.js +122 -0
- package/dist/AssetCompatibility.js.map +1 -0
- package/dist/AssetCorpus.d.ts +88 -0
- package/dist/AssetCorpus.d.ts.map +1 -0
- package/dist/AssetCorpus.js +215 -0
- package/dist/AssetCorpus.js.map +1 -0
- package/dist/AssetDependencyGraph.d.ts +12 -0
- package/dist/AssetDependencyGraph.d.ts.map +1 -0
- package/dist/AssetDependencyGraph.js +66 -0
- package/dist/AssetDependencyGraph.js.map +1 -0
- package/dist/AssetHandle.d.ts +26 -0
- package/dist/AssetHandle.d.ts.map +1 -0
- package/dist/AssetHandle.js +53 -0
- package/dist/AssetHandle.js.map +1 -0
- package/dist/AssetImportPreflight.d.ts +43 -0
- package/dist/AssetImportPreflight.d.ts.map +1 -0
- package/dist/AssetImportPreflight.js +117 -0
- package/dist/AssetImportPreflight.js.map +1 -0
- package/dist/AssetInspection.d.ts +183 -0
- package/dist/AssetInspection.d.ts.map +1 -0
- package/dist/AssetInspection.js +397 -0
- package/dist/AssetInspection.js.map +1 -0
- package/dist/AssetLoader.d.ts +26 -0
- package/dist/AssetLoader.d.ts.map +1 -0
- package/dist/AssetLoader.js +12 -0
- package/dist/AssetLoader.js.map +1 -0
- package/dist/AssetManager.d.ts +37 -0
- package/dist/AssetManager.d.ts.map +1 -0
- package/dist/AssetManager.js +161 -0
- package/dist/AssetManager.js.map +1 -0
- package/dist/AssetRegistry.d.ts +10 -0
- package/dist/AssetRegistry.d.ts.map +1 -0
- package/dist/AssetRegistry.js +34 -0
- package/dist/AssetRegistry.js.map +1 -0
- package/dist/AssetRenderDefaults.d.ts +13 -0
- package/dist/AssetRenderDefaults.d.ts.map +1 -0
- package/dist/AssetRenderDefaults.js +23 -0
- package/dist/AssetRenderDefaults.js.map +1 -0
- package/dist/AudioLoader.d.ts +17 -0
- package/dist/AudioLoader.d.ts.map +1 -0
- package/dist/AudioLoader.js +23 -0
- package/dist/AudioLoader.js.map +1 -0
- package/dist/BlenderExportValidation.d.ts +64 -0
- package/dist/BlenderExportValidation.d.ts.map +1 -0
- package/dist/BlenderExportValidation.js +143 -0
- package/dist/BlenderExportValidation.js.map +1 -0
- package/dist/CarConceptMaterialStability.d.ts +28 -0
- package/dist/CarConceptMaterialStability.d.ts.map +1 -0
- package/dist/CarConceptMaterialStability.js +1308 -0
- package/dist/CarConceptMaterialStability.js.map +1 -0
- package/dist/EXRLoader.d.ts +2 -0
- package/dist/EXRLoader.d.ts.map +1 -0
- package/dist/EXRLoader.js +2 -0
- package/dist/EXRLoader.js.map +1 -0
- package/dist/ExternalParityGLTFCorpus.d.ts +39 -0
- package/dist/ExternalParityGLTFCorpus.d.ts.map +1 -0
- package/dist/ExternalParityGLTFCorpus.js +32 -0
- package/dist/ExternalParityGLTFCorpus.js.map +1 -0
- package/dist/GLTFAnimationRuntime.d.ts +243 -0
- package/dist/GLTFAnimationRuntime.d.ts.map +1 -0
- package/dist/GLTFAnimationRuntime.js +954 -0
- package/dist/GLTFAnimationRuntime.js.map +1 -0
- package/dist/GLTFCompressionDecoders.d.ts +42 -0
- package/dist/GLTFCompressionDecoders.d.ts.map +1 -0
- package/dist/GLTFCompressionDecoders.js +99 -0
- package/dist/GLTFCompressionDecoders.js.map +1 -0
- package/dist/GLTFExtensionSupport.d.ts +33 -0
- package/dist/GLTFExtensionSupport.d.ts.map +1 -0
- package/dist/GLTFExtensionSupport.js +85 -0
- package/dist/GLTFExtensionSupport.js.map +1 -0
- package/dist/GLTFLoader.d.ts +361 -0
- package/dist/GLTFLoader.d.ts.map +1 -0
- package/dist/GLTFLoader.js +2735 -0
- package/dist/GLTFLoader.js.map +1 -0
- package/dist/GLTFRenderResources.d.ts +162 -0
- package/dist/GLTFRenderResources.d.ts.map +1 -0
- package/dist/GLTFRenderResources.js +1684 -0
- package/dist/GLTFRenderResources.js.map +1 -0
- package/dist/HDRLoader.d.ts +2 -0
- package/dist/HDRLoader.d.ts.map +1 -0
- package/dist/HDRLoader.js +2 -0
- package/dist/HDRLoader.js.map +1 -0
- package/dist/ImageLoader.d.ts +15 -0
- package/dist/ImageLoader.d.ts.map +1 -0
- package/dist/ImageLoader.js +36 -0
- package/dist/ImageLoader.js.map +1 -0
- package/dist/ImportPipeline.d.ts +39 -0
- package/dist/ImportPipeline.d.ts.map +1 -0
- package/dist/ImportPipeline.js +105 -0
- package/dist/ImportPipeline.js.map +1 -0
- package/dist/KTX2BasisTextureTranscoder.d.ts +9 -0
- package/dist/KTX2BasisTextureTranscoder.d.ts.map +1 -0
- package/dist/KTX2BasisTextureTranscoder.js +178 -0
- package/dist/KTX2BasisTextureTranscoder.js.map +1 -0
- package/dist/LoadContext.d.ts +20 -0
- package/dist/LoadContext.d.ts.map +1 -0
- package/dist/LoadContext.js +42 -0
- package/dist/LoadContext.js.map +1 -0
- package/dist/MaterialLoader.d.ts +17 -0
- package/dist/MaterialLoader.d.ts.map +1 -0
- package/dist/MaterialLoader.js +138 -0
- package/dist/MaterialLoader.js.map +1 -0
- package/dist/MeshOptimization.d.ts +20 -0
- package/dist/MeshOptimization.d.ts.map +1 -0
- package/dist/MeshOptimization.js +65 -0
- package/dist/MeshOptimization.js.map +1 -0
- package/dist/OBJLoader.d.ts +13 -0
- package/dist/OBJLoader.d.ts.map +1 -0
- package/dist/OBJLoader.js +492 -0
- package/dist/OBJLoader.js.map +1 -0
- package/dist/SceneAnalysisFixtures.d.ts +100 -0
- package/dist/SceneAnalysisFixtures.d.ts.map +1 -0
- package/dist/SceneAnalysisFixtures.js +331 -0
- package/dist/SceneAnalysisFixtures.js.map +1 -0
- package/dist/SceneLoader.d.ts +27 -0
- package/dist/SceneLoader.d.ts.map +1 -0
- package/dist/SceneLoader.js +40 -0
- package/dist/SceneLoader.js.map +1 -0
- package/dist/ShaderLoader.d.ts +12 -0
- package/dist/ShaderLoader.d.ts.map +1 -0
- package/dist/ShaderLoader.js +18 -0
- package/dist/ShaderLoader.js.map +1 -0
- package/dist/TextureLoader.d.ts +16 -0
- package/dist/TextureLoader.d.ts.map +1 -0
- package/dist/TextureLoader.js +17 -0
- package/dist/TextureLoader.js.map +1 -0
- package/dist/TexturePipeline.d.ts +24 -0
- package/dist/TexturePipeline.d.ts.map +1 -0
- package/dist/TexturePipeline.js +64 -0
- package/dist/TexturePipeline.js.map +1 -0
- package/dist/TextureStreaming.d.ts +10 -0
- package/dist/TextureStreaming.d.ts.map +1 -0
- package/dist/TextureStreaming.js +11 -0
- package/dist/TextureStreaming.js.map +1 -0
- package/dist/WorkerAssetJobs.d.ts +18 -0
- package/dist/WorkerAssetJobs.d.ts.map +1 -0
- package/dist/WorkerAssetJobs.js +37 -0
- package/dist/WorkerAssetJobs.js.map +1 -0
- package/dist/advanced-gallery/index.d.ts +3 -0
- package/dist/advanced-gallery/index.d.ts.map +1 -0
- package/dist/advanced-gallery/index.js +2 -0
- package/dist/advanced-gallery/index.js.map +1 -0
- package/dist/asset-corpus/GLTFSceneLoader.d.ts +3 -0
- package/dist/asset-corpus/GLTFSceneLoader.d.ts.map +1 -0
- package/dist/asset-corpus/GLTFSceneLoader.js +2 -0
- package/dist/asset-corpus/GLTFSceneLoader.js.map +1 -0
- package/dist/asset-corpus/ProductionAssetCorpus.d.ts +89 -0
- package/dist/asset-corpus/ProductionAssetCorpus.d.ts.map +1 -0
- package/dist/asset-corpus/ProductionAssetCorpus.js +116 -0
- package/dist/asset-corpus/ProductionAssetCorpus.js.map +1 -0
- package/dist/asset-corpus/ProductionAssetPipeline.d.ts +3 -0
- package/dist/asset-corpus/ProductionAssetPipeline.d.ts.map +1 -0
- package/dist/asset-corpus/ProductionAssetPipeline.js +3 -0
- package/dist/asset-corpus/ProductionAssetPipeline.js.map +1 -0
- package/dist/asset-corpus/ProductionGLTFRenderPipeline.d.ts +65 -0
- package/dist/asset-corpus/ProductionGLTFRenderPipeline.d.ts.map +1 -0
- package/dist/asset-corpus/ProductionGLTFRenderPipeline.js +110 -0
- package/dist/asset-corpus/ProductionGLTFRenderPipeline.js.map +1 -0
- package/dist/asset-corpus/ProductionHDRTextureLoader.d.ts +8 -0
- package/dist/asset-corpus/ProductionHDRTextureLoader.d.ts.map +1 -0
- package/dist/asset-corpus/ProductionHDRTextureLoader.js +2 -0
- package/dist/asset-corpus/ProductionHDRTextureLoader.js.map +1 -0
- package/dist/asset-corpus/ProductionKTX2TextureLoader.d.ts +7 -0
- package/dist/asset-corpus/ProductionKTX2TextureLoader.d.ts.map +1 -0
- package/dist/asset-corpus/ProductionKTX2TextureLoader.js +2 -0
- package/dist/asset-corpus/ProductionKTX2TextureLoader.js.map +1 -0
- package/dist/asset-corpus/ProductionTextureLoader.d.ts +7 -0
- package/dist/asset-corpus/ProductionTextureLoader.d.ts.map +1 -0
- package/dist/asset-corpus/ProductionTextureLoader.js +2 -0
- package/dist/asset-corpus/ProductionTextureLoader.js.map +1 -0
- package/dist/asset-corpus/index.d.ts +10 -0
- package/dist/asset-corpus/index.d.ts.map +1 -0
- package/dist/asset-corpus/index.js +8 -0
- package/dist/asset-corpus/index.js.map +1 -0
- package/dist/browser-index.d.ts +48 -0
- package/dist/browser-index.d.ts.map +1 -0
- package/dist/browser-index.js +26 -0
- package/dist/browser-index.js.map +1 -0
- package/dist/createRenderableScene.d.ts +23 -0
- package/dist/createRenderableScene.d.ts.map +1 -0
- package/dist/createRenderableScene.js +94 -0
- package/dist/createRenderableScene.js.map +1 -0
- package/dist/index.d.ts +82 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/loadRenderableAsset.d.ts +16 -0
- package/dist/loadRenderableAsset.d.ts.map +1 -0
- package/dist/loadRenderableAsset.js +50 -0
- package/dist/loadRenderableAsset.js.map +1 -0
- package/dist/loaders/CubeTextureLoader.d.ts +4 -0
- package/dist/loaders/CubeTextureLoader.d.ts.map +1 -0
- package/dist/loaders/CubeTextureLoader.js +9 -0
- package/dist/loaders/CubeTextureLoader.js.map +1 -0
- package/dist/loaders/EXRLoader.d.ts +4 -0
- package/dist/loaders/EXRLoader.d.ts.map +1 -0
- package/dist/loaders/EXRLoader.js +10 -0
- package/dist/loaders/EXRLoader.js.map +1 -0
- package/dist/loaders/HDRLoader.d.ts +4 -0
- package/dist/loaders/HDRLoader.d.ts.map +1 -0
- package/dist/loaders/HDRLoader.js +7 -0
- package/dist/loaders/HDRLoader.js.map +1 -0
- package/dist/loaders/KTX2Loader.d.ts +4 -0
- package/dist/loaders/KTX2Loader.d.ts.map +1 -0
- package/dist/loaders/KTX2Loader.js +7 -0
- package/dist/loaders/KTX2Loader.js.map +1 -0
- package/dist/loaders/LoaderDiagnostics.d.ts +18 -0
- package/dist/loaders/LoaderDiagnostics.d.ts.map +1 -0
- package/dist/loaders/LoaderDiagnostics.js +18 -0
- package/dist/loaders/LoaderDiagnostics.js.map +1 -0
- package/dist/loaders/MTLLoader.d.ts +10 -0
- package/dist/loaders/MTLLoader.d.ts.map +1 -0
- package/dist/loaders/MTLLoader.js +14 -0
- package/dist/loaders/MTLLoader.js.map +1 -0
- package/dist/loaders/OBJLoader.d.ts +12 -0
- package/dist/loaders/OBJLoader.d.ts.map +1 -0
- package/dist/loaders/OBJLoader.js +16 -0
- package/dist/loaders/OBJLoader.js.map +1 -0
- package/dist/loaders/TextureLoader.d.ts +6 -0
- package/dist/loaders/TextureLoader.d.ts.map +1 -0
- package/dist/loaders/TextureLoader.js +11 -0
- package/dist/loaders/TextureLoader.js.map +1 -0
- package/dist/loaders/ThreeCompatGLTFLoader.d.ts +10 -0
- package/dist/loaders/ThreeCompatGLTFLoader.d.ts.map +1 -0
- package/dist/loaders/ThreeCompatGLTFLoader.js +13 -0
- package/dist/loaders/ThreeCompatGLTFLoader.js.map +1 -0
- package/dist/loaders/index.d.ts +15 -0
- package/dist/loaders/index.d.ts.map +1 -0
- package/dist/loaders/index.js +10 -0
- package/dist/loaders/index.js.map +1 -0
- package/dist/threejs-compatibility/ThreeCompatAssetProvenance.d.ts +34 -0
- package/dist/threejs-compatibility/ThreeCompatAssetProvenance.d.ts.map +1 -0
- package/dist/threejs-compatibility/ThreeCompatAssetProvenance.js +16 -0
- package/dist/threejs-compatibility/ThreeCompatAssetProvenance.js.map +1 -0
- package/dist/threejs-compatibility/ThreeCompatAssetRegistry.d.ts +29 -0
- package/dist/threejs-compatibility/ThreeCompatAssetRegistry.d.ts.map +1 -0
- package/dist/threejs-compatibility/ThreeCompatAssetRegistry.js +33 -0
- package/dist/threejs-compatibility/ThreeCompatAssetRegistry.js.map +1 -0
- package/dist/threejs-example-parity/index.d.ts +20 -0
- package/dist/threejs-example-parity/index.d.ts.map +1 -0
- package/dist/threejs-example-parity/index.js +218 -0
- package/dist/threejs-example-parity/index.js.map +1 -0
- package/package.json +23 -0
- package/src/AdvancedAssetCorpus.ts +454 -0
- package/src/AssetBundleCacheFixtures.ts +290 -0
- package/src/AssetCache.ts +76 -0
- package/src/AssetCompatibility.ts +224 -0
- package/src/AssetCorpus.ts +329 -0
- package/src/AssetDependencyGraph.ts +83 -0
- package/src/AssetHandle.ts +74 -0
- package/src/AssetImportPreflight.ts +179 -0
- package/src/AssetInspection.ts +706 -0
- package/src/AssetLoader.ts +36 -0
- package/src/AssetManager.ts +211 -0
- package/src/AssetRegistry.ts +44 -0
- package/src/AssetRenderDefaults.ts +36 -0
- package/src/AudioLoader.ts +41 -0
- package/src/BlenderExportValidation.ts +227 -0
- package/src/CarConceptMaterialStability.ts +1405 -0
- package/src/EXRLoader.ts +1 -0
- package/src/ExternalParityGLTFCorpus.ts +65 -0
- package/src/GLTFAnimationRuntime.ts +1221 -0
- package/src/GLTFCompressionDecoders.ts +190 -0
- package/src/GLTFExtensionSupport.ts +138 -0
- package/src/GLTFLoader.ts +4001 -0
- package/src/GLTFRenderResources.ts +2105 -0
- package/src/HDRLoader.ts +1 -0
- package/src/ImageLoader.ts +52 -0
- package/src/ImportPipeline.ts +148 -0
- package/src/KTX2BasisTextureTranscoder.ts +224 -0
- package/src/LoadContext.ts +60 -0
- package/src/MaterialLoader.ts +166 -0
- package/src/MeshOptimization.ts +93 -0
- package/src/OBJLoader.ts +551 -0
- package/src/SceneAnalysisFixtures.ts +438 -0
- package/src/SceneLoader.ts +62 -0
- package/src/ShaderLoader.ts +30 -0
- package/src/TextureLoader.ts +30 -0
- package/src/TexturePipeline.ts +96 -0
- package/src/TextureStreaming.ts +20 -0
- package/src/WorkerAssetJobs.ts +56 -0
- package/src/advanced-gallery/index.ts +18 -0
- package/src/asset-corpus/GLTFSceneLoader.ts +9 -0
- package/src/asset-corpus/ProductionAssetCorpus.ts +230 -0
- package/src/asset-corpus/ProductionAssetPipeline.ts +5 -0
- package/src/asset-corpus/ProductionGLTFRenderPipeline.ts +182 -0
- package/src/asset-corpus/ProductionHDRTextureLoader.ts +2 -0
- package/src/asset-corpus/ProductionKTX2TextureLoader.ts +2 -0
- package/src/asset-corpus/ProductionTextureLoader.ts +2 -0
- package/src/asset-corpus/index.ts +29 -0
- package/src/browser-index.ts +224 -0
- package/src/createRenderableScene.ts +128 -0
- package/src/index.ts +317 -0
- package/src/loadRenderableAsset.ts +67 -0
- package/src/loaders/CubeTextureLoader.ts +8 -0
- package/src/loaders/EXRLoader.ts +10 -0
- package/src/loaders/HDRLoader.ts +7 -0
- package/src/loaders/KTX2Loader.ts +7 -0
- package/src/loaders/LoaderDiagnostics.ts +36 -0
- package/src/loaders/MTLLoader.ts +20 -0
- package/src/loaders/OBJLoader.ts +24 -0
- package/src/loaders/TextureLoader.ts +14 -0
- package/src/loaders/ThreeCompatGLTFLoader.ts +19 -0
- package/src/loaders/index.ts +14 -0
- package/src/threejs-compatibility/ThreeCompatAssetProvenance.ts +51 -0
- package/src/threejs-compatibility/ThreeCompatAssetRegistry.ts +61 -0
- package/src/threejs-example-parity/index.ts +262 -0
- package/tests/assets.test.ts +311 -0
- package/tsconfig.json +7 -0
|
@@ -0,0 +1,1308 @@
|
|
|
1
|
+
const BODY_PATTERN = /Paint [12] (Carmine|Pearl|Pearly|Graphite)|Body.*Color|Panel Sides|BodyRoofPanel|BodyPillars|Upper Shell|UpperShell|BodyUpper|UpperBody|Secondary Panel|Wheel ?Arch|Wheelarches|WheelWell|WheelHouse|Fender|Side ?(Panel|Surface)/i;
|
|
2
|
+
const GLASS_PATTERN = /Glass|Window|Windshield|Canopy|Headlight|Taillight|Brakelight|Signallight|Turnsignal|Light ?Lens|\bLens\b/i;
|
|
3
|
+
const LICENSE_PATTERN = /License(?: Plate)?|LicensePlate|Number ?Plate/i;
|
|
4
|
+
const LIGHT_LENS_PATTERN = /Headlight|Taillight|Brakelight|Signallight|Turnsignal|Signal ?Light|Light ?Lens|\bLens\b|BodyHeadlights|BodyTaillights|BodyTurnsignals/i;
|
|
5
|
+
const DETAIL_PATTERN = /Tireside|Tiretread|Rim[12]|Disc|Brake|Hardware|Mirror|Dashboard|Mechanical|Interior|Floormat|material[-_ ]?2|Gasket|Wiper|Handle|HoodTopgrill|TaillightsPanels|Trim|Moulding|Molding|Weatherstrip|Seal|Wheel ?Arch|Wheelarches|WheelWell|WheelHouse|License(?: Plate)?|LicensePlate|Number ?Plate/i;
|
|
6
|
+
const DARK_TRIM_PATTERN = /Gasket|Wiper|Handle|Mirror|HoodTopgrill|TaillightsPanels|Hardware|material[-_ ]?2|\bTrim\b|Moulding|Molding|Weatherstrip|Seal/i;
|
|
7
|
+
const GALLERY_ROLE_SURFACES = {
|
|
8
|
+
"body-primary-paint": {
|
|
9
|
+
baseColor: [0.72, 0.0065, 0.0038, 1],
|
|
10
|
+
baseColorTextureEnabled: 0,
|
|
11
|
+
normalTextureEnabled: 1,
|
|
12
|
+
normalScale: 0.32,
|
|
13
|
+
occlusionTextureEnabled: 1,
|
|
14
|
+
occlusionStrength: 0.18,
|
|
15
|
+
metallic: 0.06,
|
|
16
|
+
roughness: 0.22,
|
|
17
|
+
specular: 0.62,
|
|
18
|
+
specularColorFactor: [0.56, 0.044, 0.028],
|
|
19
|
+
clearcoat: 0.62,
|
|
20
|
+
clearcoatRoughness: 0.28,
|
|
21
|
+
materialEnvironmentSpecularScale: 0.28,
|
|
22
|
+
envMapIntensity: 0.28,
|
|
23
|
+
emissive: [0, 0, 0],
|
|
24
|
+
emissiveStrength: 0,
|
|
25
|
+
opacity: 1,
|
|
26
|
+
alphaTest: 0,
|
|
27
|
+
transmission: 0,
|
|
28
|
+
metalness: 0.06,
|
|
29
|
+
toneMapped: true
|
|
30
|
+
},
|
|
31
|
+
"body-secondary-paint": {
|
|
32
|
+
baseColor: [0.14, 0.0024, 0.0016, 1],
|
|
33
|
+
baseColorTextureEnabled: 0,
|
|
34
|
+
normalTextureEnabled: 1,
|
|
35
|
+
normalScale: 0.28,
|
|
36
|
+
occlusionTextureEnabled: 1,
|
|
37
|
+
occlusionStrength: 0.2,
|
|
38
|
+
metallic: 0.035,
|
|
39
|
+
roughness: 0.31,
|
|
40
|
+
specular: 0.38,
|
|
41
|
+
specularColorFactor: [0.34, 0.034, 0.024],
|
|
42
|
+
clearcoat: 0.4,
|
|
43
|
+
clearcoatRoughness: 0.4,
|
|
44
|
+
materialEnvironmentSpecularScale: 0.17,
|
|
45
|
+
envMapIntensity: 0.17,
|
|
46
|
+
emissive: [0, 0, 0],
|
|
47
|
+
emissiveStrength: 0,
|
|
48
|
+
opacity: 1,
|
|
49
|
+
alphaTest: 0,
|
|
50
|
+
transmission: 0,
|
|
51
|
+
metalness: 0.035,
|
|
52
|
+
toneMapped: true
|
|
53
|
+
},
|
|
54
|
+
"roof-panel": {
|
|
55
|
+
baseColor: [0.024, 0.028, 0.03, 1],
|
|
56
|
+
baseColorTextureEnabled: 0,
|
|
57
|
+
normalTextureEnabled: 1,
|
|
58
|
+
normalScale: 0.24,
|
|
59
|
+
occlusionTextureEnabled: 1,
|
|
60
|
+
occlusionStrength: 0.34,
|
|
61
|
+
metallic: 0.02,
|
|
62
|
+
roughness: 0.34,
|
|
63
|
+
specular: 0.22,
|
|
64
|
+
specularColorFactor: [0.11, 0.13, 0.14],
|
|
65
|
+
clearcoat: 0.24,
|
|
66
|
+
clearcoatRoughness: 0.42,
|
|
67
|
+
materialEnvironmentSpecularScale: 0.072,
|
|
68
|
+
envMapIntensity: 0.072,
|
|
69
|
+
emissive: [0, 0, 0],
|
|
70
|
+
emissiveStrength: 0,
|
|
71
|
+
opacity: 1,
|
|
72
|
+
alphaTest: 0,
|
|
73
|
+
transmission: 0,
|
|
74
|
+
metalness: 0.02,
|
|
75
|
+
toneMapped: true
|
|
76
|
+
},
|
|
77
|
+
"side-panel": {
|
|
78
|
+
baseColor: [0.026, 0.004, 0.0026, 1],
|
|
79
|
+
baseColorTextureEnabled: 0,
|
|
80
|
+
normalTextureEnabled: 1,
|
|
81
|
+
normalScale: 0.42,
|
|
82
|
+
occlusionTextureEnabled: 1,
|
|
83
|
+
occlusionStrength: 0.62,
|
|
84
|
+
metallic: 0.015,
|
|
85
|
+
roughness: 0.48,
|
|
86
|
+
specular: 0.11,
|
|
87
|
+
specularColorFactor: [0.12, 0.032, 0.022],
|
|
88
|
+
clearcoat: 0.08,
|
|
89
|
+
clearcoatRoughness: 0.62,
|
|
90
|
+
materialEnvironmentSpecularScale: 0.04,
|
|
91
|
+
envMapIntensity: 0.04,
|
|
92
|
+
emissive: [0, 0, 0],
|
|
93
|
+
emissiveStrength: 0,
|
|
94
|
+
opacity: 1,
|
|
95
|
+
alphaTest: 0,
|
|
96
|
+
transmission: 0,
|
|
97
|
+
metalness: 0.015,
|
|
98
|
+
toneMapped: true
|
|
99
|
+
},
|
|
100
|
+
"pillar-trim": {
|
|
101
|
+
baseColor: [0.014, 0.016, 0.018, 1],
|
|
102
|
+
baseColorTextureEnabled: 0,
|
|
103
|
+
normalTextureEnabled: 0,
|
|
104
|
+
normalScale: 0,
|
|
105
|
+
occlusionTextureEnabled: 1,
|
|
106
|
+
occlusionStrength: 0.018,
|
|
107
|
+
metallic: 0,
|
|
108
|
+
roughness: 0.74,
|
|
109
|
+
specular: 0.026,
|
|
110
|
+
specularColorFactor: [0.032, 0.03, 0.028],
|
|
111
|
+
clearcoat: 0,
|
|
112
|
+
clearcoatRoughness: 1,
|
|
113
|
+
materialEnvironmentSpecularScale: 0.006,
|
|
114
|
+
envMapIntensity: 0.006,
|
|
115
|
+
emissive: [0, 0, 0],
|
|
116
|
+
emissiveStrength: 0,
|
|
117
|
+
opacity: 1,
|
|
118
|
+
alphaTest: 0,
|
|
119
|
+
transmission: 0,
|
|
120
|
+
metalness: 0,
|
|
121
|
+
toneMapped: true
|
|
122
|
+
},
|
|
123
|
+
"dark-trim": {
|
|
124
|
+
baseColor: [0.012, 0.012, 0.013, 1],
|
|
125
|
+
baseColorTextureEnabled: 0,
|
|
126
|
+
normalTextureEnabled: 0,
|
|
127
|
+
normalScale: 0,
|
|
128
|
+
occlusionTextureEnabled: 1,
|
|
129
|
+
occlusionStrength: 0.018,
|
|
130
|
+
metallic: 0,
|
|
131
|
+
roughness: 0.74,
|
|
132
|
+
specular: 0.026,
|
|
133
|
+
specularColorFactor: [0.032, 0.03, 0.028],
|
|
134
|
+
clearcoat: 0,
|
|
135
|
+
clearcoatRoughness: 1,
|
|
136
|
+
materialEnvironmentSpecularScale: 0.006,
|
|
137
|
+
envMapIntensity: 0.006,
|
|
138
|
+
emissive: [0, 0, 0],
|
|
139
|
+
emissiveStrength: 0,
|
|
140
|
+
opacity: 1,
|
|
141
|
+
alphaTest: 0,
|
|
142
|
+
transmission: 0,
|
|
143
|
+
metalness: 0,
|
|
144
|
+
toneMapped: true
|
|
145
|
+
},
|
|
146
|
+
glass: {
|
|
147
|
+
baseColor: [0.008, 0.018, 0.024, 1],
|
|
148
|
+
baseColorTextureEnabled: 0,
|
|
149
|
+
normalTextureEnabled: 0,
|
|
150
|
+
normalScale: 0,
|
|
151
|
+
occlusionTextureEnabled: 1,
|
|
152
|
+
occlusionStrength: 0.12,
|
|
153
|
+
metallic: 0,
|
|
154
|
+
roughness: 0.28,
|
|
155
|
+
specular: 0.16,
|
|
156
|
+
specularColorFactor: [0.055, 0.072, 0.086],
|
|
157
|
+
clearcoat: 0.06,
|
|
158
|
+
clearcoatRoughness: 0.48,
|
|
159
|
+
materialEnvironmentSpecularScale: 0.052,
|
|
160
|
+
envMapIntensity: 0.052,
|
|
161
|
+
emissive: [0, 0, 0],
|
|
162
|
+
emissiveStrength: 0,
|
|
163
|
+
opacity: 1,
|
|
164
|
+
alphaTest: 0,
|
|
165
|
+
transmission: 0,
|
|
166
|
+
metalness: 0,
|
|
167
|
+
toneMapped: true
|
|
168
|
+
},
|
|
169
|
+
"light-lens": {
|
|
170
|
+
baseColor: [0.018, 0.014, 0.012, 1],
|
|
171
|
+
baseColorTextureEnabled: 0,
|
|
172
|
+
normalTextureEnabled: 0,
|
|
173
|
+
normalScale: 0,
|
|
174
|
+
occlusionTextureEnabled: 1,
|
|
175
|
+
occlusionStrength: 0.05,
|
|
176
|
+
metallic: 0,
|
|
177
|
+
roughness: 0.42,
|
|
178
|
+
specular: 0.09,
|
|
179
|
+
specularColorFactor: [0.08, 0.056, 0.04],
|
|
180
|
+
clearcoat: 0.04,
|
|
181
|
+
clearcoatRoughness: 0.66,
|
|
182
|
+
materialEnvironmentSpecularScale: 0.018,
|
|
183
|
+
envMapIntensity: 0.018,
|
|
184
|
+
emissive: [0, 0, 0],
|
|
185
|
+
emissiveStrength: 0,
|
|
186
|
+
opacity: 1,
|
|
187
|
+
alphaTest: 0,
|
|
188
|
+
transmission: 0,
|
|
189
|
+
metalness: 0,
|
|
190
|
+
toneMapped: true
|
|
191
|
+
},
|
|
192
|
+
"license-plate": {
|
|
193
|
+
baseColor: [0.46, 0.44, 0.38, 1],
|
|
194
|
+
baseColorTextureEnabled: 0,
|
|
195
|
+
normalTextureEnabled: 0,
|
|
196
|
+
normalScale: 0,
|
|
197
|
+
occlusionTextureEnabled: 1,
|
|
198
|
+
occlusionStrength: 0.28,
|
|
199
|
+
metallic: 0,
|
|
200
|
+
roughness: 0.78,
|
|
201
|
+
specular: 0.04,
|
|
202
|
+
specularColorFactor: [0.042, 0.04, 0.035],
|
|
203
|
+
clearcoat: 0,
|
|
204
|
+
clearcoatRoughness: 1,
|
|
205
|
+
materialEnvironmentSpecularScale: 0.006,
|
|
206
|
+
envMapIntensity: 0.006,
|
|
207
|
+
emissive: [0, 0, 0],
|
|
208
|
+
emissiveStrength: 0,
|
|
209
|
+
opacity: 1,
|
|
210
|
+
alphaTest: 0,
|
|
211
|
+
transmission: 0,
|
|
212
|
+
metalness: 0,
|
|
213
|
+
toneMapped: true
|
|
214
|
+
},
|
|
215
|
+
tire: {
|
|
216
|
+
baseColor: [0.014, 0.014, 0.013, 1],
|
|
217
|
+
baseColorTextureEnabled: 0,
|
|
218
|
+
normalTextureEnabled: 1,
|
|
219
|
+
normalScale: 0.24,
|
|
220
|
+
occlusionTextureEnabled: 1,
|
|
221
|
+
occlusionStrength: 0.18,
|
|
222
|
+
metallic: 0,
|
|
223
|
+
roughness: 0.78,
|
|
224
|
+
specular: 0.038,
|
|
225
|
+
specularColorFactor: [0.035, 0.035, 0.034],
|
|
226
|
+
clearcoat: 0,
|
|
227
|
+
clearcoatRoughness: 1,
|
|
228
|
+
materialEnvironmentSpecularScale: 0.012,
|
|
229
|
+
envMapIntensity: 0.012,
|
|
230
|
+
emissive: [0, 0, 0],
|
|
231
|
+
emissiveStrength: 0,
|
|
232
|
+
opacity: 1,
|
|
233
|
+
alphaTest: 0,
|
|
234
|
+
transmission: 0,
|
|
235
|
+
metalness: 0,
|
|
236
|
+
toneMapped: true
|
|
237
|
+
},
|
|
238
|
+
"wheel-metal": {
|
|
239
|
+
baseColor: [0.46, 0.44, 0.38, 1],
|
|
240
|
+
baseColorTextureEnabled: 0,
|
|
241
|
+
normalTextureEnabled: 1,
|
|
242
|
+
normalScale: 0.07,
|
|
243
|
+
occlusionTextureEnabled: 1,
|
|
244
|
+
occlusionStrength: 0.055,
|
|
245
|
+
metallic: 0.9,
|
|
246
|
+
roughness: 0.22,
|
|
247
|
+
specular: 0.52,
|
|
248
|
+
specularColorFactor: [0.5, 0.46, 0.38],
|
|
249
|
+
clearcoat: 0.08,
|
|
250
|
+
clearcoatRoughness: 1,
|
|
251
|
+
materialEnvironmentSpecularScale: 0.16,
|
|
252
|
+
envMapIntensity: 0.16,
|
|
253
|
+
emissive: [0, 0, 0],
|
|
254
|
+
emissiveStrength: 0,
|
|
255
|
+
opacity: 1,
|
|
256
|
+
alphaTest: 0,
|
|
257
|
+
transmission: 0,
|
|
258
|
+
metalness: 0.9,
|
|
259
|
+
toneMapped: true
|
|
260
|
+
},
|
|
261
|
+
brake: {
|
|
262
|
+
baseColor: [0.48, 0.028, 0.018, 1],
|
|
263
|
+
baseColorTextureEnabled: 0,
|
|
264
|
+
normalTextureEnabled: 1,
|
|
265
|
+
normalScale: 0.06,
|
|
266
|
+
occlusionTextureEnabled: 1,
|
|
267
|
+
occlusionStrength: 0.08,
|
|
268
|
+
metallic: 0,
|
|
269
|
+
roughness: 0.62,
|
|
270
|
+
specular: 0.055,
|
|
271
|
+
specularColorFactor: [0.055, 0.026, 0.018],
|
|
272
|
+
clearcoat: 0,
|
|
273
|
+
clearcoatRoughness: 1,
|
|
274
|
+
materialEnvironmentSpecularScale: 0.012,
|
|
275
|
+
envMapIntensity: 0.012,
|
|
276
|
+
emissive: [0, 0, 0],
|
|
277
|
+
emissiveStrength: 0,
|
|
278
|
+
opacity: 1,
|
|
279
|
+
alphaTest: 0,
|
|
280
|
+
transmission: 0,
|
|
281
|
+
metalness: 0,
|
|
282
|
+
toneMapped: true
|
|
283
|
+
},
|
|
284
|
+
interior: {
|
|
285
|
+
baseColor: [0.22, 0.048, 0.036, 1],
|
|
286
|
+
baseColorTextureEnabled: 0,
|
|
287
|
+
normalTextureEnabled: 1,
|
|
288
|
+
normalScale: 0.085,
|
|
289
|
+
occlusionTextureEnabled: 1,
|
|
290
|
+
occlusionStrength: 0.08,
|
|
291
|
+
metallic: 0,
|
|
292
|
+
roughness: 0.52,
|
|
293
|
+
specular: 0.09,
|
|
294
|
+
specularColorFactor: [0.09, 0.046, 0.035],
|
|
295
|
+
clearcoat: 0.035,
|
|
296
|
+
clearcoatRoughness: 0.72,
|
|
297
|
+
materialEnvironmentSpecularScale: 0.025,
|
|
298
|
+
envMapIntensity: 0.025,
|
|
299
|
+
emissive: [0, 0, 0],
|
|
300
|
+
emissiveStrength: 0,
|
|
301
|
+
opacity: 1,
|
|
302
|
+
alphaTest: 0,
|
|
303
|
+
transmission: 0,
|
|
304
|
+
metalness: 0,
|
|
305
|
+
toneMapped: true
|
|
306
|
+
},
|
|
307
|
+
mechanical: {
|
|
308
|
+
baseColor: [0.012, 0.012, 0.012, 1],
|
|
309
|
+
baseColorTextureEnabled: 0,
|
|
310
|
+
normalTextureEnabled: 1,
|
|
311
|
+
normalScale: 0.06,
|
|
312
|
+
occlusionTextureEnabled: 1,
|
|
313
|
+
occlusionStrength: 0.08,
|
|
314
|
+
metallic: 0,
|
|
315
|
+
roughness: 0.74,
|
|
316
|
+
specular: 0.026,
|
|
317
|
+
specularColorFactor: [0.028, 0.028, 0.026],
|
|
318
|
+
clearcoat: 0,
|
|
319
|
+
clearcoatRoughness: 1,
|
|
320
|
+
materialEnvironmentSpecularScale: 0.008,
|
|
321
|
+
envMapIntensity: 0.008,
|
|
322
|
+
emissive: [0, 0, 0],
|
|
323
|
+
emissiveStrength: 0,
|
|
324
|
+
opacity: 1,
|
|
325
|
+
alphaTest: 0,
|
|
326
|
+
transmission: 0,
|
|
327
|
+
metalness: 0,
|
|
328
|
+
toneMapped: true
|
|
329
|
+
}
|
|
330
|
+
};
|
|
331
|
+
export function carConceptMaterialRenderStateOverrides(context = "product-configurator") {
|
|
332
|
+
const product = context === "product-configurator";
|
|
333
|
+
return [
|
|
334
|
+
{
|
|
335
|
+
materialName: BODY_PATTERN,
|
|
336
|
+
renderState: { cullMode: "back", blend: false, depthTest: true, depthWrite: true },
|
|
337
|
+
reason: product
|
|
338
|
+
? "Product car body panels are double-sided in the source GLB; culling back faces prevents subpixel bright seam halos without hiding the original car asset."
|
|
339
|
+
: "Concept-car body panels must not render as double-sided HDR edge overlays in the currentRoutes flagship viewer."
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
materialName: GLASS_PATTERN,
|
|
343
|
+
renderState: { cullMode: "back", blend: false, depthTest: true, depthWrite: true },
|
|
344
|
+
reason: product
|
|
345
|
+
? "Product car glass is rendered as depth-writing dark glazing because the source transmissive/no-depth overlay creates pale HDR silhouette speckle around the windshield and roofline."
|
|
346
|
+
: "Concept-car glass has transmission metadata, but this viewer has no scene-color refraction pass; opaque depth-writing glass prevents white no-depth halos."
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
materialName: DETAIL_PATTERN,
|
|
350
|
+
renderState: { cullMode: "back", blend: false, depthTest: true, depthWrite: true },
|
|
351
|
+
reason: product
|
|
352
|
+
? "Product wheel, tire, trim, and interior detail should not render as blended/no-depth overlay noise in the car hero."
|
|
353
|
+
: "Concept-car trim, wheels, and interior detail must not render as blended HDR speckle overlays."
|
|
354
|
+
}
|
|
355
|
+
];
|
|
356
|
+
}
|
|
357
|
+
export function applyCarConceptMaterialStability(material, options = {}) {
|
|
358
|
+
const profile = options.profile ?? "gallery";
|
|
359
|
+
if (profile === "cinematic") {
|
|
360
|
+
applyCinematicCarConceptMaterialStability(material, options);
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
applyGalleryCarConceptMaterialStability(material, options);
|
|
364
|
+
}
|
|
365
|
+
export function carConceptMaterialVisualRole(context) {
|
|
366
|
+
const node = context.nodeName ?? "";
|
|
367
|
+
const materialName = `${context.materialKey ?? ""} ${context.sourceMaterialName ?? ""}`;
|
|
368
|
+
const identity = `${node} ${materialName}`;
|
|
369
|
+
if (/BodyRoofPanel|\bRoof\b|Upper Shell|UpperShell|BodyUpper|UpperBody|Top(Panel|Shell)|CanopyPanel|Canopy Shell/i.test(identity))
|
|
370
|
+
return "roof-panel";
|
|
371
|
+
if (/Panel Sides|mesh-85-primitive|Side ?(Panel|Panels|Surface|Surfaces|Skirt|Sill)|Wheel ?Arch|Wheelarches|WheelWell|WheelHouse|Fender|QuarterPanel|Rocker/i.test(identity))
|
|
372
|
+
return "side-panel";
|
|
373
|
+
if (/BodyPillars|PillarTrim|(^|\b)[ABC][-_ ]?Pillar/i.test(identity))
|
|
374
|
+
return "pillar-trim";
|
|
375
|
+
if (LICENSE_PATTERN.test(identity))
|
|
376
|
+
return "license-plate";
|
|
377
|
+
if (/Tireside|Tiretread|mesh-(89|91|93|95)-primitive/i.test(identity))
|
|
378
|
+
return "tire";
|
|
379
|
+
if (/BrakePad/i.test(node) || (/\bBrake\b/i.test(materialName) && !/Brakelight|Brake Light/i.test(identity)))
|
|
380
|
+
return "brake";
|
|
381
|
+
if (/Rim[12]|BrakeDisc|Disc|mesh-(90|92|94|96)-primitive/i.test(identity))
|
|
382
|
+
return "wheel-metal";
|
|
383
|
+
if (/Interior|Dashboard|Seats|Steering|Pedal|Floormat|Cockpit|Cabin|Console/i.test(identity))
|
|
384
|
+
return "interior";
|
|
385
|
+
if (/Mechanical|Engine|Axles|BodyUnderside|BodyHoodUnder/i.test(identity))
|
|
386
|
+
return "mechanical";
|
|
387
|
+
if (DARK_TRIM_PATTERN.test(identity))
|
|
388
|
+
return "dark-trim";
|
|
389
|
+
if (LIGHT_LENS_PATTERN.test(identity))
|
|
390
|
+
return "light-lens";
|
|
391
|
+
if (GLASS_PATTERN.test(identity))
|
|
392
|
+
return "glass";
|
|
393
|
+
if (/BodyDoor.*Color1|BodyHood$|BodyRearPanelsColor1|Paint 1 (Carmine|Pearl|Pearly|Graphite)/i.test(identity))
|
|
394
|
+
return "body-primary-paint";
|
|
395
|
+
if (/BodyDoor.*Color2|BodyPanelsColor2|Paint 2 (Carmine|Pearl|Pearly|Graphite)|Secondary Panel/i.test(identity))
|
|
396
|
+
return "body-secondary-paint";
|
|
397
|
+
if (/^Body/i.test(node) && /Panel|Shell|Surface|Door|Hood|Fender|Arch/i.test(node)) {
|
|
398
|
+
return /Color2|Secondary|Paint 2/i.test(identity) ? "body-secondary-paint" : "body-primary-paint";
|
|
399
|
+
}
|
|
400
|
+
return "unclassified";
|
|
401
|
+
}
|
|
402
|
+
function applyGalleryCarConceptMaterialStability(material, options) {
|
|
403
|
+
const name = `${options.materialKey ?? ""} ${options.sourceMaterialName ?? ""} ${material.name}`;
|
|
404
|
+
const role = options.nodeName ? carConceptMaterialVisualRole(options) : "unclassified";
|
|
405
|
+
if (/Paint [12] (Carmine|Pearl|Pearly|Graphite)|Body.*Color/i.test(name)) {
|
|
406
|
+
if (/Paint 1 Carmine|Body.*Color/i.test(name)) {
|
|
407
|
+
material.setParameter("u_baseColor", [0.42, 0.008, 0.005, 1]);
|
|
408
|
+
}
|
|
409
|
+
if (/Paint 2 Carmine/i.test(name)) {
|
|
410
|
+
material.setParameter("u_baseColor", [0.24, 0.016, 0.012, 1]);
|
|
411
|
+
}
|
|
412
|
+
if (/Paint [12] (Pearl|Pearly)/i.test(name)) {
|
|
413
|
+
material.setParameter("u_baseColor", [0.34, 0.18, 0.15, 1]);
|
|
414
|
+
}
|
|
415
|
+
if (/Paint [12] Graphite/i.test(name)) {
|
|
416
|
+
material.setParameter("u_baseColor", [0.08, 0.088, 0.092, 1]);
|
|
417
|
+
}
|
|
418
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
419
|
+
material.setParameter("u_normalTextureEnabled", 1);
|
|
420
|
+
material.setParameter("u_normalScale", 0.035);
|
|
421
|
+
material.setParameter("u_metallicRoughnessTextureEnabled", 0);
|
|
422
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
423
|
+
material.setParameter("u_occlusionStrength", 0.035);
|
|
424
|
+
material.setParameter("u_specularTextureEnabled", 0);
|
|
425
|
+
material.setParameter("u_specularColorTextureEnabled", 0);
|
|
426
|
+
material.setParameter("u_metallic", 0);
|
|
427
|
+
material.setParameter("u_roughness", 0.37);
|
|
428
|
+
material.setParameter("u_specularFactor", 0.22);
|
|
429
|
+
material.setParameter("u_specularColorFactor", [0.28, 0.05, 0.034]);
|
|
430
|
+
material.setParameter("u_clearcoatTextureEnabled", 0);
|
|
431
|
+
material.setParameter("u_clearcoatRoughnessTextureEnabled", 0);
|
|
432
|
+
material.setParameter("u_clearcoatNormalTextureEnabled", 0);
|
|
433
|
+
material.setParameter("u_clearcoatNormalScale", 0);
|
|
434
|
+
material.setParameter("u_clearcoatFactor", 0.28);
|
|
435
|
+
material.setParameter("u_clearcoatRoughnessFactor", 0.58);
|
|
436
|
+
material.setParameter("u_iridescenceTextureEnabled", 0);
|
|
437
|
+
material.setParameter("u_iridescenceThicknessTextureEnabled", 0);
|
|
438
|
+
material.setParameter("u_iridescenceFactor", 0);
|
|
439
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.055);
|
|
440
|
+
if (/Paint 1 Carmine|Body.*Color/i.test(name)) {
|
|
441
|
+
material.setParameter("u_normalScale", 0.052);
|
|
442
|
+
material.setParameter("u_occlusionStrength", 0.052);
|
|
443
|
+
material.setParameter("u_metallic", 0.08);
|
|
444
|
+
material.setParameter("u_roughness", 0.34);
|
|
445
|
+
material.setParameter("u_specularFactor", 0.18);
|
|
446
|
+
material.setParameter("u_specularColorFactor", [0.18, 0.03, 0.02]);
|
|
447
|
+
material.setParameter("u_clearcoatFactor", 0.18);
|
|
448
|
+
material.setParameter("u_clearcoatRoughnessFactor", 0.68);
|
|
449
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.06);
|
|
450
|
+
}
|
|
451
|
+
if (/Paint 2 Carmine/i.test(name)) {
|
|
452
|
+
material.setParameter("u_normalScale", 0.034);
|
|
453
|
+
material.setParameter("u_occlusionStrength", 0.07);
|
|
454
|
+
material.setParameter("u_metallic", 0.05);
|
|
455
|
+
material.setParameter("u_roughness", 0.46);
|
|
456
|
+
material.setParameter("u_specularFactor", 0.1);
|
|
457
|
+
material.setParameter("u_specularColorFactor", [0.095, 0.03, 0.024]);
|
|
458
|
+
material.setParameter("u_clearcoatFactor", 0.09);
|
|
459
|
+
material.setParameter("u_clearcoatRoughnessFactor", 0.72);
|
|
460
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.028);
|
|
461
|
+
}
|
|
462
|
+
if (/Paint [12] (Pearl|Pearly)/i.test(name)) {
|
|
463
|
+
material.setParameter("u_baseColor", [0.34, 0.18, 0.15, 1]);
|
|
464
|
+
material.setParameter("u_normalScale", 0.016);
|
|
465
|
+
material.setParameter("u_occlusionStrength", 0.026);
|
|
466
|
+
material.setParameter("u_roughness", 0.58);
|
|
467
|
+
material.setParameter("u_specularFactor", 0.065);
|
|
468
|
+
material.setParameter("u_specularColorFactor", [0.07, 0.046, 0.04]);
|
|
469
|
+
material.setParameter("u_clearcoatFactor", 0.055);
|
|
470
|
+
material.setParameter("u_clearcoatRoughnessFactor", 0.72);
|
|
471
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.014);
|
|
472
|
+
}
|
|
473
|
+
if (/Paint [12] Graphite/i.test(name)) {
|
|
474
|
+
material.setParameter("u_normalScale", 0.014);
|
|
475
|
+
material.setParameter("u_occlusionStrength", 0.02);
|
|
476
|
+
material.setParameter("u_roughness", 0.62);
|
|
477
|
+
material.setParameter("u_specularFactor", 0.045);
|
|
478
|
+
material.setParameter("u_specularColorFactor", [0.045, 0.047, 0.05]);
|
|
479
|
+
material.setParameter("u_clearcoatFactor", 0.04);
|
|
480
|
+
material.setParameter("u_clearcoatRoughnessFactor", 0.68);
|
|
481
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.012);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
applyGalleryCarConceptLegacyRoleBlocks(material, name);
|
|
485
|
+
if (role !== "unclassified") {
|
|
486
|
+
applyGalleryCarConceptMaterialVisualRoleStability(material, role);
|
|
487
|
+
finalizeGalleryCarConceptMaterialVisualRole(material, role, options);
|
|
488
|
+
}
|
|
489
|
+
else if (BODY_PATTERN.test(name) || GLASS_PATTERN.test(name) || DETAIL_PATTERN.test(name)) {
|
|
490
|
+
applyCarConceptOpaqueRuntimeSurface(material, {
|
|
491
|
+
opacity: 1,
|
|
492
|
+
alphaTest: 0,
|
|
493
|
+
transmission: 0,
|
|
494
|
+
clearcoat: numberParameter(material, "u_clearcoatFactor") ?? 0,
|
|
495
|
+
specular: numberParameter(material, "u_specularFactor") ?? 0,
|
|
496
|
+
metalness: numberParameter(material, "u_metallic") ?? 0,
|
|
497
|
+
roughness: numberParameter(material, "u_roughness") ?? 0.72,
|
|
498
|
+
envMapIntensity: numberParameter(material, "u_materialEnvironmentSpecularScale") ?? 0,
|
|
499
|
+
emissive: vector3Parameter(material, "u_emissiveColor") ?? [0, 0, 0],
|
|
500
|
+
toneMapped: true
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
function applyGalleryCarConceptMaterialVisualRoleStability(material, role) {
|
|
505
|
+
disableCarConceptHdrExtensionEscape(material);
|
|
506
|
+
if (role === "body-primary-paint") {
|
|
507
|
+
material.setParameter("u_baseColor", [0.9, 0.012, 0.0065, 1]);
|
|
508
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
509
|
+
material.setParameter("u_normalTextureEnabled", 1);
|
|
510
|
+
material.setParameter("u_normalScale", 0.56);
|
|
511
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
512
|
+
material.setParameter("u_occlusionStrength", 0.78);
|
|
513
|
+
material.setParameter("u_metallic", 0.08);
|
|
514
|
+
material.setParameter("u_roughness", 0.28);
|
|
515
|
+
material.setParameter("u_specularFactor", 0.48);
|
|
516
|
+
material.setParameter("u_specularColorFactor", [0.48, 0.055, 0.035]);
|
|
517
|
+
material.setParameter("u_clearcoatFactor", 0.52);
|
|
518
|
+
material.setParameter("u_clearcoatRoughnessFactor", 0.34);
|
|
519
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.24);
|
|
520
|
+
}
|
|
521
|
+
if (role === "body-secondary-paint") {
|
|
522
|
+
material.setParameter("u_baseColor", [0.2, 0.004, 0.0024, 1]);
|
|
523
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
524
|
+
material.setParameter("u_normalTextureEnabled", 1);
|
|
525
|
+
material.setParameter("u_normalScale", 0.48);
|
|
526
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
527
|
+
material.setParameter("u_occlusionStrength", 0.72);
|
|
528
|
+
material.setParameter("u_metallic", 0.035);
|
|
529
|
+
material.setParameter("u_roughness", 0.36);
|
|
530
|
+
material.setParameter("u_specularFactor", 0.26);
|
|
531
|
+
material.setParameter("u_specularColorFactor", [0.26, 0.043, 0.028]);
|
|
532
|
+
material.setParameter("u_clearcoatFactor", 0.28);
|
|
533
|
+
material.setParameter("u_clearcoatRoughnessFactor", 0.46);
|
|
534
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.13);
|
|
535
|
+
}
|
|
536
|
+
if (role === "roof-panel") {
|
|
537
|
+
material.setParameter("u_baseColor", [0.072, 0.067, 0.064, 1]);
|
|
538
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
539
|
+
material.setParameter("u_normalTextureEnabled", 1);
|
|
540
|
+
material.setParameter("u_normalScale", 0.026);
|
|
541
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
542
|
+
material.setParameter("u_occlusionStrength", 0.06);
|
|
543
|
+
material.setParameter("u_metallic", 0);
|
|
544
|
+
material.setParameter("u_roughness", 0.48);
|
|
545
|
+
material.setParameter("u_specularFactor", 0.085);
|
|
546
|
+
material.setParameter("u_specularColorFactor", [0.08, 0.075, 0.07]);
|
|
547
|
+
material.setParameter("u_clearcoatFactor", 0.09);
|
|
548
|
+
material.setParameter("u_clearcoatRoughnessFactor", 0.62);
|
|
549
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.024);
|
|
550
|
+
}
|
|
551
|
+
if (role === "pillar-trim" || role === "dark-trim") {
|
|
552
|
+
material.setParameter("u_baseColor", role === "pillar-trim" ? [0.014, 0.016, 0.018, 1] : [0.012, 0.012, 0.013, 1]);
|
|
553
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
554
|
+
material.setParameter("u_normalTextureEnabled", 0);
|
|
555
|
+
material.setParameter("u_normalScale", 0);
|
|
556
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
557
|
+
material.setParameter("u_occlusionStrength", 0.018);
|
|
558
|
+
material.setParameter("u_metallic", 0);
|
|
559
|
+
material.setParameter("u_roughness", 0.74);
|
|
560
|
+
material.setParameter("u_specularFactor", 0.026);
|
|
561
|
+
material.setParameter("u_specularColorFactor", [0.032, 0.03, 0.028]);
|
|
562
|
+
material.setParameter("u_clearcoatFactor", 0);
|
|
563
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.006);
|
|
564
|
+
}
|
|
565
|
+
if (role === "glass") {
|
|
566
|
+
material.setParameter("u_baseColor", [0.018, 0.032, 0.04, 1]);
|
|
567
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
568
|
+
material.setParameter("u_normalTextureEnabled", 0);
|
|
569
|
+
material.setParameter("u_normalScale", 0);
|
|
570
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
571
|
+
material.setParameter("u_occlusionStrength", 0.028);
|
|
572
|
+
material.setParameter("u_metallic", 0);
|
|
573
|
+
material.setParameter("u_roughness", 0.36);
|
|
574
|
+
material.setParameter("u_specularFactor", 0.075);
|
|
575
|
+
material.setParameter("u_specularColorFactor", [0.034, 0.044, 0.052]);
|
|
576
|
+
material.setParameter("u_transmissionTextureEnabled", 0);
|
|
577
|
+
material.setParameter("u_transmissionFactor", 0);
|
|
578
|
+
material.setParameter("u_diffuseTransmissionFactor", 0);
|
|
579
|
+
material.setParameter("u_transmissionFallbackEnergy", 0);
|
|
580
|
+
material.setParameter("u_volumeThicknessFactor", 0);
|
|
581
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.022);
|
|
582
|
+
}
|
|
583
|
+
if (role === "light-lens") {
|
|
584
|
+
material.setParameter("u_baseColor", [0.018, 0.014, 0.012, 1]);
|
|
585
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
586
|
+
material.setParameter("u_normalTextureEnabled", 0);
|
|
587
|
+
material.setParameter("u_normalScale", 0);
|
|
588
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
589
|
+
material.setParameter("u_occlusionStrength", 0.05);
|
|
590
|
+
material.setParameter("u_metallic", 0);
|
|
591
|
+
material.setParameter("u_roughness", 0.42);
|
|
592
|
+
material.setParameter("u_specularFactor", 0.09);
|
|
593
|
+
material.setParameter("u_specularColorFactor", [0.08, 0.056, 0.04]);
|
|
594
|
+
material.setParameter("u_clearcoatFactor", 0.04);
|
|
595
|
+
material.setParameter("u_clearcoatRoughnessFactor", 0.66);
|
|
596
|
+
material.setParameter("u_emissiveTextureEnabled", 0);
|
|
597
|
+
material.setParameter("u_emissiveStrength", 0);
|
|
598
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.018);
|
|
599
|
+
}
|
|
600
|
+
if (role === "license-plate") {
|
|
601
|
+
material.setParameter("u_baseColor", [0.16, 0.152, 0.138, 1]);
|
|
602
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
603
|
+
material.setParameter("u_normalTextureEnabled", 0);
|
|
604
|
+
material.setParameter("u_normalScale", 0);
|
|
605
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
606
|
+
material.setParameter("u_occlusionStrength", 0.12);
|
|
607
|
+
material.setParameter("u_metallic", 0);
|
|
608
|
+
material.setParameter("u_roughness", 0.58);
|
|
609
|
+
material.setParameter("u_specularFactor", 0.08);
|
|
610
|
+
material.setParameter("u_specularColorFactor", [0.075, 0.07, 0.062]);
|
|
611
|
+
material.setParameter("u_clearcoatFactor", 0);
|
|
612
|
+
material.setParameter("u_emissiveTextureEnabled", 0);
|
|
613
|
+
material.setParameter("u_emissiveStrength", 0);
|
|
614
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.018);
|
|
615
|
+
}
|
|
616
|
+
if (role === "side-panel") {
|
|
617
|
+
material.setParameter("u_baseColor", [0.012, 0.003, 0.0025, 1]);
|
|
618
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
619
|
+
material.setParameter("u_normalTextureEnabled", 1);
|
|
620
|
+
material.setParameter("u_normalScale", 0.24);
|
|
621
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
622
|
+
material.setParameter("u_occlusionStrength", 0.9);
|
|
623
|
+
material.setParameter("u_metallic", 0);
|
|
624
|
+
material.setParameter("u_roughness", 0.68);
|
|
625
|
+
material.setParameter("u_specularFactor", 0.025);
|
|
626
|
+
material.setParameter("u_specularColorFactor", [0.026, 0.012, 0.01]);
|
|
627
|
+
material.setParameter("u_clearcoatFactor", 0);
|
|
628
|
+
material.setParameter("u_clearcoatRoughnessFactor", 1);
|
|
629
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.004);
|
|
630
|
+
}
|
|
631
|
+
if (role === "wheel-metal") {
|
|
632
|
+
material.setParameter("u_baseColor", [0.32, 0.31, 0.28, 1]);
|
|
633
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
634
|
+
material.setParameter("u_normalTextureEnabled", 1);
|
|
635
|
+
material.setParameter("u_normalScale", 0.055);
|
|
636
|
+
material.setParameter("u_metallic", 0.9);
|
|
637
|
+
material.setParameter("u_roughness", 0.3);
|
|
638
|
+
material.setParameter("u_specularFactor", 0.36);
|
|
639
|
+
material.setParameter("u_specularColorFactor", [0.34, 0.32, 0.28]);
|
|
640
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.075);
|
|
641
|
+
}
|
|
642
|
+
if (role === "brake") {
|
|
643
|
+
material.setParameter("u_baseColor", [0.48, 0.028, 0.018, 1]);
|
|
644
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
645
|
+
material.setParameter("u_normalTextureEnabled", 1);
|
|
646
|
+
material.setParameter("u_normalScale", 0.06);
|
|
647
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
648
|
+
material.setParameter("u_occlusionStrength", 0.08);
|
|
649
|
+
material.setParameter("u_metallic", 0);
|
|
650
|
+
material.setParameter("u_roughness", 0.62);
|
|
651
|
+
material.setParameter("u_specularFactor", 0.055);
|
|
652
|
+
material.setParameter("u_specularColorFactor", [0.055, 0.026, 0.018]);
|
|
653
|
+
material.setParameter("u_clearcoatFactor", 0);
|
|
654
|
+
material.setParameter("u_emissiveTextureEnabled", 0);
|
|
655
|
+
material.setParameter("u_emissiveStrength", 0);
|
|
656
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.012);
|
|
657
|
+
}
|
|
658
|
+
if (role === "tire") {
|
|
659
|
+
material.setParameter("u_baseColor", [0.014, 0.014, 0.013, 1]);
|
|
660
|
+
material.setParameter("u_normalTextureEnabled", 1);
|
|
661
|
+
material.setParameter("u_normalScale", 0.24);
|
|
662
|
+
material.setParameter("u_roughness", 0.78);
|
|
663
|
+
material.setParameter("u_specularFactor", 0.038);
|
|
664
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.012);
|
|
665
|
+
}
|
|
666
|
+
if (role === "interior") {
|
|
667
|
+
material.setParameter("u_baseColor", [0.22, 0.048, 0.036, 1]);
|
|
668
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
669
|
+
material.setParameter("u_normalTextureEnabled", 1);
|
|
670
|
+
material.setParameter("u_normalScale", 0.085);
|
|
671
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
672
|
+
material.setParameter("u_occlusionStrength", 0.08);
|
|
673
|
+
material.setParameter("u_metallic", 0);
|
|
674
|
+
material.setParameter("u_roughness", 0.52);
|
|
675
|
+
material.setParameter("u_specularFactor", 0.09);
|
|
676
|
+
material.setParameter("u_specularColorFactor", [0.09, 0.046, 0.035]);
|
|
677
|
+
material.setParameter("u_clearcoatFactor", 0.035);
|
|
678
|
+
material.setParameter("u_clearcoatRoughnessFactor", 0.72);
|
|
679
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.025);
|
|
680
|
+
}
|
|
681
|
+
if (role === "mechanical") {
|
|
682
|
+
material.setParameter("u_baseColor", [0.012, 0.012, 0.012, 1]);
|
|
683
|
+
material.setParameter("u_normalScale", 0.06);
|
|
684
|
+
material.setParameter("u_occlusionStrength", 0.08);
|
|
685
|
+
material.setParameter("u_roughness", 0.74);
|
|
686
|
+
material.setParameter("u_specularFactor", 0.026);
|
|
687
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.008);
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
function finalizeGalleryCarConceptMaterialVisualRole(material, role, context = {}) {
|
|
691
|
+
const surface = galleryCarConceptRoleSurface(role, context);
|
|
692
|
+
material.setParameter("u_baseColor", surface.baseColor);
|
|
693
|
+
material.setParameter("u_baseColorTextureEnabled", surface.baseColorTextureEnabled);
|
|
694
|
+
material.setParameter("u_normalTextureEnabled", surface.normalTextureEnabled);
|
|
695
|
+
material.setParameter("u_normalScale", surface.normalScale);
|
|
696
|
+
material.setParameter("u_metallicRoughnessTextureEnabled", 0);
|
|
697
|
+
material.setParameter("u_occlusionTextureEnabled", surface.occlusionTextureEnabled);
|
|
698
|
+
material.setParameter("u_occlusionStrength", surface.occlusionStrength);
|
|
699
|
+
material.setParameter("u_metallic", surface.metallic);
|
|
700
|
+
material.setParameter("u_roughness", surface.roughness);
|
|
701
|
+
material.setParameter("u_specularTextureEnabled", 0);
|
|
702
|
+
material.setParameter("u_specularColorTextureEnabled", 0);
|
|
703
|
+
material.setParameter("u_specularFactor", surface.specular);
|
|
704
|
+
material.setParameter("u_specularColorFactor", surface.specularColorFactor);
|
|
705
|
+
material.setParameter("u_clearcoatTextureEnabled", 0);
|
|
706
|
+
material.setParameter("u_clearcoatRoughnessTextureEnabled", 0);
|
|
707
|
+
material.setParameter("u_clearcoatNormalTextureEnabled", 0);
|
|
708
|
+
material.setParameter("u_clearcoatNormalScale", 0);
|
|
709
|
+
material.setParameter("u_clearcoatFactor", surface.clearcoat);
|
|
710
|
+
material.setParameter("u_clearcoatRoughnessFactor", surface.clearcoatRoughness);
|
|
711
|
+
material.setParameter("u_iorTextureEnabled", 0);
|
|
712
|
+
material.setParameter("u_transmissionTextureEnabled", 0);
|
|
713
|
+
material.setParameter("u_diffuseTransmissionTextureEnabled", 0);
|
|
714
|
+
material.setParameter("u_diffuseTransmissionColorTextureEnabled", 0);
|
|
715
|
+
material.setParameter("u_volumeThicknessTextureEnabled", 0);
|
|
716
|
+
material.setParameter("u_transmissionFactor", 0);
|
|
717
|
+
material.setParameter("u_diffuseTransmissionFactor", 0);
|
|
718
|
+
material.setParameter("u_diffuseTransmissionColorFactor", [1, 1, 1]);
|
|
719
|
+
material.setParameter("u_transmissionFallbackEnergy", 0);
|
|
720
|
+
material.setParameter("u_volumeThicknessFactor", 0);
|
|
721
|
+
material.setParameter("u_volumeAttenuationDistance", 1_000_000);
|
|
722
|
+
material.setParameter("u_volumeAttenuationColor", [1, 1, 1]);
|
|
723
|
+
material.setParameter("u_transmissionParallaxStrength", 0);
|
|
724
|
+
material.setParameter("u_transmissionBounceCount", 0);
|
|
725
|
+
material.setParameter("u_transmissionCausticStrength", 0);
|
|
726
|
+
material.setParameter("u_transmissionBackdropEnabled", 0);
|
|
727
|
+
material.setParameter("u_transmissionBackdropStrength", 0);
|
|
728
|
+
material.setParameter("u_materialEnvironmentSpecularScale", surface.materialEnvironmentSpecularScale);
|
|
729
|
+
material.setParameter("u_iridescenceTextureEnabled", 0);
|
|
730
|
+
material.setParameter("u_iridescenceThicknessTextureEnabled", 0);
|
|
731
|
+
material.setParameter("u_iridescenceFactor", 0);
|
|
732
|
+
material.setParameter("u_sheenColorTextureEnabled", 0);
|
|
733
|
+
material.setParameter("u_sheenRoughnessTextureEnabled", 0);
|
|
734
|
+
material.setParameter("u_sheenColorFactor", [0, 0, 0]);
|
|
735
|
+
material.setParameter("u_sheenRoughnessFactor", 1);
|
|
736
|
+
material.setParameter("u_anisotropyTextureEnabled", 0);
|
|
737
|
+
material.setParameter("u_anisotropyStrength", 0);
|
|
738
|
+
material.setParameter("u_anisotropyRotation", 0);
|
|
739
|
+
material.setParameter("u_dispersion", 0);
|
|
740
|
+
material.setParameter("u_emissiveTextureEnabled", 0);
|
|
741
|
+
material.setParameter("u_emissiveColor", surface.emissive);
|
|
742
|
+
material.setParameter("u_emissiveStrength", surface.emissiveStrength);
|
|
743
|
+
applyGalleryCarConceptSourceTextureDetail(material, role);
|
|
744
|
+
if (role === "glass") {
|
|
745
|
+
material.setParameter("u_ior", 1);
|
|
746
|
+
}
|
|
747
|
+
applyCarConceptOpaqueRuntimeSurface(material, surface);
|
|
748
|
+
}
|
|
749
|
+
function applyGalleryCarConceptSourceTextureDetail(material, role) {
|
|
750
|
+
const sourceBaseColorTexture = materialParameter(material, "u_baseColorTexture");
|
|
751
|
+
const occlusionTexture = materialParameter(material, "u_occlusionTexture");
|
|
752
|
+
const detailTexture = sourceBaseColorTexture ?? occlusionTexture;
|
|
753
|
+
if (!detailTexture)
|
|
754
|
+
return;
|
|
755
|
+
const sourceTextureWeight = role === "body-primary-paint"
|
|
756
|
+
? 0.36
|
|
757
|
+
: role === "body-secondary-paint"
|
|
758
|
+
? 0.32
|
|
759
|
+
: role === "roof-panel"
|
|
760
|
+
? 0.25
|
|
761
|
+
: role === "side-panel"
|
|
762
|
+
? 0.4
|
|
763
|
+
: role === "glass"
|
|
764
|
+
? 0.06
|
|
765
|
+
: role === "wheel-metal"
|
|
766
|
+
? 0.42
|
|
767
|
+
: role === "tire"
|
|
768
|
+
? 0.32
|
|
769
|
+
: role === "license-plate"
|
|
770
|
+
? 0.82
|
|
771
|
+
: role === "light-lens"
|
|
772
|
+
? 0.12
|
|
773
|
+
: 0;
|
|
774
|
+
const fallbackOcclusionWeight = role === "body-primary-paint"
|
|
775
|
+
? 0.16
|
|
776
|
+
: role === "body-secondary-paint"
|
|
777
|
+
? 0.14
|
|
778
|
+
: role === "roof-panel"
|
|
779
|
+
? 0.18
|
|
780
|
+
: role === "side-panel"
|
|
781
|
+
? 0.36
|
|
782
|
+
: role === "glass"
|
|
783
|
+
? 0.04
|
|
784
|
+
: role === "wheel-metal"
|
|
785
|
+
? 0.2
|
|
786
|
+
: role === "tire"
|
|
787
|
+
? 0.18
|
|
788
|
+
: role === "license-plate"
|
|
789
|
+
? 0.28
|
|
790
|
+
: role === "light-lens"
|
|
791
|
+
? 0.06
|
|
792
|
+
: 0;
|
|
793
|
+
const weight = sourceBaseColorTexture ? sourceTextureWeight : fallbackOcclusionWeight;
|
|
794
|
+
if (weight <= 0)
|
|
795
|
+
return;
|
|
796
|
+
if (!sourceBaseColorTexture)
|
|
797
|
+
material.setParameter("u_baseColorTexture", detailTexture);
|
|
798
|
+
const sourcePrefix = sourceBaseColorTexture ? "u_baseColorTexture" : "u_occlusionTexture";
|
|
799
|
+
for (const suffix of ["Offset", "Scale", "Rotation", "TexCoord", "Wrap"]) {
|
|
800
|
+
const value = materialParameter(material, `${sourcePrefix}${suffix}`);
|
|
801
|
+
if (value !== undefined)
|
|
802
|
+
material.setParameter(`u_baseColorTexture${suffix}`, value);
|
|
803
|
+
}
|
|
804
|
+
material.setParameter("u_baseColorTextureEnabled", weight);
|
|
805
|
+
}
|
|
806
|
+
function galleryCarConceptRoleSurface(role, context) {
|
|
807
|
+
const surface = GALLERY_ROLE_SURFACES[role];
|
|
808
|
+
const identity = `${context.nodeName ?? ""} ${context.materialKey ?? ""} ${context.sourceMaterialName ?? ""}`;
|
|
809
|
+
if (role === "body-primary-paint") {
|
|
810
|
+
if (/BodyHood/i.test(identity)) {
|
|
811
|
+
return {
|
|
812
|
+
...surface,
|
|
813
|
+
baseColor: [0.64, 0.0054, 0.0032, 1],
|
|
814
|
+
normalScale: 0.035,
|
|
815
|
+
occlusionStrength: 0.16,
|
|
816
|
+
roughness: 0.21,
|
|
817
|
+
specular: 0.6,
|
|
818
|
+
specularColorFactor: [0.54, 0.042, 0.026],
|
|
819
|
+
clearcoat: 0.6,
|
|
820
|
+
clearcoatRoughness: 0.28,
|
|
821
|
+
materialEnvironmentSpecularScale: 0.27,
|
|
822
|
+
envMapIntensity: 0.27
|
|
823
|
+
};
|
|
824
|
+
}
|
|
825
|
+
if (/BodyRearPanelsColor1/i.test(identity)) {
|
|
826
|
+
return {
|
|
827
|
+
...surface,
|
|
828
|
+
baseColor: [0.56, 0.0048, 0.0029, 1],
|
|
829
|
+
normalScale: 0.032,
|
|
830
|
+
occlusionStrength: 0.18,
|
|
831
|
+
roughness: 0.23,
|
|
832
|
+
specular: 0.56,
|
|
833
|
+
specularColorFactor: [0.5, 0.04, 0.025],
|
|
834
|
+
clearcoat: 0.56,
|
|
835
|
+
clearcoatRoughness: 0.3,
|
|
836
|
+
materialEnvironmentSpecularScale: 0.25,
|
|
837
|
+
envMapIntensity: 0.25
|
|
838
|
+
};
|
|
839
|
+
}
|
|
840
|
+
if (/BodyDoor[LR]Color1/i.test(identity)) {
|
|
841
|
+
return {
|
|
842
|
+
...surface,
|
|
843
|
+
baseColor: [0.76, 0.0072, 0.0042, 1],
|
|
844
|
+
normalScale: 0.04,
|
|
845
|
+
occlusionStrength: 0.18,
|
|
846
|
+
roughness: 0.2,
|
|
847
|
+
specular: 0.66,
|
|
848
|
+
specularColorFactor: [0.58, 0.046, 0.029],
|
|
849
|
+
clearcoat: 0.64,
|
|
850
|
+
clearcoatRoughness: 0.26,
|
|
851
|
+
materialEnvironmentSpecularScale: 0.3,
|
|
852
|
+
envMapIntensity: 0.3
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
}
|
|
856
|
+
if (role === "body-secondary-paint") {
|
|
857
|
+
if (/BodyPanelsColor2/i.test(identity)) {
|
|
858
|
+
return {
|
|
859
|
+
...surface,
|
|
860
|
+
baseColor: [0.078, 0.0015, 0.001, 1],
|
|
861
|
+
normalScale: 0.028,
|
|
862
|
+
occlusionStrength: 0.22,
|
|
863
|
+
roughness: 0.36,
|
|
864
|
+
specular: 0.3,
|
|
865
|
+
specularColorFactor: [0.27, 0.028, 0.02],
|
|
866
|
+
clearcoat: 0.3,
|
|
867
|
+
clearcoatRoughness: 0.48,
|
|
868
|
+
materialEnvironmentSpecularScale: 0.13,
|
|
869
|
+
envMapIntensity: 0.13
|
|
870
|
+
};
|
|
871
|
+
}
|
|
872
|
+
if (/BodyDoor[LR]Color2/i.test(identity)) {
|
|
873
|
+
return {
|
|
874
|
+
...surface,
|
|
875
|
+
baseColor: [0.17, 0.003, 0.0019, 1],
|
|
876
|
+
normalScale: 0.03,
|
|
877
|
+
occlusionStrength: 0.2,
|
|
878
|
+
roughness: 0.3,
|
|
879
|
+
specular: 0.4,
|
|
880
|
+
specularColorFactor: [0.36, 0.036, 0.024],
|
|
881
|
+
clearcoat: 0.42,
|
|
882
|
+
clearcoatRoughness: 0.4,
|
|
883
|
+
materialEnvironmentSpecularScale: 0.18,
|
|
884
|
+
envMapIntensity: 0.18
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
if (role === "light-lens") {
|
|
889
|
+
if (/Headlight/i.test(identity)) {
|
|
890
|
+
return {
|
|
891
|
+
...surface,
|
|
892
|
+
baseColor: [0.022, 0.024, 0.024, 1],
|
|
893
|
+
specularColorFactor: [0.075, 0.075, 0.068],
|
|
894
|
+
materialEnvironmentSpecularScale: 0.02,
|
|
895
|
+
envMapIntensity: 0.02
|
|
896
|
+
};
|
|
897
|
+
}
|
|
898
|
+
if (/Brake|Tail/i.test(identity)) {
|
|
899
|
+
return {
|
|
900
|
+
...surface,
|
|
901
|
+
baseColor: [0.045, 0.006, 0.0038, 1],
|
|
902
|
+
specularColorFactor: [0.08, 0.034, 0.024],
|
|
903
|
+
materialEnvironmentSpecularScale: 0.016,
|
|
904
|
+
envMapIntensity: 0.016
|
|
905
|
+
};
|
|
906
|
+
}
|
|
907
|
+
if (/Signal|Turn/i.test(identity)) {
|
|
908
|
+
return {
|
|
909
|
+
...surface,
|
|
910
|
+
baseColor: [0.04, 0.018, 0.0045, 1],
|
|
911
|
+
specularColorFactor: [0.078, 0.052, 0.026],
|
|
912
|
+
materialEnvironmentSpecularScale: 0.016,
|
|
913
|
+
envMapIntensity: 0.016
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
if (role === "side-panel") {
|
|
918
|
+
return {
|
|
919
|
+
...surface,
|
|
920
|
+
baseColor: [0.024, 0.0038, 0.0025, 1],
|
|
921
|
+
normalScale: 0.42,
|
|
922
|
+
occlusionStrength: 0.62,
|
|
923
|
+
roughness: 0.5,
|
|
924
|
+
specular: 0.1,
|
|
925
|
+
specularColorFactor: [0.11, 0.03, 0.02],
|
|
926
|
+
clearcoat: 0.08,
|
|
927
|
+
clearcoatRoughness: 0.62,
|
|
928
|
+
materialEnvironmentSpecularScale: 0.04,
|
|
929
|
+
envMapIntensity: 0.04
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
return surface;
|
|
933
|
+
}
|
|
934
|
+
function disableCarConceptHdrExtensionEscape(material) {
|
|
935
|
+
material.setParameter("u_specularTextureEnabled", 0);
|
|
936
|
+
material.setParameter("u_specularColorTextureEnabled", 0);
|
|
937
|
+
material.setParameter("u_clearcoatTextureEnabled", 0);
|
|
938
|
+
material.setParameter("u_clearcoatRoughnessTextureEnabled", 0);
|
|
939
|
+
material.setParameter("u_clearcoatNormalTextureEnabled", 0);
|
|
940
|
+
material.setParameter("u_clearcoatNormalScale", 0);
|
|
941
|
+
material.setParameter("u_clearcoatFactor", 0);
|
|
942
|
+
material.setParameter("u_clearcoatRoughnessFactor", 1);
|
|
943
|
+
material.setParameter("u_iorTextureEnabled", 0);
|
|
944
|
+
material.setParameter("u_transmissionTextureEnabled", 0);
|
|
945
|
+
material.setParameter("u_diffuseTransmissionTextureEnabled", 0);
|
|
946
|
+
material.setParameter("u_diffuseTransmissionColorTextureEnabled", 0);
|
|
947
|
+
material.setParameter("u_volumeThicknessTextureEnabled", 0);
|
|
948
|
+
material.setParameter("u_transmissionFactor", 0);
|
|
949
|
+
material.setParameter("u_diffuseTransmissionFactor", 0);
|
|
950
|
+
material.setParameter("u_diffuseTransmissionColorFactor", [1, 1, 1]);
|
|
951
|
+
material.setParameter("u_transmissionFallbackEnergy", 0);
|
|
952
|
+
material.setParameter("u_volumeThicknessFactor", 0);
|
|
953
|
+
material.setParameter("u_volumeAttenuationDistance", 1_000_000);
|
|
954
|
+
material.setParameter("u_volumeAttenuationColor", [1, 1, 1]);
|
|
955
|
+
material.setParameter("u_transmissionParallaxStrength", 0);
|
|
956
|
+
material.setParameter("u_transmissionBounceCount", 0);
|
|
957
|
+
material.setParameter("u_transmissionCausticStrength", 0);
|
|
958
|
+
material.setParameter("u_transmissionBackdropEnabled", 0);
|
|
959
|
+
material.setParameter("u_transmissionBackdropStrength", 0);
|
|
960
|
+
material.setParameter("u_iridescenceTextureEnabled", 0);
|
|
961
|
+
material.setParameter("u_iridescenceThicknessTextureEnabled", 0);
|
|
962
|
+
material.setParameter("u_iridescenceFactor", 0);
|
|
963
|
+
material.setParameter("u_sheenColorTextureEnabled", 0);
|
|
964
|
+
material.setParameter("u_sheenRoughnessTextureEnabled", 0);
|
|
965
|
+
material.setParameter("u_sheenColorFactor", [0, 0, 0]);
|
|
966
|
+
material.setParameter("u_sheenRoughnessFactor", 1);
|
|
967
|
+
material.setParameter("u_anisotropyTextureEnabled", 0);
|
|
968
|
+
material.setParameter("u_anisotropyStrength", 0);
|
|
969
|
+
material.setParameter("u_anisotropyRotation", 0);
|
|
970
|
+
material.setParameter("u_dispersion", 0);
|
|
971
|
+
}
|
|
972
|
+
function applyGalleryCarConceptLegacyRoleBlocks(material, name) {
|
|
973
|
+
if (/Panel Sides/i.test(name)) {
|
|
974
|
+
material.setParameter("u_baseColor", [0.058, 0.014, 0.01, 1]);
|
|
975
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
976
|
+
material.setParameter("u_normalTextureEnabled", 1);
|
|
977
|
+
material.setParameter("u_normalScale", 0.06);
|
|
978
|
+
material.setParameter("u_metallicRoughnessTextureEnabled", 0);
|
|
979
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
980
|
+
material.setParameter("u_occlusionStrength", 0.1);
|
|
981
|
+
material.setParameter("u_specularTextureEnabled", 0);
|
|
982
|
+
material.setParameter("u_specularColorTextureEnabled", 0);
|
|
983
|
+
material.setParameter("u_metallic", 0.04);
|
|
984
|
+
material.setParameter("u_roughness", 0.48);
|
|
985
|
+
material.setParameter("u_specularFactor", 0.12);
|
|
986
|
+
material.setParameter("u_specularColorFactor", [0.11, 0.032, 0.024]);
|
|
987
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.035);
|
|
988
|
+
}
|
|
989
|
+
if (/BodyRoofPanel/i.test(name)) {
|
|
990
|
+
material.setParameter("u_baseColor", [0.12, 0.09, 0.08, 1]);
|
|
991
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
992
|
+
material.setParameter("u_normalTextureEnabled", 1);
|
|
993
|
+
material.setParameter("u_normalScale", 0.028);
|
|
994
|
+
material.setParameter("u_metallicRoughnessTextureEnabled", 0);
|
|
995
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
996
|
+
material.setParameter("u_occlusionStrength", 0.06);
|
|
997
|
+
material.setParameter("u_specularTextureEnabled", 0);
|
|
998
|
+
material.setParameter("u_specularColorTextureEnabled", 0);
|
|
999
|
+
material.setParameter("u_metallic", 0);
|
|
1000
|
+
material.setParameter("u_roughness", 0.56);
|
|
1001
|
+
material.setParameter("u_specularFactor", 0.075);
|
|
1002
|
+
material.setParameter("u_specularColorFactor", [0.065, 0.05, 0.044]);
|
|
1003
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.018);
|
|
1004
|
+
}
|
|
1005
|
+
if (/BodyPillars/i.test(name)) {
|
|
1006
|
+
material.setParameter("u_baseColor", [0.018, 0.02, 0.024, 1]);
|
|
1007
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
1008
|
+
material.setParameter("u_normalTextureEnabled", 1);
|
|
1009
|
+
material.setParameter("u_normalScale", 0.04);
|
|
1010
|
+
material.setParameter("u_metallicRoughnessTextureEnabled", 0);
|
|
1011
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
1012
|
+
material.setParameter("u_occlusionStrength", 0.06);
|
|
1013
|
+
material.setParameter("u_specularTextureEnabled", 0);
|
|
1014
|
+
material.setParameter("u_specularColorTextureEnabled", 0);
|
|
1015
|
+
material.setParameter("u_metallic", 0);
|
|
1016
|
+
material.setParameter("u_roughness", 0.52);
|
|
1017
|
+
material.setParameter("u_specularFactor", 0.1);
|
|
1018
|
+
material.setParameter("u_specularColorFactor", [0.07, 0.08, 0.09]);
|
|
1019
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.035);
|
|
1020
|
+
}
|
|
1021
|
+
if (/Glass|Window|Windshield/i.test(name)) {
|
|
1022
|
+
material.setParameter("u_baseColor", [0.014, 0.024, 0.032, 1]);
|
|
1023
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
1024
|
+
material.setParameter("u_normalTextureEnabled", 0);
|
|
1025
|
+
material.setParameter("u_normalScale", 0);
|
|
1026
|
+
material.setParameter("u_metallicRoughnessTextureEnabled", 0);
|
|
1027
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
1028
|
+
material.setParameter("u_occlusionStrength", 0.025);
|
|
1029
|
+
material.setParameter("u_specularTextureEnabled", 0);
|
|
1030
|
+
material.setParameter("u_specularColorTextureEnabled", 0);
|
|
1031
|
+
material.setParameter("u_iorTextureEnabled", 0);
|
|
1032
|
+
material.setParameter("u_transmissionTextureEnabled", 0);
|
|
1033
|
+
material.setParameter("u_transmissionFactor", 0);
|
|
1034
|
+
material.setParameter("u_diffuseTransmissionFactor", 0);
|
|
1035
|
+
material.setParameter("u_transmissionFallbackEnergy", 0);
|
|
1036
|
+
material.setParameter("u_volumeThicknessFactor", 0);
|
|
1037
|
+
material.setParameter("u_transmissionParallaxStrength", 0);
|
|
1038
|
+
material.setParameter("u_ior", 1.0);
|
|
1039
|
+
material.setParameter("u_metallic", 0);
|
|
1040
|
+
material.setParameter("u_roughness", 0.38);
|
|
1041
|
+
material.setParameter("u_specularFactor", 0.06);
|
|
1042
|
+
material.setParameter("u_specularColorFactor", [0.026, 0.034, 0.042]);
|
|
1043
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.014);
|
|
1044
|
+
}
|
|
1045
|
+
if (/Tireside|Tiretread/i.test(name)) {
|
|
1046
|
+
material.setParameter("u_baseColor", [0.014, 0.014, 0.013, 1]);
|
|
1047
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
1048
|
+
material.setParameter("u_normalScale", 0.24);
|
|
1049
|
+
material.setParameter("u_metallicRoughnessTextureEnabled", 0);
|
|
1050
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
1051
|
+
material.setParameter("u_occlusionStrength", 0.18);
|
|
1052
|
+
material.setParameter("u_specularTextureEnabled", 0);
|
|
1053
|
+
material.setParameter("u_specularColorTextureEnabled", 0);
|
|
1054
|
+
material.setParameter("u_metallic", 0);
|
|
1055
|
+
material.setParameter("u_roughness", 0.8);
|
|
1056
|
+
material.setParameter("u_specularFactor", 0.035);
|
|
1057
|
+
material.setParameter("u_specularColorFactor", [0.035, 0.035, 0.034]);
|
|
1058
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.008);
|
|
1059
|
+
}
|
|
1060
|
+
if (/Rim[12]|Disc|Brake/i.test(name)) {
|
|
1061
|
+
if (/Rim[12]/i.test(name)) {
|
|
1062
|
+
material.setParameter("u_baseColor", /Rim2/i.test(name) ? [0.72, 0.69, 0.62, 1] : [0.23, 0.24, 0.25, 1]);
|
|
1063
|
+
}
|
|
1064
|
+
if (/Disc/i.test(name)) {
|
|
1065
|
+
material.setParameter("u_baseColor", [0.86, 0.82, 0.72, 1]);
|
|
1066
|
+
material.setParameter("u_baseColorTextureEnabled", 1);
|
|
1067
|
+
}
|
|
1068
|
+
material.setParameter("u_normalTextureEnabled", 1);
|
|
1069
|
+
material.setParameter("u_normalScale", /Disc|Rim[12]/i.test(name) ? 0.05 : 0.04);
|
|
1070
|
+
material.setParameter("u_metallicRoughnessTextureEnabled", 0);
|
|
1071
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
1072
|
+
material.setParameter("u_occlusionStrength", /Disc|Rim[12]/i.test(name) ? 0.06 : 0.04);
|
|
1073
|
+
material.setParameter("u_specularTextureEnabled", 0);
|
|
1074
|
+
material.setParameter("u_specularColorTextureEnabled", 0);
|
|
1075
|
+
material.setParameter("u_metallic", /Disc|Rim[12]/i.test(name) ? 0.86 : 0);
|
|
1076
|
+
material.setParameter("u_roughness", /Disc|Rim[12]/i.test(name) ? 0.34 : 0.68);
|
|
1077
|
+
material.setParameter("u_specularFactor", /Disc|Rim[12]/i.test(name) ? 0.28 : 0.035);
|
|
1078
|
+
material.setParameter("u_specularColorFactor", /Disc|Rim[12]/i.test(name) ? [0.28, 0.26, 0.22] : [0.035, 0.018, 0.012]);
|
|
1079
|
+
material.setParameter("u_materialEnvironmentSpecularScale", /Disc|Rim[12]/i.test(name) ? 0.055 : 0.004);
|
|
1080
|
+
material.setParameter("u_emissiveTextureEnabled", 0);
|
|
1081
|
+
material.setParameter("u_emissiveStrength", /Brake/i.test(name) ? 0.22 : 0.02);
|
|
1082
|
+
material.setParameter("u_emissiveColor", /Brake/i.test(name) ? [0.22, 0.02, 0.01] : [0, 0, 0]);
|
|
1083
|
+
}
|
|
1084
|
+
if (/Hardware|Mirror|Dashboard|material-2/i.test(name)) {
|
|
1085
|
+
if (/Mirror|Hardware|material-2/i.test(name)) {
|
|
1086
|
+
material.setParameter("u_baseColor", [0.018, 0.017, 0.018, 1]);
|
|
1087
|
+
material.setParameter("u_normalScale", 0);
|
|
1088
|
+
}
|
|
1089
|
+
material.setParameter("u_emissiveTextureEnabled", 0);
|
|
1090
|
+
material.setParameter("u_emissiveStrength", /Dashboard/i.test(name) ? 0.22 : 0);
|
|
1091
|
+
material.setParameter("u_emissiveColor", /Dashboard/i.test(name) ? [0.16, 0.052, 0.014] : [0, 0, 0]);
|
|
1092
|
+
material.setParameter("u_metallicRoughnessTextureEnabled", 0);
|
|
1093
|
+
material.setParameter("u_occlusionStrength", 0.02);
|
|
1094
|
+
material.setParameter("u_specularTextureEnabled", 0);
|
|
1095
|
+
material.setParameter("u_specularColorTextureEnabled", 0);
|
|
1096
|
+
material.setParameter("u_metallic", 0);
|
|
1097
|
+
material.setParameter("u_roughness", /Dashboard/i.test(name) ? 0.62 : 0.72);
|
|
1098
|
+
material.setParameter("u_specularFactor", /Dashboard/i.test(name) ? 0.08 : 0.04);
|
|
1099
|
+
material.setParameter("u_specularColorFactor", /Dashboard/i.test(name) ? [0.12, 0.055, 0.035] : [0.055, 0.05, 0.045]);
|
|
1100
|
+
material.setParameter("u_materialEnvironmentSpecularScale", /Dashboard/i.test(name) ? 0.018 : 0.01);
|
|
1101
|
+
}
|
|
1102
|
+
if (/Interior|Mechanical|Floormat/i.test(name)) {
|
|
1103
|
+
if (/Mechanical|Floormat/i.test(name)) {
|
|
1104
|
+
material.setParameter("u_baseColor", [0.016, 0.015, 0.014, 1]);
|
|
1105
|
+
}
|
|
1106
|
+
if (/Interior 3 Carmine/i.test(name)) {
|
|
1107
|
+
material.setParameter("u_baseColor", [0.48, 0.08, 0.055, 1]);
|
|
1108
|
+
}
|
|
1109
|
+
if (/Interior 3 Pearl/i.test(name)) {
|
|
1110
|
+
material.setParameter("u_baseColor", [0.18, 0.158, 0.138, 1]);
|
|
1111
|
+
}
|
|
1112
|
+
material.setParameter("u_normalTextureEnabled", 1);
|
|
1113
|
+
material.setParameter("u_normalScale", /Mechanical|Floormat/i.test(name) ? 0.08 : 0.09);
|
|
1114
|
+
material.setParameter("u_metallicRoughnessTextureEnabled", 0);
|
|
1115
|
+
material.setParameter("u_occlusionStrength", /Mechanical|Floormat/i.test(name) ? 0.12 : 0.06);
|
|
1116
|
+
material.setParameter("u_specularTextureEnabled", 0);
|
|
1117
|
+
material.setParameter("u_specularColorTextureEnabled", 0);
|
|
1118
|
+
material.setParameter("u_metallic", 0);
|
|
1119
|
+
material.setParameter("u_roughness", /Mechanical|Floormat/i.test(name) ? 0.7 : 0.56);
|
|
1120
|
+
material.setParameter("u_specularFactor", /Mechanical|Floormat/i.test(name) ? 0.035 : 0.08);
|
|
1121
|
+
material.setParameter("u_specularColorFactor", /Mechanical|Floormat/i.test(name) ? [0.045, 0.045, 0.042] : [0.12, 0.065, 0.04]);
|
|
1122
|
+
material.setParameter("u_materialEnvironmentSpecularScale", /Mechanical|Floormat/i.test(name) ? 0.01 : 0.02);
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
function applyCinematicCarConceptMaterialStability(material, options) {
|
|
1126
|
+
const name = `${options.materialKey ?? ""} ${material.name}`;
|
|
1127
|
+
const carPaint = /Paint [12] (Carmine|Pearl|Pearly|Graphite)|Body.*Color/i.test(name);
|
|
1128
|
+
const darkPanel = /Panel Sides|BodyRoofPanel|BodyPillars/i.test(name);
|
|
1129
|
+
const glass = /Glass|Window|Windshield/i.test(name);
|
|
1130
|
+
const tire = /Tireside|Tiretread/i.test(name);
|
|
1131
|
+
const wheelMetal = /Rim[12]|Disc|Brake/i.test(name);
|
|
1132
|
+
const darkTrim = /Hardware|Mirror|Dashboard|Mechanical|Interior|Floormat|material-2/i.test(name);
|
|
1133
|
+
if (carPaint) {
|
|
1134
|
+
if (/Paint [12] Carmine|Body.*Color/i.test(name)) {
|
|
1135
|
+
material.setParameter("u_baseColor", [0.54, 0.018, 0.011, 1]);
|
|
1136
|
+
}
|
|
1137
|
+
else if (/Paint [12] (Pearl|Pearly)|Graphite/i.test(name)) {
|
|
1138
|
+
material.setParameter("u_baseColor", [0.24, 0.052, 0.046, 1]);
|
|
1139
|
+
}
|
|
1140
|
+
material.setParameter("u_normalTextureEnabled", 0);
|
|
1141
|
+
material.setParameter("u_normalScale", 0);
|
|
1142
|
+
material.setParameter("u_metallicRoughnessTextureEnabled", 0);
|
|
1143
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
1144
|
+
material.setParameter("u_occlusionStrength", 0.002);
|
|
1145
|
+
material.setParameter("u_specularTextureEnabled", 0);
|
|
1146
|
+
material.setParameter("u_specularColorTextureEnabled", 0);
|
|
1147
|
+
material.setParameter("u_metallic", Math.min(numberParameter(material, "u_metallic") ?? 0, 0.18));
|
|
1148
|
+
material.setParameter("u_roughness", Math.max(options.baseline?.roughness !== undefined ? options.baseline.roughness * (options.roughnessScale ?? 1) : 0.62, 0.62));
|
|
1149
|
+
material.setParameter("u_specularFactor", Math.min(numberParameter(material, "u_specularFactor") ?? 0.018, 0.018));
|
|
1150
|
+
material.setParameter("u_specularColorFactor", [0.15, 0.012, 0.01]);
|
|
1151
|
+
material.setParameter("u_clearcoatTextureEnabled", 0);
|
|
1152
|
+
material.setParameter("u_clearcoatRoughnessTextureEnabled", 0);
|
|
1153
|
+
material.setParameter("u_clearcoatNormalTextureEnabled", 0);
|
|
1154
|
+
material.setParameter("u_clearcoatNormalScale", 0);
|
|
1155
|
+
material.setParameter("u_clearcoatFactor", 0);
|
|
1156
|
+
material.setParameter("u_clearcoatRoughnessFactor", 1);
|
|
1157
|
+
material.setParameter("u_iridescenceTextureEnabled", 0);
|
|
1158
|
+
material.setParameter("u_iridescenceThicknessTextureEnabled", 0);
|
|
1159
|
+
material.setParameter("u_iridescenceFactor", 0);
|
|
1160
|
+
material.setParameter("u_materialEnvironmentSpecularScale", 0.001);
|
|
1161
|
+
}
|
|
1162
|
+
if (darkPanel || glass) {
|
|
1163
|
+
material.setParameter("u_baseColor", glass ? [0.014, 0.018, 0.022, 1] : [0.048, 0.04, 0.039, 1]);
|
|
1164
|
+
material.setParameter("u_baseColorTextureEnabled", 0);
|
|
1165
|
+
material.setParameter("u_normalTextureEnabled", 0);
|
|
1166
|
+
material.setParameter("u_normalScale", 0);
|
|
1167
|
+
material.setParameter("u_metallicRoughnessTextureEnabled", 0);
|
|
1168
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
1169
|
+
material.setParameter("u_occlusionStrength", 0.002);
|
|
1170
|
+
material.setParameter("u_specularTextureEnabled", 0);
|
|
1171
|
+
material.setParameter("u_specularColorTextureEnabled", 0);
|
|
1172
|
+
material.setParameter("u_metallic", 0);
|
|
1173
|
+
material.setParameter("u_roughness", glass ? 0.9 : 0.78);
|
|
1174
|
+
material.setParameter("u_specularFactor", glass ? 0.004 : 0.01);
|
|
1175
|
+
material.setParameter("u_specularColorFactor", glass ? [0.006, 0.007, 0.008] : [0.022, 0.014, 0.012]);
|
|
1176
|
+
material.setParameter("u_clearcoatTextureEnabled", 0);
|
|
1177
|
+
material.setParameter("u_clearcoatRoughnessTextureEnabled", 0);
|
|
1178
|
+
material.setParameter("u_clearcoatNormalTextureEnabled", 0);
|
|
1179
|
+
material.setParameter("u_clearcoatNormalScale", 0);
|
|
1180
|
+
material.setParameter("u_clearcoatFactor", 0);
|
|
1181
|
+
material.setParameter("u_transmissionTextureEnabled", 0);
|
|
1182
|
+
material.setParameter("u_transmissionFactor", 0);
|
|
1183
|
+
material.setParameter("u_diffuseTransmissionFactor", 0);
|
|
1184
|
+
material.setParameter("u_transmissionFallbackEnergy", 0);
|
|
1185
|
+
material.setParameter("u_volumeThicknessFactor", 0);
|
|
1186
|
+
material.setParameter("u_ior", 1);
|
|
1187
|
+
material.setParameter("u_materialEnvironmentSpecularScale", glass ? 0.001 : 0.002);
|
|
1188
|
+
}
|
|
1189
|
+
if (tire || wheelMetal || darkTrim) {
|
|
1190
|
+
if (tire)
|
|
1191
|
+
material.setParameter("u_baseColor", [0.008, 0.008, 0.008, 1]);
|
|
1192
|
+
if (wheelMetal)
|
|
1193
|
+
material.setParameter("u_baseColor", /Disc/i.test(name) ? [0.12, 0.12, 0.12, 1] : [0.03, 0.03, 0.032, 1]);
|
|
1194
|
+
material.setParameter("u_normalTextureEnabled", tire ? 1 : 0);
|
|
1195
|
+
material.setParameter("u_normalScale", tire ? 0.035 : 0);
|
|
1196
|
+
material.setParameter("u_metallicRoughnessTextureEnabled", 0);
|
|
1197
|
+
material.setParameter("u_occlusionTextureEnabled", 1);
|
|
1198
|
+
material.setParameter("u_occlusionStrength", tire ? 0.002 : 0.004);
|
|
1199
|
+
material.setParameter("u_specularTextureEnabled", 0);
|
|
1200
|
+
material.setParameter("u_specularColorTextureEnabled", 0);
|
|
1201
|
+
material.setParameter("u_metallic", wheelMetal ? Math.min(numberParameter(material, "u_metallic") ?? 0, 0.08) : 0);
|
|
1202
|
+
material.setParameter("u_roughness", tire ? 0.92 : Math.max(numberParameter(material, "u_roughness") ?? 0.72, 0.72));
|
|
1203
|
+
material.setParameter("u_specularFactor", wheelMetal ? 0.012 : 0.004);
|
|
1204
|
+
material.setParameter("u_specularColorFactor", wheelMetal ? [0.012, 0.012, 0.012] : [0.006, 0.006, 0.006]);
|
|
1205
|
+
material.setParameter("u_clearcoatFactor", 0);
|
|
1206
|
+
material.setParameter("u_materialEnvironmentSpecularScale", wheelMetal ? 0.002 : 0.001);
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
function applyCarConceptOpaqueRuntimeSurface(material, surface) {
|
|
1210
|
+
material.setParameter("u_alphaCutoff", surface.alphaTest);
|
|
1211
|
+
material.setParameter("u_opacity", surface.opacity);
|
|
1212
|
+
material.setParameter("u_transparent", surface.opacity < 1 ? 1 : 0);
|
|
1213
|
+
material.setParameter("u_toneMapped", surface.toneMapped ? 1 : 0);
|
|
1214
|
+
const materialRecord = material;
|
|
1215
|
+
const renderState = material.renderState;
|
|
1216
|
+
if (renderState && typeof renderState === "object") {
|
|
1217
|
+
setExistingProperty(renderState, "blend", false);
|
|
1218
|
+
setExistingProperty(renderState, "depthTest", true);
|
|
1219
|
+
setExistingProperty(renderState, "depthWrite", true);
|
|
1220
|
+
setExistingProperty(renderState, "cullMode", "back");
|
|
1221
|
+
}
|
|
1222
|
+
setExistingProperty(materialRecord, "transparent", false);
|
|
1223
|
+
setExistingProperty(materialRecord, "opacity", surface.opacity);
|
|
1224
|
+
setExistingProperty(materialRecord, "alphaTest", surface.alphaTest);
|
|
1225
|
+
setExistingProperty(materialRecord, "depthTest", true);
|
|
1226
|
+
setExistingProperty(materialRecord, "depthWrite", true);
|
|
1227
|
+
setExistingMaterialSide(materialRecord);
|
|
1228
|
+
setExistingNumberProperty(materialRecord, "transmission", surface.transmission);
|
|
1229
|
+
setExistingNumberProperty(materialRecord, "clearcoat", surface.clearcoat);
|
|
1230
|
+
setExistingNumberProperty(materialRecord, "specular", surface.specular);
|
|
1231
|
+
setExistingNumberProperty(materialRecord, "specularIntensity", surface.specular);
|
|
1232
|
+
setExistingNumberProperty(materialRecord, "metalness", surface.metalness);
|
|
1233
|
+
setExistingNumberProperty(materialRecord, "roughness", surface.roughness);
|
|
1234
|
+
setExistingNumberProperty(materialRecord, "envMapIntensity", surface.envMapIntensity);
|
|
1235
|
+
setExistingEmissive(materialRecord, surface.emissive);
|
|
1236
|
+
setExistingProperty(materialRecord, "toneMapped", surface.toneMapped);
|
|
1237
|
+
setExistingProperty(materialRecord, "needsUpdate", true);
|
|
1238
|
+
}
|
|
1239
|
+
function setExistingProperty(target, key, value) {
|
|
1240
|
+
if (!target || typeof target !== "object")
|
|
1241
|
+
return;
|
|
1242
|
+
const record = target;
|
|
1243
|
+
if (!(key in record))
|
|
1244
|
+
return;
|
|
1245
|
+
try {
|
|
1246
|
+
record[key] = value;
|
|
1247
|
+
}
|
|
1248
|
+
catch {
|
|
1249
|
+
// Some downstream material adapters expose readonly mirrors; ignore those safely.
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
function setExistingNumberProperty(target, key, value) {
|
|
1253
|
+
if (!(key in target))
|
|
1254
|
+
return;
|
|
1255
|
+
const current = target[key];
|
|
1256
|
+
if (current !== undefined && typeof current !== "number")
|
|
1257
|
+
return;
|
|
1258
|
+
setExistingProperty(target, key, value);
|
|
1259
|
+
}
|
|
1260
|
+
function setExistingMaterialSide(target) {
|
|
1261
|
+
if (!("side" in target))
|
|
1262
|
+
return;
|
|
1263
|
+
setExistingProperty(target, "side", typeof target.side === "number" ? 0 : "front");
|
|
1264
|
+
}
|
|
1265
|
+
function setExistingEmissive(target, emissive) {
|
|
1266
|
+
if (!("emissive" in target))
|
|
1267
|
+
return;
|
|
1268
|
+
const current = target.emissive;
|
|
1269
|
+
if (current && typeof current === "object") {
|
|
1270
|
+
const color = current;
|
|
1271
|
+
if (typeof color.setRGB === "function") {
|
|
1272
|
+
try {
|
|
1273
|
+
color.setRGB(emissive[0], emissive[1], emissive[2]);
|
|
1274
|
+
return;
|
|
1275
|
+
}
|
|
1276
|
+
catch {
|
|
1277
|
+
return;
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
setExistingProperty(target, "emissive", [...emissive]);
|
|
1282
|
+
}
|
|
1283
|
+
function numberParameter(material, name) {
|
|
1284
|
+
const value = materialParameter(material, name);
|
|
1285
|
+
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
1286
|
+
}
|
|
1287
|
+
function vector3Parameter(material, name) {
|
|
1288
|
+
const value = materialParameter(material, name);
|
|
1289
|
+
if (!Array.isArray(value) && !ArrayBuffer.isView(value))
|
|
1290
|
+
return undefined;
|
|
1291
|
+
const components = Array.from(value);
|
|
1292
|
+
if (components.length < 3 || !components.slice(0, 3).every((component) => typeof component === "number" && Number.isFinite(component))) {
|
|
1293
|
+
return undefined;
|
|
1294
|
+
}
|
|
1295
|
+
return [components[0], components[1], components[2]];
|
|
1296
|
+
}
|
|
1297
|
+
function materialParameter(material, name) {
|
|
1298
|
+
const getParameter = material.getParameter;
|
|
1299
|
+
if (typeof getParameter !== "function")
|
|
1300
|
+
return undefined;
|
|
1301
|
+
try {
|
|
1302
|
+
return getParameter.call(material, name);
|
|
1303
|
+
}
|
|
1304
|
+
catch {
|
|
1305
|
+
return undefined;
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
//# sourceMappingURL=CarConceptMaterialStability.js.map
|