@call-me-sensei/toonlab 0.3.0 → 0.4.19
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 +549 -184
- package/agents/README.md +59 -0
- package/agents/references/anime-art-direction.md +24 -0
- package/agents/references/asset-sourcing-policy.md +23 -0
- package/agents/references/custom-gap-report.md +16 -0
- package/agents/references/geology-playbook.md +118 -0
- package/agents/references/mcp-asset-discovery.md +104 -0
- package/agents/references/runtime-entry-points.md +174 -0
- package/agents/references/style-bundles.md +71 -0
- package/agents/skills/claude/asset-sourcing/SKILL.md +275 -0
- package/agents/skills/claude/environment/SKILL.md +59 -0
- package/agents/skills/claude/game-dev/SKILL.md +100 -0
- package/agents/skills/claude/karst-cliff-construction/SKILL.md +258 -0
- package/agents/skills/claude/outdoor-world/SKILL.md +492 -0
- package/agents/skills/claude/outdoor-world/references/coastal-landform-formation.md +100 -0
- package/agents/skills/claude/post-processing/SKILL.md +44 -0
- package/agents/skills/claude/rock-ground-shaders/SKILL.md +118 -0
- package/agents/skills/claude/rockgen/SKILL.md +30 -0
- package/agents/skills/claude/scene-style-application/SKILL.md +74 -0
- package/agents/skills/claude/style-presets/SKILL.md +101 -0
- package/agents/skills/claude/toon-shading/SKILL.md +44 -0
- package/agents/skills/claude/vegetation-sky/SKILL.md +167 -0
- package/agents/skills/claude/visual-verification/SKILL.md +136 -0
- package/agents/skills/claude/water/SKILL.md +105 -0
- package/agents/skills/codex/asset-sourcing/SKILL.md +275 -0
- package/agents/skills/codex/environment/SKILL.md +59 -0
- package/agents/skills/codex/game-dev/SKILL.md +100 -0
- package/agents/skills/codex/karst-cliff-construction/SKILL.md +258 -0
- package/agents/skills/codex/outdoor-world/SKILL.md +492 -0
- package/agents/skills/codex/outdoor-world/references/coastal-landform-formation.md +100 -0
- package/agents/skills/codex/post-processing/SKILL.md +44 -0
- package/agents/skills/codex/rock-ground-shaders/SKILL.md +118 -0
- package/agents/skills/codex/rockgen/SKILL.md +30 -0
- package/agents/skills/codex/scene-style-application/SKILL.md +74 -0
- package/agents/skills/codex/style-presets/SKILL.md +101 -0
- package/agents/skills/codex/toon-shading/SKILL.md +44 -0
- package/agents/skills/codex/vegetation-sky/SKILL.md +167 -0
- package/agents/skills/codex/visual-verification/SKILL.md +136 -0
- package/agents/skills/codex/water/SKILL.md +105 -0
- package/cli/toonlab.mjs +52 -0
- package/compose.yaml +20 -0
- package/database/apply-sql.mjs +141 -0
- package/database/client.mjs +39 -0
- package/database/creation-tags.mjs +23 -0
- package/database/env.mjs +16 -0
- package/database/generation-service.mjs +314 -0
- package/database/migrations/0001_local_workspace.sql +120 -0
- package/database/migrations/0002_file_ownership.sql +11 -0
- package/database/migrations/0003_remove_autosaves_from_library.sql +7 -0
- package/database/migrations/0004_catalog_asset_packs.sql +39 -0
- package/database/migrations/0005_creation_tag_discovery.sql +1 -0
- package/database/migrations/0006_normalize_creation_tags.sql +28 -0
- package/database/providers.mjs +465 -0
- package/database/repository.mjs +625 -0
- package/database/seeds/catalog/0001_empty_official_catalog.sql +4 -0
- package/database/seeds/catalog/0002_2026-08.sql +19454 -0
- package/mcp/lab-management.mjs +629 -0
- package/mcp/public-catalog.mjs +168 -0
- package/mcp/server.mjs +1026 -63
- package/mcp/vite-plugin.mjs +443 -26
- package/mcp/workspace.mjs +26 -1
- package/package.json +312 -45
- package/scripts/generate-catalog-seed.mjs +297 -0
- package/scripts/setup-local.mjs +128 -0
- package/src/agents/index.js +7 -0
- package/src/agents/sceneStyleOperations.js +169 -0
- package/src/asset-policy/catalogLicenses.js +44 -0
- package/src/asset-policy/index.js +315 -0
- package/src/assetlib/assetRef.js +1 -1
- package/src/assetlib/galleryMaterialFamily.js +165 -0
- package/src/assetlib/index.js +6 -2
- package/src/assetlib/plateau.js +188 -0
- package/src/assetlib/plateauLandmarks.js +144 -0
- package/src/assetlib/plateauViewer.js +348 -0
- package/src/assetlib/sources.js +16 -2
- package/src/catalog/manifest.js +11 -1
- package/src/catalog/officialCatalog.js +4 -0
- package/src/catalog/officialCatalogAssetRuntime.js +313 -0
- package/src/catalog/officialCatalogLod.js +150 -0
- package/src/catalog/officialCatalogPlacement.js +228 -0
- package/src/catalog/officialCatalogProvider.js +334 -0
- package/src/character/animationRetarget.js +1082 -0
- package/src/character/characterRuntime.js +376 -0
- package/src/character/groundStabilizer.js +137 -0
- package/src/character/index.js +8 -0
- package/src/character/locomotionActions.js +74 -0
- package/src/character/locomotionStateMachine.js +241 -0
- package/src/character/mannequinAsset.js +15 -0
- package/src/character/mannequinAssetUrl.browser.js +4 -0
- package/src/character/mannequinAssetUrl.node.js +3 -0
- package/src/character/modelLoader.js +92 -12
- package/src/character/walkableCharacterRuntime.js +284 -0
- package/src/character/waterInteractionController.js +217 -0
- package/src/cloud/ambientSkyBaker.js +248 -0
- package/src/cloud/cloudLighting.js +1114 -0
- package/src/cloud/cloudParams.js +819 -0
- package/src/cloud/cloudReprojection.js +563 -0
- package/src/cloud/cloudStyle.js +780 -0
- package/src/cloud/cloudStyleSnapshots.js +387 -0
- package/src/cloud/cloudVolume.js +1903 -0
- package/src/cloud/heroCloudRecipe.js +404 -0
- package/src/cloud/index.js +42 -0
- package/src/cloud/noise/baseShapeVolume.js +331 -0
- package/src/cloud/noise/cirrusMap.js +131 -0
- package/src/cloud/noise/curlNoise.js +289 -0
- package/src/cloud/noise/erosionVolume.js +188 -0
- package/src/cloud/noise/noiseVolume.js +202 -0
- package/src/cloud/noise/periodicNoise3.js +295 -0
- package/src/cloud/noise/weatherMap.js +470 -0
- package/src/cloud/paramSchema.js +458 -0
- package/src/collisionMetadata.js +320 -0
- package/src/core/systemStylePolicy.js +32 -0
- package/src/environment/dayCurves.js +146 -0
- package/src/environment/environmentGroundFieldPass.js +354 -0
- package/src/environment/environmentMaterialAdapter.js +114 -6
- package/src/environment/environmentPresets.js +396 -90
- package/src/environment/environmentRigs.js +17 -2
- package/src/environment/environmentSettings.js +37 -1
- package/src/environment/environmentShaderMaterials.js +37 -6
- package/src/environment/environmentState.js +133 -0
- package/src/environment/environmentSunShadowPass.js +357 -6
- package/src/environment/environmentTextureResolver.js +7 -0
- package/src/environment/index.js +51 -0
- package/src/environment/manufacturedMaterialContract.js +837 -0
- package/src/environment/manufacturedReflectionProvider.js +114 -0
- package/src/environment/scanAssetStylize.js +4 -4
- package/src/environment/surfaceMaterialModes.js +71 -0
- package/src/environment/toonLabEnvironmentMaterials.js +353 -0
- package/src/environment/toonLabMaterialPassCoupling.js +347 -0
- package/src/environment/toonLabNormalIntegration.js +171 -0
- package/src/environment/toonLabRockMaterialResolver.js +592 -0
- package/src/environment/toonLabSourceDefaultLit.js +444 -0
- package/src/environment/toonLabSourceLibrary.js +762 -0
- package/src/environment/toonLabSourceMaterials.js +3718 -0
- package/src/environment/toonLabSourceSubsurfaceLighting.js +415 -0
- package/src/environment/toonLabSourceTemporal.js +717 -0
- package/src/environment/toonLabSurfaceLighting.js +364 -0
- package/src/environment/toonLabTextureReadiness.js +105 -0
- package/src/environment/toonLabTreeMaterials.js +450 -0
- package/src/environment/transparentMaterialProfile.js +87 -0
- package/src/environment/urbanPropMaterial.js +2874 -0
- package/src/ground-shader/groundPrintLayer.js +375 -0
- package/src/ground-shader/groundShaderMaterial.js +851 -0
- package/src/ground-shader/groundShaderSettings.js +468 -0
- package/src/ground-shader/index.js +3 -0
- package/src/index.js +52 -22
- package/src/lighting/callMeSenseiLightingContract.js +163 -0
- package/src/lighting/index.js +14 -7
- package/src/lighting/lightingCapabilities.js +2 -2
- package/src/lighting/lightingPresets.js +6 -3
- package/src/lighting/lightingStyle.js +41 -6
- package/src/lighting/lightingSystem.js +140 -1
- package/src/lighting/{unrealExport.js → toonLabExport.js} +40 -41
- package/src/post/postProcessing.js +71 -12
- package/src/react/index.js +66 -0
- package/src/renderer/index.js +9 -0
- package/src/renderer/rendererConfiguration.js +250 -0
- package/src/rock-shader/index.js +3 -0
- package/src/rock-shader/rockMaterial.js +1843 -0
- package/src/rock-shader/rockShaderRuntime.js +494 -0
- package/src/rock-shader/rockShaderSettings.js +869 -0
- package/src/rockgen/export/glbExport.js +104 -14
- package/src/rockgen/index.js +4 -3
- package/src/rockgen/lod/index.js +6 -0
- package/src/rockgen/lod/rockLodMetrics.js +168 -0
- package/src/rockgen/lod/rockLodPlanner.js +372 -0
- package/src/rockgen/lod/rockLodPolicy.js +235 -0
- package/src/rockgen/lod/rockLodRuntime.js +124 -0
- package/src/rockgen/lod/rockLodSimplifier.js +173 -0
- package/src/rockgen/lod/rockLodValidation.js +113 -0
- package/src/rockgen/mesh/meshAttributes.js +17 -0
- package/src/rockgen/mesh/meshDocument.js +6 -0
- package/src/rockgen/rockDocument.js +352 -9
- package/src/rockgen/rockgenPresets.js +114 -13
- package/src/rockgen/rockgenSettings.js +62 -11
- package/src/runtime/index.js +14 -0
- package/src/runtime/sceneCollisionRuntime.js +317 -0
- package/src/runtime/sceneSurfaceRuntime.js +451 -0
- package/src/runtime/sceneUpdateScheduler.js +203 -0
- package/src/shaders-tsl/anime.js +9 -2
- package/src/shaders-tsl/chunks/environment-ground-field.js +174 -0
- package/src/shaders-tsl/chunks/environment-state.js +79 -0
- package/src/shaders-tsl/chunks/environment-sun-shadow.js +99 -32
- package/src/shaders-tsl/chunks/normalized-hue.js +41 -0
- package/src/shaders-tsl/chunks/pass-depth-color.js +4 -2
- package/src/shaders-tsl/chunks/scene-depth-color-pass.js +273 -0
- package/src/shaders-tsl/chunks/vegetation-style.js +116 -8
- package/src/shaders-tsl/chunks/water-color.js +19 -5
- package/src/shaders-tsl/chunks/water-shore-state.js +8 -1
- package/src/shaders-tsl/chunks/world-noise.js +30 -0
- package/src/shaders-tsl/environment.js +123 -17
- package/src/shaders-tsl/flower.js +51 -8
- package/src/shaders-tsl/grass.js +194 -29
- package/src/shaders-tsl/post-composite.js +83 -2
- package/src/shaders-tsl/tree-leaf.js +107 -16
- package/src/shaders-tsl/water-breaker.js +18 -4
- package/src/shaders-tsl/water.js +43 -3
- package/src/shaders-tsl/woody-surface.js +59 -7
- package/src/sky/atmosphereDome.js +193 -0
- package/src/sky/atmosphereParams.js +396 -0
- package/src/sky/atmosphereScattering.js +593 -0
- package/src/sky/atmosphereSky.js +371 -0
- package/src/sky/cloudShadow.js +355 -0
- package/src/sky/godRays.js +257 -0
- package/src/sky/index.js +55 -1
- package/src/sky/nightSky.js +1190 -0
- package/src/sky/renderLayers.js +120 -0
- package/src/sky/skyColor.js +582 -0
- package/src/sky/skyDayCycle.js +244 -0
- package/src/sky/skyParams.js +661 -0
- package/src/sky/skyPresets.js +772 -0
- package/src/sky/skyQualityTiers.js +383 -0
- package/src/sky/skyShaderSettings.js +699 -0
- package/src/sky/skyStyleSnapshots.js +211 -0
- package/src/sky/skySystem.js +1438 -0
- package/src/sky/skyTimeKeyframes.js +361 -0
- package/src/sky/stylizedSky.js +405 -116
- package/src/sky/sunDriver.js +499 -0
- package/src/sky/timeOfDay.js +335 -0
- package/src/styles/animeGameProfile.js +44 -0
- package/src/styles/index.js +134 -0
- package/src/styles/manufacturedStyleLabeling.js +204 -0
- package/src/styles/sceneLayerDocuments.js +185 -0
- package/src/styles/sceneLookComposition.js +156 -0
- package/src/styles/sceneQualityApplication.js +152 -0
- package/src/styles/sceneQualityProfiles.js +268 -0
- package/src/styles/sceneStyleAudit.js +512 -0
- package/src/styles/sceneStyleRuntime.js +876 -0
- package/src/styles/styleAdapters.js +166 -0
- package/src/styles/styleApplication.js +369 -0
- package/src/styles/styleBundle.js +444 -91
- package/src/styles/styleBundleProvider.js +83 -0
- package/src/styles/styleDomains.js +21 -0
- package/src/styles/styleInspector.js +262 -0
- package/src/styles/styleMaterialContract.js +375 -0
- package/src/styles/styleMetadata.js +73 -0
- package/src/styles/styleTargetDiscovery.js +162 -0
- package/src/styles/styleTargetLabels.js +206 -0
- package/src/styles/styleTargetMaterialCoverage.js +137 -0
- package/src/styles/styleTransaction.js +272 -0
- package/src/texgen/textureGenerators.js +21 -5
- package/src/toon/toonSettings.js +4 -0
- package/src/vegetation/branchTree.js +302 -0
- package/src/vegetation/callMeSenseiGrass.js +183 -0
- package/src/vegetation/compiledTree.js +506 -0
- package/src/vegetation/contactShadowField.js +107 -0
- package/src/vegetation/flowerSpecies.js +10 -2
- package/src/vegetation/grass.js +13 -0
- package/src/vegetation/grassClump.js +1179 -0
- package/src/vegetation/importedVegetationMaterial.js +183 -0
- package/src/vegetation/index.js +15 -1
- package/src/vegetation/legacyTreePresets.js +120 -0
- package/src/vegetation/scatter.js +322 -3
- package/src/vegetation/stylizedBush.js +14 -0
- package/src/vegetation/stylizedFlower.js +31 -0
- package/src/vegetation/stylizedFlowers.js +59 -7
- package/src/vegetation/stylizedForest.js +455 -147
- package/src/vegetation/stylizedGrass.js +188 -24
- package/src/vegetation/stylizedTree.js +378 -46
- package/src/vegetation/stylizedTreeFoliage.js +889 -38
- package/src/vegetation/stylizedUnderstory.js +230 -0
- package/src/vegetation/treeExport.js +262 -47
- package/src/vegetation/treeSurfaceTextures.js +337 -0
- package/src/vegetation/vegetationShaders.js +617 -28
- package/src/version.js +3 -0
- package/src/water/water.js +2 -0
- package/src/water/waterBreakerSystem.js +2 -0
- package/src/water/waterCurrentField.js +1 -0
- package/src/water/waterMaterial.js +3 -0
- package/src/water/waterRain.js +2 -0
- package/src/water/waterScenePasses.js +170 -7
- package/src/water/waterSettings.js +235 -43
- package/src/water/waterShoreMaterial.js +16 -2
- package/src/water/waterShoreStateField.js +1 -1
- package/src/water/waterSplashSystem.js +2 -0
- package/src/water/waterStageSettings.js +60 -0
- package/src/water/waterSurface.js +144 -4
- package/src/water/waterUnderwaterAtmosphere.js +288 -0
- package/src/water/waterVegetation.js +20 -4
- package/src/worldCollision.js +64 -9
- package/types/agents/index.d.ts +1 -0
- package/types/agents/sceneStyleOperations.d.ts +484 -0
- package/types/asset-policy/catalogLicenses.d.ts +5 -0
- package/types/asset-policy/index.d.ts +18 -0
- package/types/assetlib/ambientcg.d.ts +81 -0
- package/types/assetlib/assetRef.d.ts +26 -0
- package/types/assetlib/galleryMaterialFamily.d.ts +13 -0
- package/types/assetlib/importedEntry.d.ts +18 -0
- package/types/assetlib/index.d.ts +16 -0
- package/types/assetlib/kaykit.d.ts +112 -0
- package/types/assetlib/kaykitStaticIndex.d.ts +38 -0
- package/types/assetlib/loadImported.d.ts +54 -0
- package/types/assetlib/opensource3d.d.ts +55 -0
- package/types/assetlib/plateau.d.ts +67 -0
- package/types/assetlib/plateauLandmarks.d.ts +238 -0
- package/types/assetlib/plateauViewer.d.ts +3 -0
- package/types/assetlib/polyhaven.d.ts +90 -0
- package/types/assetlib/polypizza.d.ts +10 -0
- package/types/assetlib/smithsonian.d.ts +9 -0
- package/types/assetlib/sources.d.ts +22 -0
- package/types/assetlib/zip.d.ts +8 -0
- package/types/catalog/manifest.d.ts +26 -0
- package/types/catalog/officialCatalog.d.ts +4 -0
- package/types/catalog/officialCatalogAssetRuntime.d.ts +2 -0
- package/types/catalog/officialCatalogLod.d.ts +5 -0
- package/types/catalog/officialCatalogPlacement.d.ts +49 -0
- package/types/catalog/officialCatalogProvider.d.ts +7 -0
- package/types/character/animationRetarget.d.ts +20 -0
- package/types/character/characterRig.d.ts +28 -0
- package/types/character/characterRuntime.d.ts +4 -0
- package/types/character/freestyleSwimClip.d.ts +5 -0
- package/types/character/groundStabilizer.d.ts +55 -0
- package/types/character/index.d.ts +10 -0
- package/types/character/locomotionActions.d.ts +4 -0
- package/types/character/locomotionStateMachine.d.ts +62 -0
- package/types/character/mannequinAsset.d.ts +12 -0
- package/types/character/mannequinAssetUrl.node.d.ts +1 -0
- package/types/character/modelLoader.d.ts +7 -0
- package/types/character/walkableCharacterRuntime.d.ts +343 -0
- package/types/character/waterInteractionController.d.ts +114 -0
- package/types/cloud/ambientSkyBaker.d.ts +18 -0
- package/types/cloud/cloudLighting.d.ts +38 -0
- package/types/cloud/cloudParams.d.ts +18 -0
- package/types/cloud/cloudReprojection.d.ts +15 -0
- package/types/cloud/cloudStyle.d.ts +1380 -0
- package/types/cloud/cloudStyleSnapshots.d.ts +10 -0
- package/types/cloud/cloudVolume.d.ts +43 -0
- package/types/cloud/heroCloudRecipe.d.ts +167 -0
- package/types/cloud/index.d.ts +12 -0
- package/types/cloud/noise/baseShapeVolume.d.ts +86 -0
- package/types/cloud/noise/cirrusMap.d.ts +24 -0
- package/types/cloud/noise/curlNoise.d.ts +106 -0
- package/types/cloud/noise/erosionVolume.d.ts +58 -0
- package/types/cloud/noise/noiseVolume.d.ts +63 -0
- package/types/cloud/noise/periodicNoise3.d.ts +75 -0
- package/types/cloud/noise/weatherMap.d.ts +227 -0
- package/types/cloud/paramSchema.d.ts +142 -0
- package/types/collisionMetadata.d.ts +11 -0
- package/types/core/generation.d.ts +95 -0
- package/types/core/materialRoles.d.ts +102 -0
- package/types/core/presetDocuments.d.ts +25 -0
- package/types/core/systemStylePolicy.d.ts +4 -0
- package/types/environment/dayCurves.d.ts +47 -0
- package/types/environment/environmentAmbientProbe.d.ts +2 -0
- package/types/environment/environmentGroundFieldPass.d.ts +2 -0
- package/types/environment/environmentMaterialAdapter.d.ts +42 -0
- package/types/environment/environmentMaterialClassifier.d.ts +26 -0
- package/types/environment/environmentPlanarReflection.d.ts +3 -0
- package/types/environment/environmentPresets.d.ts +171 -0
- package/types/environment/environmentRigs.d.ts +13 -0
- package/types/environment/environmentSettings.d.ts +161 -0
- package/types/environment/environmentShaderMaterials.d.ts +14 -0
- package/types/environment/environmentState.d.ts +6 -0
- package/types/environment/environmentSunShadowPass.d.ts +2 -0
- package/types/environment/environmentTextureResolver.d.ts +30 -0
- package/types/environment/environmentTimeOfDay.d.ts +25 -0
- package/types/environment/environmentVertexAo.d.ts +18 -0
- package/types/environment/index.d.ts +27 -0
- package/types/environment/manufacturedMaterialContract.d.ts +129 -0
- package/types/environment/manufacturedReflectionProvider.d.ts +3 -0
- package/types/environment/scanAssetStylize.d.ts +43 -0
- package/types/environment/surfaceMaterialModes.d.ts +14 -0
- package/types/environment/toonLabEnvironmentMaterials.d.ts +139 -0
- package/types/environment/toonLabMaterialPassCoupling.d.ts +7 -0
- package/types/environment/toonLabNormalIntegration.d.ts +29 -0
- package/types/environment/toonLabRockMaterialResolver.d.ts +270 -0
- package/types/environment/toonLabSourceDefaultLit.d.ts +136 -0
- package/types/environment/toonLabSourceLibrary.d.ts +19 -0
- package/types/environment/toonLabSourceMaterials.d.ts +14 -0
- package/types/environment/toonLabSourceSubsurfaceLighting.d.ts +85 -0
- package/types/environment/toonLabSourceTemporal.d.ts +20 -0
- package/types/environment/toonLabSurfaceLighting.d.ts +136 -0
- package/types/environment/toonLabTextureReadiness.d.ts +8 -0
- package/types/environment/toonLabTreeMaterials.d.ts +7 -0
- package/types/environment/transparentMaterialProfile.d.ts +76 -0
- package/types/environment/urbanPropMaterial.d.ts +25 -0
- package/types/ground-shader/groundPrintLayer.d.ts +4 -0
- package/types/ground-shader/groundShaderMaterial.d.ts +11 -0
- package/types/ground-shader/groundShaderSettings.d.ts +90 -0
- package/types/ground-shader/index.d.ts +3 -0
- package/types/index.d.ts +1502 -0
- package/types/lighting/callMeSenseiLightingContract.d.ts +14 -0
- package/types/lighting/colorIntensity.d.ts +44 -0
- package/types/lighting/index.d.ts +12 -0
- package/types/lighting/lightDescriptors.d.ts +803 -0
- package/types/lighting/lightingCapabilities.d.ts +85 -0
- package/types/lighting/lightingDocuments.d.ts +140 -0
- package/types/lighting/lightingFixtures.d.ts +171 -0
- package/types/lighting/lightingGenerator.d.ts +403 -0
- package/types/lighting/lightingPresets.d.ts +264 -0
- package/types/lighting/lightingRuntime.d.ts +401 -0
- package/types/lighting/lightingStyle.d.ts +156 -0
- package/types/lighting/lightingSystem.d.ts +433 -0
- package/types/lighting/toonLabExport.d.ts +46 -0
- package/types/lighting/utils.d.ts +18 -0
- package/types/loaders/index.d.ts +1 -0
- package/types/post/index.d.ts +2 -0
- package/types/post/postGenerator.d.ts +282 -0
- package/types/post/postProcessing.d.ts +16 -0
- package/types/react/index.d.ts +1765 -0
- package/types/renderer/index.d.ts +1 -0
- package/types/renderer/rendererConfiguration.d.ts +8 -0
- package/types/rock-shader/index.d.ts +3 -0
- package/types/rock-shader/rockMaterial.d.ts +18 -0
- package/types/rock-shader/rockShaderRuntime.d.ts +8 -0
- package/types/rock-shader/rockShaderSettings.d.ts +170 -0
- package/types/rockgen/export/glbExport.d.ts +58 -0
- package/types/rockgen/heightfield/heightfieldErosion.d.ts +10 -0
- package/types/rockgen/heightfield/heightfieldPatch.d.ts +15 -0
- package/types/rockgen/heightfield/stylizedErosionSim.d.ts +41 -0
- package/types/rockgen/index.d.ts +11 -0
- package/types/rockgen/lod/index.d.ts +6 -0
- package/types/rockgen/lod/rockLodMetrics.d.ts +62 -0
- package/types/rockgen/lod/rockLodPlanner.d.ts +86 -0
- package/types/rockgen/lod/rockLodPolicy.d.ts +76 -0
- package/types/rockgen/lod/rockLodRuntime.d.ts +95 -0
- package/types/rockgen/lod/rockLodSimplifier.d.ts +15 -0
- package/types/rockgen/lod/rockLodValidation.d.ts +16 -0
- package/types/rockgen/mesh/meshAttributes.d.ts +32 -0
- package/types/rockgen/mesh/meshDocument.d.ts +40 -0
- package/types/rockgen/mesh/surfaceNets.d.ts +42 -0
- package/types/rockgen/noise/cellularNoise3.d.ts +24 -0
- package/types/rockgen/noise/prng.d.ts +16 -0
- package/types/rockgen/noise/simplexNoise3.d.ts +2 -0
- package/types/rockgen/noise/valueNoise3.d.ts +12 -0
- package/types/rockgen/rockDocument.d.ts +215 -0
- package/types/rockgen/rockHelpers.d.ts +2 -0
- package/types/rockgen/rockgenPresets.d.ts +10 -0
- package/types/rockgen/rockgenSettings.d.ts +531 -0
- package/types/rockgen/sdf/fieldCompiler.d.ts +20 -0
- package/types/rockgen/sdf/sculptEdits.d.ts +30 -0
- package/types/rockgen/sdf/sdfModifiers.d.ts +19 -0
- package/types/rockgen/sdf/sdfOps.d.ts +8 -0
- package/types/rockgen/sdf/sdfPrimitives.d.ts +22 -0
- package/types/runtime/index.d.ts +3 -0
- package/types/runtime/sceneCollisionRuntime.d.ts +94 -0
- package/types/runtime/sceneSurfaceRuntime.d.ts +90 -0
- package/types/runtime/sceneUpdateScheduler.d.ts +28 -0
- package/types/shaders-tsl/anime.d.ts +9 -0
- package/types/shaders-tsl/chunks/character-color.d.ts +6 -0
- package/types/shaders-tsl/chunks/character-highlights.d.ts +12 -0
- package/types/shaders-tsl/chunks/character-lighting.d.ts +20 -0
- package/types/shaders-tsl/chunks/character-material-maps.d.ts +18 -0
- package/types/shaders-tsl/chunks/character-roles.d.ts +21 -0
- package/types/shaders-tsl/chunks/character-scene-lights.d.ts +48 -0
- package/types/shaders-tsl/chunks/character-shadow-color.d.ts +5 -0
- package/types/shaders-tsl/chunks/character-skinning.d.ts +23 -0
- package/types/shaders-tsl/chunks/environment-color.d.ts +9 -0
- package/types/shaders-tsl/chunks/environment-debug.d.ts +24 -0
- package/types/shaders-tsl/chunks/environment-ground-field.d.ts +40 -0
- package/types/shaders-tsl/chunks/environment-lighting.d.ts +22 -0
- package/types/shaders-tsl/chunks/environment-state.d.ts +42 -0
- package/types/shaders-tsl/chunks/environment-sun-shadow.d.ts +19 -0
- package/types/shaders-tsl/chunks/foliage-fog.d.ts +21 -0
- package/types/shaders-tsl/chunks/normalized-hue.d.ts +1 -0
- package/types/shaders-tsl/chunks/pass-depth-color.d.ts +20 -0
- package/types/shaders-tsl/chunks/projected-water-caustics.d.ts +24 -0
- package/types/shaders-tsl/chunks/scene-depth-color-pass.d.ts +39 -0
- package/types/shaders-tsl/chunks/stylized-cloud-shadow.d.ts +9 -0
- package/types/shaders-tsl/chunks/vegetation-style.d.ts +60 -0
- package/types/shaders-tsl/chunks/water-color.d.ts +15 -0
- package/types/shaders-tsl/chunks/water-common.d.ts +9 -0
- package/types/shaders-tsl/chunks/water-foam.d.ts +8 -0
- package/types/shaders-tsl/chunks/water-lighting.d.ts +9 -0
- package/types/shaders-tsl/chunks/water-ripple.d.ts +8 -0
- package/types/shaders-tsl/chunks/water-shore-state.d.ts +7 -0
- package/types/shaders-tsl/chunks/water-waves.d.ts +18 -0
- package/types/shaders-tsl/chunks/world-noise.d.ts +4 -0
- package/types/shaders-tsl/environment-ao-overlay.d.ts +5 -0
- package/types/shaders-tsl/environment.d.ts +34 -0
- package/types/shaders-tsl/flower.d.ts +6 -0
- package/types/shaders-tsl/grass.d.ts +4 -0
- package/types/shaders-tsl/post-composite.d.ts +25 -0
- package/types/shaders-tsl/sky.d.ts +4 -0
- package/types/shaders-tsl/tree-leaf.d.ts +2 -0
- package/types/shaders-tsl/water-breaker.d.ts +15 -0
- package/types/shaders-tsl/water-kelp.d.ts +5 -0
- package/types/shaders-tsl/water-rain.d.ts +10 -0
- package/types/shaders-tsl/water-shore-state-simulation.d.ts +12 -0
- package/types/shaders-tsl/water-simulation.d.ts +5 -0
- package/types/shaders-tsl/water-splash.d.ts +12 -0
- package/types/shaders-tsl/water.d.ts +22 -0
- package/types/shaders-tsl/woody-surface.d.ts +3 -0
- package/types/sky/atmosphereDome.d.ts +2 -0
- package/types/sky/atmosphereParams.d.ts +185 -0
- package/types/sky/atmosphereScattering.d.ts +11 -0
- package/types/sky/atmosphereSky.d.ts +2 -0
- package/types/sky/cloudShadow.d.ts +68 -0
- package/types/sky/godRays.d.ts +5 -0
- package/types/sky/index.d.ts +18 -0
- package/types/sky/nightSky.d.ts +22 -0
- package/types/sky/renderLayers.d.ts +59 -0
- package/types/sky/sceneOverrideLayers.d.ts +10 -0
- package/types/sky/skyColor.d.ts +704 -0
- package/types/sky/skyDayCycle.d.ts +86 -0
- package/types/sky/skyParams.d.ts +3407 -0
- package/types/sky/skyPresets.d.ts +160 -0
- package/types/sky/skyQuality.d.ts +21 -0
- package/types/sky/skyQualityTiers.d.ts +223 -0
- package/types/sky/skyShaderSettings.d.ts +152 -0
- package/types/sky/skyStyleSnapshots.d.ts +11 -0
- package/types/sky/skySystem.d.ts +3 -0
- package/types/sky/skyTimeKeyframes.d.ts +230 -0
- package/types/sky/stylizedSky.d.ts +341 -0
- package/types/sky/sunDriver.d.ts +15 -0
- package/types/sky/timeOfDay.d.ts +145 -0
- package/types/styles/animeGameProfile.d.ts +27 -0
- package/types/styles/index.d.ts +17 -0
- package/types/styles/manufacturedStyleLabeling.d.ts +119 -0
- package/types/styles/sceneLayerDocuments.d.ts +145 -0
- package/types/styles/sceneLookComposition.d.ts +53 -0
- package/types/styles/sceneQualityApplication.d.ts +34 -0
- package/types/styles/sceneQualityProfiles.d.ts +13 -0
- package/types/styles/sceneStyleAudit.d.ts +80 -0
- package/types/styles/sceneStyleRuntime.d.ts +1782 -0
- package/types/styles/styleAdapters.d.ts +14 -0
- package/types/styles/styleApplication.d.ts +47 -0
- package/types/styles/styleBundle.d.ts +19 -0
- package/types/styles/styleBundleProvider.d.ts +44 -0
- package/types/styles/styleDomains.d.ts +18 -0
- package/types/styles/styleInspector.d.ts +59 -0
- package/types/styles/styleMaterialContract.d.ts +46 -0
- package/types/styles/styleMetadata.d.ts +11 -0
- package/types/styles/styleTargetDiscovery.d.ts +48 -0
- package/types/styles/styleTargetLabels.d.ts +32 -0
- package/types/styles/styleTargetMaterialCoverage.d.ts +20 -0
- package/types/styles/styleTransaction.d.ts +10 -0
- package/types/styles/styleTypes.d.ts +66 -0
- package/types/texgen/evaluateTexture.d.ts +40 -0
- package/types/texgen/index.d.ts +7 -0
- package/types/texgen/noise2.d.ts +46 -0
- package/types/texgen/textureAi.d.ts +6 -0
- package/types/texgen/textureGenerators.d.ts +261 -0
- package/types/texgen/texturePresets.d.ts +45 -0
- package/types/texgen/textureSettings.d.ts +121 -0
- package/types/texgen/textureThree.d.ts +13 -0
- package/types/toon/characterRenderPasses.d.ts +3 -0
- package/types/toon/index.d.ts +3 -0
- package/types/toon/settings/alphaSettings.d.ts +125 -0
- package/types/toon/settings/averageShadowSettings.d.ts +39 -0
- package/types/toon/settings/baseTextureSettings.d.ts +39 -0
- package/types/toon/settings/celShadeSettings.d.ts +37 -0
- package/types/toon/settings/contactShadowSettings.d.ts +30 -0
- package/types/toon/settings/eyeHighlightSettings.d.ts +55 -0
- package/types/toon/settings/faceLightingSettings.d.ts +32 -0
- package/types/toon/settings/furSettings.d.ts +23 -0
- package/types/toon/settings/glitterSettings.d.ts +43 -0
- package/types/toon/settings/hairHighlightSettings.d.ts +89 -0
- package/types/toon/settings/indirectLightSettings.d.ts +43 -0
- package/types/toon/settings/localLightSettings.d.ts +46 -0
- package/types/toon/settings/materialMapSettings.d.ts +86 -0
- package/types/toon/settings/outlineSettings.d.ts +125 -0
- package/types/toon/settings/perspectiveRemovalSettings.d.ts +14 -0
- package/types/toon/settings/rimLightSettings.d.ts +79 -0
- package/types/toon/settings/sceneShadowSettings.d.ts +32 -0
- package/types/toon/settings/selfShadowSettings.d.ts +44 -0
- package/types/toon/settings/shadowColorSettings.d.ts +77 -0
- package/types/toon/settings/skinToneSettings.d.ts +30 -0
- package/types/toon/settings/specularSettings.d.ts +96 -0
- package/types/toon/settings/stickerSettings.d.ts +40 -0
- package/types/toon/toonMaterialAdapter.d.ts +883 -0
- package/types/toon/toonSettings.d.ts +1182 -0
- package/types/vegetation/branchTree.d.ts +10 -0
- package/types/vegetation/callMeSenseiGrass.d.ts +8 -0
- package/types/vegetation/compiledTree.d.ts +75 -0
- package/types/vegetation/contactShadowField.d.ts +26 -0
- package/types/vegetation/flowerSpecies.d.ts +107 -0
- package/types/vegetation/grass.d.ts +4 -0
- package/types/vegetation/grassClump.d.ts +7 -0
- package/types/vegetation/grassPalettes.d.ts +29 -0
- package/types/vegetation/importedVegetationMaterial.d.ts +13 -0
- package/types/vegetation/index.d.ts +216 -0
- package/types/vegetation/legacyTreePresets.d.ts +22 -0
- package/types/vegetation/scatter.d.ts +12 -0
- package/types/vegetation/stylizedBush.d.ts +2 -0
- package/types/vegetation/stylizedFlower.d.ts +2 -0
- package/types/vegetation/stylizedFlowers.d.ts +8 -0
- package/types/vegetation/stylizedForest.d.ts +3 -0
- package/types/vegetation/stylizedGrass.d.ts +21 -0
- package/types/vegetation/stylizedTree.d.ts +19 -0
- package/types/vegetation/stylizedTreeFoliage.d.ts +18 -0
- package/types/vegetation/stylizedUnderstory.d.ts +50 -0
- package/types/vegetation/treeExport.d.ts +6 -0
- package/types/vegetation/treeSurfaceTextures.d.ts +72 -0
- package/types/vegetation/vegetationShaders.d.ts +74 -0
- package/types/version.d.ts +1 -0
- package/types/water/index.d.ts +1 -0
- package/types/water/sceneOverrideLayers.d.ts +16 -0
- package/types/water/water.d.ts +17 -0
- package/types/water/waterBreakerSystem.d.ts +46 -0
- package/types/water/waterCurrentField.d.ts +115 -0
- package/types/water/waterInteraction.d.ts +21 -0
- package/types/water/waterMaterial.d.ts +60 -0
- package/types/water/waterNearshorePhase.d.ts +5 -0
- package/types/water/waterRain.d.ts +17 -0
- package/types/water/waterRippleSimulation.d.ts +52 -0
- package/types/water/waterScenePasses.d.ts +70 -0
- package/types/water/waterSettings.d.ts +648 -0
- package/types/water/waterShoreMaterial.d.ts +3 -0
- package/types/water/waterShoreStateField.d.ts +2 -0
- package/types/water/waterSplashSystem.d.ts +2 -0
- package/types/water/waterStageSettings.d.ts +9 -0
- package/types/water/waterSurface.d.ts +2 -0
- package/types/water/waterUnderwaterAtmosphere.d.ts +103 -0
- package/types/water/waterVegetation.d.ts +16 -0
- package/types/worldCollision.d.ts +22 -0
- package/AGENTS.md +0 -254
- package/ATTRIBUTION.md +0 -78
- package/docs/characters.md +0 -144
- package/docs/debug-panel.md +0 -126
- package/docs/docs.css +0 -589
- package/docs/environment.md +0 -186
- package/docs/getting-started.md +0 -180
- package/docs/index.html +0 -14
- package/docs/lab-architecture.md +0 -100
- package/docs/lighting.md +0 -825
- package/docs/main.jsx +0 -739
- package/docs/mcp.md +0 -97
- package/docs/post-processing.md +0 -98
- package/docs/settings-reference.md +0 -1878
- package/docs/shader-constants.md +0 -77
- package/docs/sky.md +0 -182
- package/docs/style-labs.md +0 -309
- package/docs/texture-lab.md +0 -135
- package/docs/toon-shading.md +0 -183
- package/docs/tsl-conventions.md +0 -167
- package/docs/vegetation-sky.md +0 -275
- package/docs/water.md +0 -430
- package/docs/weather.md +0 -200
- package/docs/world-scale.md +0 -111
- package/mcp/style-lab-tools.mjs +0 -371
- package/src/ambientfx/INTEGRATION.md +0 -164
- package/src/ambientfx/ambientFxPresets.js +0 -83
- package/src/ambientfx/ambientFxSettings.js +0 -368
- package/src/ambientfx/emitters.js +0 -169
- package/src/ambientfx/index.js +0 -5
- package/src/ambientfx/particleBackbone.js +0 -493
- package/src/ambientfx/stylizedAmbientFx.js +0 -450
- package/src/biome/biomeGenerator.js +0 -385
- package/src/biome/biomeRuntime.js +0 -299
- package/src/biome/index.js +0 -2
- package/src/buildinggen/buildingAsset.js +0 -44
- package/src/buildinggen/buildingGrammar.js +0 -311
- package/src/buildinggen/buildingMesh.js +0 -451
- package/src/buildinggen/buildingPresets.js +0 -46
- package/src/buildinggen/buildingRecipe.js +0 -100
- package/src/buildinggen/buildingSettings.js +0 -238
- package/src/buildinggen/index.js +0 -6
- package/src/camera/cameraDirector.js +0 -157
- package/src/camera/cameraGenerator.js +0 -367
- package/src/camera/cameraRig.js +0 -570
- package/src/camera/cameraSettings.js +0 -236
- package/src/camera/index.js +0 -7
- package/src/catalog/builtinEntries.js +0 -245
- package/src/catalog/catalog.js +0 -210
- package/src/catalog/index.js +0 -3
- package/src/core/shaderBackend.js +0 -24
- package/src/debrisgen/debrisFields.js +0 -544
- package/src/debrisgen/debrisGenerator.js +0 -1929
- package/src/debrisgen/debrisPalettes.js +0 -71
- package/src/debrisgen/debrisPhysics.js +0 -198
- package/src/debrisgen/debrisPresets.js +0 -162
- package/src/debrisgen/debrisSettings.js +0 -333
- package/src/debrisgen/debrisTextures.js +0 -380
- package/src/debrisgen/index.js +0 -5
- package/src/debug/fieldValues.js +0 -95
- package/src/debug/index.js +0 -7
- package/src/debug/settingsPanel.js +0 -170
- package/src/fauna/INTEGRATION.md +0 -174
- package/src/fauna/boids.js +0 -861
- package/src/fauna/faunaBodies.js +0 -492
- package/src/fauna/faunaPresets.js +0 -52
- package/src/fauna/faunaSettings.js +0 -525
- package/src/fauna/index.js +0 -5
- package/src/fauna/stylizedFauna.js +0 -395
- package/src/game-feel/gameFeelGenerator.js +0 -402
- package/src/game-feel/gameFeelRuntime.js +0 -549
- package/src/game-feel/index.js +0 -2
- package/src/motion/index.js +0 -5
- package/src/motion/motionClip.js +0 -441
- package/src/motion/motionController.js +0 -628
- package/src/motion/motionDocuments.js +0 -225
- package/src/motion/motionGraph.js +0 -307
- package/src/motion/motionSettings.js +0 -222
- package/src/pathgen/index.js +0 -7
- package/src/pathgen/pathBridge.js +0 -232
- package/src/pathgen/pathPresets.js +0 -35
- package/src/pathgen/pathRibbon.js +0 -410
- package/src/pathgen/pathRouter.js +0 -380
- package/src/pathgen/pathSettings.js +0 -335
- package/src/pathgen/pathTextures.js +0 -123
- package/src/pathgen/stylizedPaths.js +0 -453
- package/src/propgen/generatorsWave1.js +0 -379
- package/src/propgen/generatorsWave2.js +0 -462
- package/src/propgen/index.js +0 -5
- package/src/propgen/propAsset.js +0 -323
- package/src/propgen/propParts.js +0 -170
- package/src/propgen/propPlacement.js +0 -459
- package/src/propgen/propPresets.js +0 -82
- package/src/propgen/propSettings.js +0 -395
- package/src/soundscape/index.js +0 -4
- package/src/soundscape/soundscapeGenerator.js +0 -179
- package/src/soundscape/soundscapeRuntime.js +0 -806
- package/src/soundscape/soundscapeSettings.js +0 -292
- package/src/stylizedTerrain.js +0 -631
- package/src/stylizedWorld.js +0 -903
- package/src/vegetation/treeRecipe.js +0 -647
- package/src/vfxgen/INTEGRATION.md +0 -145
- package/src/vfxgen/core/burstBackbone.js +0 -380
- package/src/vfxgen/core/projectileCore.js +0 -92
- package/src/vfxgen/core/spriteShapes.js +0 -98
- package/src/vfxgen/core/trailRibbon.js +0 -272
- package/src/vfxgen/core/vfxRandom.js +0 -29
- package/src/vfxgen/effects/emitHelpers.js +0 -37
- package/src/vfxgen/effects/magicEffects.js +0 -162
- package/src/vfxgen/effects/movementEffects.js +0 -87
- package/src/vfxgen/effects/weaponEffects.js +0 -118
- package/src/vfxgen/index.js +0 -18
- package/src/vfxgen/moves/moveController.js +0 -146
- package/src/vfxgen/moves/moveLibrary.js +0 -335
- package/src/vfxgen/vfxPresets.js +0 -98
- package/src/vfxgen/vfxSettings.js +0 -384
- package/src/vfxgen/vfxSystem.js +0 -449
- package/src/vfxgen/weapons/stylizedWeapons.js +0 -137
- package/src/villagegen/index.js +0 -4
- package/src/villagegen/stylizedVillage.js +0 -490
- package/src/villagegen/villageArchetypes.js +0 -160
- package/src/villagegen/villageNames.js +0 -40
- package/src/villagegen/villageSites.js +0 -105
- package/src/weather/index.js +0 -6
- package/src/weather/weatherPrecipitation.js +0 -221
- package/src/weather/weatherPresets.js +0 -258
- package/src/weather/weatherSettings.js +0 -269
- package/src/weather/weatherSystem.js +0 -871
- package/src/worldMinimap.js +0 -214
- package/src/worldPresets.js +0 -125
|
@@ -1,18 +1,61 @@
|
|
|
1
|
-
// Named environment presets:
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
1
|
+
// Named environment presets: a preset is a STYLE — a coherent,
|
|
2
|
+
// reference-checked identity (shader features/parameters plus rig hints)
|
|
3
|
+
// that resolves in every canonical SCENARIO (venue × time of day), the same
|
|
4
|
+
// way a lighting style's dayCycle covers every hour and a sky style renders
|
|
5
|
+
// every scenario. Selecting "Call Me Sensei" never means "one baked moment";
|
|
6
|
+
// it means the Call Me Sensei rendition of whichever scenario the scene is
|
|
7
|
+
// in. Registry mirrors the character preset helpers in toonSettings.js.
|
|
5
8
|
//
|
|
6
9
|
// 'default' stays an empty override layer so the shipped baseline (the
|
|
7
10
|
// approved Liyue room look) never shifts underneath integrators.
|
|
8
11
|
|
|
9
12
|
import { ENVIRONMENT_SETTING_FIELD_SCHEMA } from './environmentSettings.js';
|
|
13
|
+
import { isProtectedSystemStyleId } from '../core/systemStylePolicy.js';
|
|
14
|
+
import {
|
|
15
|
+
createManufacturedMaterialLook,
|
|
16
|
+
validateManufacturedMaterialLook,
|
|
17
|
+
} from './manufacturedMaterialContract.js';
|
|
10
18
|
|
|
11
19
|
/** Document type tag stamped on shareable environment preset JSON documents. */
|
|
12
20
|
export const ENVIRONMENT_PRESET_DOCUMENT_TYPE = 'toonlab/environment-preset';
|
|
13
21
|
|
|
14
|
-
/**
|
|
15
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Current schema version for environment preset documents.
|
|
24
|
+
* v2 adds `preset.scenarios`; v3 adds `preset.materialLook`.
|
|
25
|
+
*/
|
|
26
|
+
export const ENVIRONMENT_PRESET_SCHEMA_VERSION = 3;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Canonical environment scenarios — the world-state axis (venue × time of
|
|
30
|
+
* day). Every style resolves in every scenario via
|
|
31
|
+
* `resolveEnvironmentPreset(style, scenario)`; styles author variants under
|
|
32
|
+
* `scenarios` and inherit the canonical rendition for the rest.
|
|
33
|
+
*/
|
|
34
|
+
export const ENVIRONMENT_SCENARIOS = Object.freeze([
|
|
35
|
+
Object.freeze({ description: 'Sunlit interior at midday.', id: 'interiorDay', label: 'Interior Day' }),
|
|
36
|
+
Object.freeze({ description: 'Warm lamps balanced against low evening sun.', id: 'interiorEvening', label: 'Interior Evening' }),
|
|
37
|
+
Object.freeze({ description: 'Lamp-lit interior after dark, sun off.', id: 'interiorNight', label: 'Interior Night' }),
|
|
38
|
+
Object.freeze({ description: 'Open-air daylight with sky tint and height fog.', id: 'exteriorDay', label: 'Exterior Day' }),
|
|
39
|
+
]);
|
|
40
|
+
|
|
41
|
+
const ENVIRONMENT_SCENARIO_IDS = new Set(ENVIRONMENT_SCENARIOS.map((scenario) => scenario.id));
|
|
42
|
+
|
|
43
|
+
/** Lists the canonical scenarios as `{ id, label, description }` (for HUDs). */
|
|
44
|
+
export function getEnvironmentScenarioOptions() {
|
|
45
|
+
return ENVIRONMENT_SCENARIOS.map(({ description, id, label }) => ({ description, id, label }));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Historical single-look preset ids. Each was the Default style's rendition
|
|
50
|
+
* of one scenario; they now resolve as exactly that, byte-identical. Kept
|
|
51
|
+
* indefinitely for saved bundles, lab links, and downstream games.
|
|
52
|
+
*/
|
|
53
|
+
export const ENVIRONMENT_PRESET_ALIASES = Object.freeze({
|
|
54
|
+
exteriorDay: Object.freeze({ preset: 'default', scenario: 'exteriorDay' }),
|
|
55
|
+
interiorDay: Object.freeze({ preset: 'default', scenario: 'interiorDay' }),
|
|
56
|
+
interiorEvening: Object.freeze({ preset: 'default', scenario: 'interiorEvening' }),
|
|
57
|
+
interiorNight: Object.freeze({ preset: 'default', scenario: 'interiorNight' }),
|
|
58
|
+
});
|
|
16
59
|
|
|
17
60
|
// Rig keys consumed by the shipped scene integrations. Unknown rig keys are
|
|
18
61
|
// kept (integrations may carry custom hints) but flagged with a warning.
|
|
@@ -29,41 +72,118 @@ const KNOWN_ENVIRONMENT_RIG_KEYS = Object.freeze(new Set([
|
|
|
29
72
|
|
|
30
73
|
const ENVIRONMENT_PRESETS = new Map();
|
|
31
74
|
|
|
75
|
+
function scenarioPartial(source) {
|
|
76
|
+
const partial = source && typeof source === 'object' && !Array.isArray(source) ? source : {};
|
|
77
|
+
return {
|
|
78
|
+
features: { ...(partial.features ?? {}) },
|
|
79
|
+
parameters: { ...(partial.parameters ?? {}) },
|
|
80
|
+
rig: { ...(partial.rig ?? {}) },
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
32
84
|
export function registerEnvironmentPreset(name, preset, { overwrite = false } = {}) {
|
|
33
85
|
const key = String(name ?? '').trim();
|
|
34
86
|
if (!key) throw new Error('Environment preset name is required.');
|
|
87
|
+
if (overwrite && isProtectedSystemStyleId(key) && ENVIRONMENT_PRESETS.has(key)) {
|
|
88
|
+
throw new Error(`System style "${key}" is read-only.`);
|
|
89
|
+
}
|
|
35
90
|
if (!overwrite && ENVIRONMENT_PRESETS.has(key)) {
|
|
36
91
|
throw new Error(`Environment preset "${key}" is already registered.`);
|
|
37
92
|
}
|
|
93
|
+
const source = preset && typeof preset === 'object' ? preset : {};
|
|
94
|
+
const scenarios = {};
|
|
95
|
+
for (const [scenarioId, partial] of Object.entries(source.scenarios ?? {})) {
|
|
96
|
+
if (!ENVIRONMENT_SCENARIO_IDS.has(scenarioId)) continue;
|
|
97
|
+
scenarios[scenarioId] = scenarioPartial(partial);
|
|
98
|
+
}
|
|
38
99
|
ENVIRONMENT_PRESETS.set(key, {
|
|
39
100
|
features: {},
|
|
40
101
|
label: key,
|
|
41
102
|
parameters: {},
|
|
42
103
|
rig: {},
|
|
43
|
-
...
|
|
104
|
+
...source,
|
|
105
|
+
materialLook: createManufacturedMaterialLook(source.materialLook),
|
|
106
|
+
scenarios,
|
|
44
107
|
});
|
|
45
108
|
return key;
|
|
46
109
|
}
|
|
47
110
|
|
|
111
|
+
/**
|
|
112
|
+
* Folds any reference — style id, legacy single-look id, or unknown — to a
|
|
113
|
+
* resolvable id. Legacy scenario ids stay themselves (they resolve through
|
|
114
|
+
* {@link ENVIRONMENT_PRESET_ALIASES}); unknown ids fall back to 'default'.
|
|
115
|
+
*/
|
|
48
116
|
export function normalizeEnvironmentPresetName(name) {
|
|
49
117
|
const key = String(name ?? 'default').trim();
|
|
50
|
-
|
|
118
|
+
if (ENVIRONMENT_PRESETS.has(key) || ENVIRONMENT_PRESET_ALIASES[key]) return key;
|
|
119
|
+
return 'default';
|
|
51
120
|
}
|
|
52
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Lists registered environment STYLES as `{ label, value, scenarios }`,
|
|
124
|
+
* where `scenarios` reports per-scenario coverage (`'authored'` vs
|
|
125
|
+
* `'inherited'`). Every style covers every scenario either way.
|
|
126
|
+
*/
|
|
53
127
|
export function getEnvironmentPresetOptions() {
|
|
54
128
|
return Array.from(ENVIRONMENT_PRESETS.entries())
|
|
55
|
-
.map(([value, preset]) => ({
|
|
129
|
+
.map(([value, preset]) => ({
|
|
130
|
+
label: preset.label,
|
|
131
|
+
scenarios: Object.fromEntries(ENVIRONMENT_SCENARIOS.map((scenario) => [
|
|
132
|
+
scenario.id,
|
|
133
|
+
preset.scenarios?.[scenario.id] ? 'authored' : 'inherited',
|
|
134
|
+
])),
|
|
135
|
+
value,
|
|
136
|
+
}));
|
|
56
137
|
}
|
|
57
138
|
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
139
|
+
// A style's complete payload for one scenario: authored variant over the
|
|
140
|
+
// style base when the style ships one, otherwise the canonical rendition
|
|
141
|
+
// (the Default style's variant) over the style base. Sections merge
|
|
142
|
+
// shallowly (features / parameters / rig). `materialLook` is stable style
|
|
143
|
+
// identity and does not vary with scene time/venue.
|
|
144
|
+
function resolveEnvironmentStyleVariant(preset, scenarioId) {
|
|
145
|
+
const base = {
|
|
63
146
|
features: { ...preset.features },
|
|
147
|
+
materialLook: createManufacturedMaterialLook(preset.materialLook),
|
|
64
148
|
parameters: { ...preset.parameters },
|
|
65
149
|
rig: { ...preset.rig },
|
|
66
150
|
};
|
|
151
|
+
const partial = preset.scenarios?.[scenarioId]
|
|
152
|
+
?? ENVIRONMENT_PRESETS.get('default')?.scenarios?.[scenarioId];
|
|
153
|
+
if (!partial) return base;
|
|
154
|
+
return {
|
|
155
|
+
features: { ...base.features, ...partial.features },
|
|
156
|
+
materialLook: base.materialLook,
|
|
157
|
+
parameters: { ...base.parameters, ...partial.parameters },
|
|
158
|
+
rig: { ...base.rig, ...partial.rig },
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Returns { features, materialLook, parameters, rig } ready to spread into
|
|
164
|
+
* applyEnvironmentShader options and the rig constructors.
|
|
165
|
+
*
|
|
166
|
+
* `name` selects a STYLE; the optional `scenario` (one of
|
|
167
|
+
* {@link ENVIRONMENT_SCENARIOS}) selects that style's rendition of a venue ×
|
|
168
|
+
* time of day. Without a scenario the style's base look is returned
|
|
169
|
+
* unchanged. Legacy single-look ids (`interiorDay`, `interiorEvening`,
|
|
170
|
+
* `interiorNight`, `exteriorDay`) resolve as the Default style at that
|
|
171
|
+
* scenario with identical settings.
|
|
172
|
+
*/
|
|
173
|
+
export function resolveEnvironmentPreset(name, scenario = undefined) {
|
|
174
|
+
const key = String(name ?? 'default').trim();
|
|
175
|
+
const alias = ENVIRONMENT_PRESETS.has(key) ? undefined : ENVIRONMENT_PRESET_ALIASES[key];
|
|
176
|
+
const preset = ENVIRONMENT_PRESETS.get(alias?.preset ?? normalizeEnvironmentPresetName(key));
|
|
177
|
+
const scenarioId = ENVIRONMENT_SCENARIO_IDS.has(scenario) ? scenario : alias?.scenario;
|
|
178
|
+
if (scenarioId === undefined) {
|
|
179
|
+
return {
|
|
180
|
+
features: { ...preset.features },
|
|
181
|
+
materialLook: createManufacturedMaterialLook(preset.materialLook),
|
|
182
|
+
parameters: { ...preset.parameters },
|
|
183
|
+
rig: { ...preset.rig },
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
return resolveEnvironmentStyleVariant(preset, scenarioId);
|
|
67
187
|
}
|
|
68
188
|
|
|
69
189
|
function isPlainObject(value) {
|
|
@@ -171,6 +291,10 @@ export function sanitizeEnvironmentPreset(preset) {
|
|
|
171
291
|
rig[key] = entry;
|
|
172
292
|
}
|
|
173
293
|
|
|
294
|
+
const materialLookResult = validateManufacturedMaterialLook(source.materialLook);
|
|
295
|
+
errors.push(...materialLookResult.errors);
|
|
296
|
+
warnings.push(...materialLookResult.warnings);
|
|
297
|
+
|
|
174
298
|
const ok = errors.length === 0;
|
|
175
299
|
return {
|
|
176
300
|
errors,
|
|
@@ -180,6 +304,7 @@ export function sanitizeEnvironmentPreset(preset) {
|
|
|
180
304
|
description: String(source.description ?? ''),
|
|
181
305
|
features,
|
|
182
306
|
label: String(source.label ?? ''),
|
|
307
|
+
materialLook: materialLookResult.value,
|
|
183
308
|
parameters,
|
|
184
309
|
rig,
|
|
185
310
|
}
|
|
@@ -188,13 +313,44 @@ export function sanitizeEnvironmentPreset(preset) {
|
|
|
188
313
|
};
|
|
189
314
|
}
|
|
190
315
|
|
|
316
|
+
// Sanitizes a `scenarios` map: unknown scenario ids are dropped with a
|
|
317
|
+
// warning; each variant is a partial {features, parameters, rig} validated
|
|
318
|
+
// against the same schema as the base payload.
|
|
319
|
+
function sanitizeEnvironmentScenarios(input) {
|
|
320
|
+
const errors = [];
|
|
321
|
+
const warnings = [];
|
|
322
|
+
const scenarios = {};
|
|
323
|
+
for (const [scenarioId, partial] of Object.entries(cleanObject(input))) {
|
|
324
|
+
if (!ENVIRONMENT_SCENARIO_IDS.has(scenarioId)) {
|
|
325
|
+
warnings.push(`Unknown environment scenario "${scenarioId}" was ignored.`);
|
|
326
|
+
continue;
|
|
327
|
+
}
|
|
328
|
+
const sanitized = sanitizeEnvironmentPreset(cleanObject(partial));
|
|
329
|
+
errors.push(...sanitized.errors.map((error) => `Scenario "${scenarioId}": ${error}`));
|
|
330
|
+
warnings.push(...sanitized.warnings.map((warning) => `Scenario "${scenarioId}": ${warning}`));
|
|
331
|
+
if (sanitized.ok) {
|
|
332
|
+
scenarios[scenarioId] = {
|
|
333
|
+
features: sanitized.value.features,
|
|
334
|
+
parameters: sanitized.value.parameters,
|
|
335
|
+
rig: sanitized.value.rig,
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return {
|
|
340
|
+
errors,
|
|
341
|
+
scenarios: Object.keys(scenarios).length > 0 ? scenarios : undefined,
|
|
342
|
+
warnings,
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
|
|
191
346
|
/**
|
|
192
347
|
* Serializes a registered environment preset into a shareable JSON document
|
|
193
|
-
* (`{ type, schemaVersion, id, label, description, preset }
|
|
348
|
+
* (`{ type, schemaVersion, id, label, description, preset }`, with
|
|
349
|
+
* `preset.scenarios` when the style authors variants). The registered
|
|
194
350
|
* preset itself is untouched; `label`/`description` overrides only affect the
|
|
195
351
|
* emitted document.
|
|
196
352
|
*
|
|
197
|
-
* @param {string} name Registered preset name (e.g. '
|
|
353
|
+
* @param {string} name Registered preset name (e.g. 'call_me_sensei').
|
|
198
354
|
* @param {{ label?: string, description?: string }} [overrides] Optional label/description overrides.
|
|
199
355
|
* @returns {object} Environment preset document ready for `JSON.stringify`.
|
|
200
356
|
* @throws {Error} If the preset is not registered or fails sanitization.
|
|
@@ -210,6 +366,8 @@ export function createEnvironmentPresetDocument(name, { description, label } = {
|
|
|
210
366
|
label: label ?? preset.label ?? key,
|
|
211
367
|
});
|
|
212
368
|
if (!sanitized.ok) throw new Error(sanitized.errors.join(' '));
|
|
369
|
+
const scenarioResult = sanitizeEnvironmentScenarios(preset.scenarios);
|
|
370
|
+
if (scenarioResult.errors.length > 0) throw new Error(scenarioResult.errors.join(' '));
|
|
213
371
|
|
|
214
372
|
return {
|
|
215
373
|
description: sanitized.value.description,
|
|
@@ -217,8 +375,10 @@ export function createEnvironmentPresetDocument(name, { description, label } = {
|
|
|
217
375
|
label: sanitized.value.label,
|
|
218
376
|
preset: {
|
|
219
377
|
features: sanitized.value.features,
|
|
378
|
+
materialLook: sanitized.value.materialLook,
|
|
220
379
|
parameters: sanitized.value.parameters,
|
|
221
380
|
rig: sanitized.value.rig,
|
|
381
|
+
...(scenarioResult.scenarios === undefined ? {} : { scenarios: scenarioResult.scenarios }),
|
|
222
382
|
},
|
|
223
383
|
schemaVersion: ENVIRONMENT_PRESET_SCHEMA_VERSION,
|
|
224
384
|
type: ENVIRONMENT_PRESET_DOCUMENT_TYPE,
|
|
@@ -285,6 +445,11 @@ export function validateEnvironmentPresetDocument(input) {
|
|
|
285
445
|
});
|
|
286
446
|
errors.push(...sanitized.errors);
|
|
287
447
|
warnings.push(...sanitized.warnings);
|
|
448
|
+
// v1 documents carry a single flat look and no scenarios; they stay valid
|
|
449
|
+
// as a style whose scenarios inherit the canonical renditions.
|
|
450
|
+
const scenarioResult = sanitizeEnvironmentScenarios(presetSource.scenarios);
|
|
451
|
+
errors.push(...scenarioResult.errors);
|
|
452
|
+
warnings.push(...scenarioResult.warnings);
|
|
288
453
|
|
|
289
454
|
const ok = errors.length === 0;
|
|
290
455
|
return {
|
|
@@ -296,8 +461,10 @@ export function validateEnvironmentPresetDocument(input) {
|
|
|
296
461
|
features: sanitized.value.features,
|
|
297
462
|
id,
|
|
298
463
|
label: sanitized.value.label,
|
|
464
|
+
materialLook: sanitized.value.materialLook,
|
|
299
465
|
parameters: sanitized.value.parameters,
|
|
300
466
|
rig: sanitized.value.rig,
|
|
467
|
+
...(scenarioResult.scenarios === undefined ? {} : { scenarios: scenarioResult.scenarios }),
|
|
301
468
|
}
|
|
302
469
|
: null,
|
|
303
470
|
warnings,
|
|
@@ -318,61 +485,81 @@ export function registerEnvironmentPresetDocument(document, { overwrite = false
|
|
|
318
485
|
return registerEnvironmentPreset(result.value.id, result.value, { overwrite });
|
|
319
486
|
}
|
|
320
487
|
|
|
488
|
+
// Built-in STYLES. Every style resolves in every canonical scenario; the
|
|
489
|
+
// historical single-look ids (interiorDay/interiorEvening/interiorNight/
|
|
490
|
+
// exteriorDay) resolve through ENVIRONMENT_PRESET_ALIASES as the Default
|
|
491
|
+
// style at that scenario, byte-identical to the presets they replaced.
|
|
492
|
+
|
|
321
493
|
registerEnvironmentPreset('default', {
|
|
322
494
|
label: 'Default (Baseline)',
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
495
|
+
// Canonical scenario renditions — settings identical to the historical
|
|
496
|
+
// flat presets of the same name. Styles that do not author a scenario
|
|
497
|
+
// inherit these over their own base.
|
|
498
|
+
scenarios: {
|
|
499
|
+
interiorDay: {
|
|
500
|
+
parameters: {
|
|
501
|
+
ambientProbeBlend: 0.35,
|
|
502
|
+
ambientStrength: 0.22,
|
|
503
|
+
aoWarmth: 0.6,
|
|
504
|
+
interiorOcclusionStrength: 0.5,
|
|
505
|
+
},
|
|
506
|
+
rig: {
|
|
507
|
+
dustMotes: true,
|
|
508
|
+
probe: true,
|
|
509
|
+
sun: true,
|
|
510
|
+
timeOfDayHour: 12,
|
|
511
|
+
},
|
|
512
|
+
},
|
|
513
|
+
interiorEvening: {
|
|
514
|
+
parameters: {
|
|
515
|
+
ambientProbeBlend: 0.4,
|
|
516
|
+
ambientStrength: 0.42,
|
|
517
|
+
directLightStrength: 0.85,
|
|
518
|
+
interiorOcclusionStrength: 0.42,
|
|
519
|
+
shadowLift: 0.3,
|
|
520
|
+
spotLightStrength: 0.55,
|
|
521
|
+
},
|
|
522
|
+
rig: {
|
|
523
|
+
dustMotes: true,
|
|
524
|
+
lampIntensity: 0.8,
|
|
525
|
+
probe: true,
|
|
526
|
+
spotShadows: true,
|
|
527
|
+
sun: true,
|
|
528
|
+
timeOfDayHour: 18,
|
|
529
|
+
},
|
|
530
|
+
},
|
|
531
|
+
interiorNight: {
|
|
532
|
+
parameters: {
|
|
533
|
+
ambientProbeBlend: 0.4,
|
|
534
|
+
emissiveStrength: 0.7,
|
|
535
|
+
pointLightStrength: 0.36,
|
|
536
|
+
shadowLift: 0.56,
|
|
537
|
+
spotLightStrength: 0.85,
|
|
538
|
+
},
|
|
539
|
+
rig: {
|
|
540
|
+
lampIntensity: 1.3,
|
|
541
|
+
probe: true,
|
|
542
|
+
spotShadows: true,
|
|
543
|
+
sun: false,
|
|
544
|
+
timeOfDayHour: 22,
|
|
545
|
+
},
|
|
546
|
+
},
|
|
547
|
+
exteriorDay: {
|
|
548
|
+
features: {
|
|
549
|
+
leftSideShadow: false,
|
|
550
|
+
windowCutout: false,
|
|
551
|
+
},
|
|
552
|
+
parameters: {
|
|
553
|
+
cloudShadowStrength: 0.35,
|
|
554
|
+
heightFogDensity: 0.012,
|
|
555
|
+
heightFogFalloff: 9,
|
|
556
|
+
skyTintStrength: 0.4,
|
|
557
|
+
},
|
|
558
|
+
rig: {
|
|
559
|
+
sun: true,
|
|
560
|
+
timeOfDayHour: 12,
|
|
561
|
+
},
|
|
562
|
+
},
|
|
376
563
|
},
|
|
377
564
|
});
|
|
378
565
|
|
|
@@ -401,24 +588,6 @@ registerEnvironmentPreset('interiorStudio', {
|
|
|
401
588
|
},
|
|
402
589
|
});
|
|
403
590
|
|
|
404
|
-
registerEnvironmentPreset('exteriorDay', {
|
|
405
|
-
label: 'Exterior Day',
|
|
406
|
-
features: {
|
|
407
|
-
leftSideShadow: false,
|
|
408
|
-
windowCutout: false,
|
|
409
|
-
},
|
|
410
|
-
parameters: {
|
|
411
|
-
cloudShadowStrength: 0.35,
|
|
412
|
-
heightFogDensity: 0.012,
|
|
413
|
-
heightFogFalloff: 9,
|
|
414
|
-
skyTintStrength: 0.4,
|
|
415
|
-
},
|
|
416
|
-
rig: {
|
|
417
|
-
sun: true,
|
|
418
|
-
timeOfDayHour: 12,
|
|
419
|
-
},
|
|
420
|
-
});
|
|
421
|
-
|
|
422
591
|
// Everything on with demo values: a feature tour, not a production look
|
|
423
592
|
// (pairs with the character 'showcase' preset).
|
|
424
593
|
registerEnvironmentPreset('showcase', {
|
|
@@ -448,15 +617,152 @@ registerEnvironmentPreset('showcase', {
|
|
|
448
617
|
// registerEnvironmentPreset / environment preset documents.
|
|
449
618
|
registerEnvironmentPreset('call_me_sensei', {
|
|
450
619
|
label: 'Call Me Sensei',
|
|
620
|
+
// Sparse material/object response over the base look. These are IP-owned
|
|
621
|
+
// settings; assets keep the same stable classification under other styles.
|
|
622
|
+
materialLook: {
|
|
623
|
+
version: 1,
|
|
624
|
+
baseMaterials: {
|
|
625
|
+
glass: {
|
|
626
|
+
parameters: {
|
|
627
|
+
normalMapStrength: 0.35,
|
|
628
|
+
specularShininess: 78,
|
|
629
|
+
specularStrength: 0.42,
|
|
630
|
+
},
|
|
631
|
+
},
|
|
632
|
+
metal: {
|
|
633
|
+
parameters: {
|
|
634
|
+
normalMapStrength: 0.68,
|
|
635
|
+
specularShininess: 58,
|
|
636
|
+
specularStrength: 0.26,
|
|
637
|
+
},
|
|
638
|
+
},
|
|
639
|
+
mineral: {
|
|
640
|
+
parameters: {
|
|
641
|
+
normalMapStrength: 0.82,
|
|
642
|
+
specularStrength: 0.05,
|
|
643
|
+
},
|
|
644
|
+
},
|
|
645
|
+
rubber: {
|
|
646
|
+
parameters: {
|
|
647
|
+
normalMapStrength: 0.5,
|
|
648
|
+
specularStrength: 0.025,
|
|
649
|
+
},
|
|
650
|
+
},
|
|
651
|
+
},
|
|
652
|
+
contentFlags: {
|
|
653
|
+
emissive: {
|
|
654
|
+
parameters: { emissiveStrength: 0.82 },
|
|
655
|
+
},
|
|
656
|
+
graphic: {
|
|
657
|
+
parameters: {
|
|
658
|
+
normalMapStrength: 0.2,
|
|
659
|
+
specularStrength: 0.035,
|
|
660
|
+
},
|
|
661
|
+
},
|
|
662
|
+
},
|
|
663
|
+
objectClasses: {
|
|
664
|
+
buildingExterior: {
|
|
665
|
+
parameters: { normalMapStrength: 0.66 },
|
|
666
|
+
},
|
|
667
|
+
},
|
|
668
|
+
structuralRoles: {
|
|
669
|
+
cavity: {
|
|
670
|
+
parameters: { shadowLift: 0.28 },
|
|
671
|
+
},
|
|
672
|
+
},
|
|
673
|
+
},
|
|
674
|
+
// Identity base: luminous blue-filled shade, restrained aerial haze, and
|
|
675
|
+
// enough contrast for the light to stay alive. This preset is frequently
|
|
676
|
+
// applied directly by games (without createStylizedWorld), so its base
|
|
677
|
+
// must itself be production-safe at outdoor scale.
|
|
451
678
|
parameters: {
|
|
452
|
-
ambientProbeBlend: 0.
|
|
679
|
+
ambientProbeBlend: 0.45,
|
|
680
|
+
ambientStrength: 0.38,
|
|
453
681
|
aoWarmth: 0.5,
|
|
454
|
-
|
|
455
|
-
|
|
682
|
+
cloudShadowCoverage: 0.55,
|
|
683
|
+
cloudShadowScale: 0.008,
|
|
684
|
+
cloudShadowStrength: 0.52,
|
|
685
|
+
directLightStrength: 1.12,
|
|
686
|
+
exposure: 1.06,
|
|
687
|
+
heightFogColor: [0.63, 0.8, 0.98],
|
|
688
|
+
heightFogDensity: 0.00055,
|
|
689
|
+
heightFogFalloff: 400,
|
|
690
|
+
lightingInfluence: 0.96,
|
|
691
|
+
saturation: 1.2,
|
|
692
|
+
shadowLift: 0.42,
|
|
693
|
+
shadowTintColor: [0.68, 0.74, 0.94],
|
|
694
|
+
skyTintStrength: 0.16,
|
|
695
|
+
sunShadowStrength: 0.72,
|
|
696
|
+
triplanarDetail: 1,
|
|
697
|
+
triplanarDetailScale: 28,
|
|
698
|
+
triplanarEdgeHighlight: 0.7,
|
|
699
|
+
untexturedGradientStrength: 0.52,
|
|
456
700
|
},
|
|
457
701
|
rig: {
|
|
458
702
|
probe: true,
|
|
459
703
|
sun: true,
|
|
460
704
|
timeOfDayHour: 14,
|
|
461
705
|
},
|
|
706
|
+
// The signature style authors every scenario itself — vivid variants of
|
|
707
|
+
// the canonical venue × time renditions, never a single baked moment.
|
|
708
|
+
scenarios: {
|
|
709
|
+
interiorDay: {
|
|
710
|
+
parameters: {
|
|
711
|
+
ambientStrength: 0.24,
|
|
712
|
+
aoWarmth: 0.55,
|
|
713
|
+
interiorOcclusionStrength: 0.45,
|
|
714
|
+
},
|
|
715
|
+
rig: {
|
|
716
|
+
dustMotes: true,
|
|
717
|
+
timeOfDayHour: 12,
|
|
718
|
+
},
|
|
719
|
+
},
|
|
720
|
+
interiorEvening: {
|
|
721
|
+
parameters: {
|
|
722
|
+
ambientProbeBlend: 0.4,
|
|
723
|
+
ambientStrength: 0.4,
|
|
724
|
+
directLightStrength: 0.85,
|
|
725
|
+
interiorOcclusionStrength: 0.4,
|
|
726
|
+
shadowLift: 0.32,
|
|
727
|
+
spotLightStrength: 0.6,
|
|
728
|
+
},
|
|
729
|
+
rig: {
|
|
730
|
+
dustMotes: true,
|
|
731
|
+
lampIntensity: 0.85,
|
|
732
|
+
spotShadows: true,
|
|
733
|
+
timeOfDayHour: 18,
|
|
734
|
+
},
|
|
735
|
+
},
|
|
736
|
+
interiorNight: {
|
|
737
|
+
parameters: {
|
|
738
|
+
ambientProbeBlend: 0.4,
|
|
739
|
+
emissiveStrength: 0.75,
|
|
740
|
+
pointLightStrength: 0.4,
|
|
741
|
+
shadowLift: 0.58,
|
|
742
|
+
spotLightStrength: 0.9,
|
|
743
|
+
},
|
|
744
|
+
rig: {
|
|
745
|
+
lampIntensity: 1.35,
|
|
746
|
+
spotShadows: true,
|
|
747
|
+
sun: false,
|
|
748
|
+
timeOfDayHour: 22,
|
|
749
|
+
},
|
|
750
|
+
},
|
|
751
|
+
exteriorDay: {
|
|
752
|
+
features: {
|
|
753
|
+
leftSideShadow: false,
|
|
754
|
+
windowCutout: false,
|
|
755
|
+
},
|
|
756
|
+
parameters: {
|
|
757
|
+
cloudShadowCoverage: 0.55,
|
|
758
|
+
cloudShadowScale: 0.008,
|
|
759
|
+
cloudShadowStrength: 0.52,
|
|
760
|
+
heightFogDensity: 0.00055,
|
|
761
|
+
heightFogFalloff: 400,
|
|
762
|
+
},
|
|
763
|
+
rig: {
|
|
764
|
+
timeOfDayHour: 14,
|
|
765
|
+
},
|
|
766
|
+
},
|
|
767
|
+
},
|
|
462
768
|
});
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
viewportSize,
|
|
24
24
|
} from 'three/tsl';
|
|
25
25
|
import { NodeMaterial } from 'three/webgpu';
|
|
26
|
+
import { markFactorySystemOwned } from '../styles/styleMetadata.js';
|
|
26
27
|
|
|
27
28
|
// Scene-level environment rigs as reusable library modules: the sun rig
|
|
28
29
|
// (directional light + shadow + painterly disk/spill/beam/shaft accents),
|
|
@@ -38,6 +39,11 @@ import { NodeMaterial } from 'three/webgpu';
|
|
|
38
39
|
const backdropTextureLoader = new THREE.TextureLoader();
|
|
39
40
|
const backdropTextureCache = new Map();
|
|
40
41
|
|
|
42
|
+
// ToonLab's surface-light adapter normalizes directional irradiance by PI.
|
|
43
|
+
// Keep the public rig input in intuitive "suns" while converting once at the
|
|
44
|
+
// Three light boundary.
|
|
45
|
+
export const ENVIRONMENT_SUN_INTENSITY_SCALE = Math.PI;
|
|
46
|
+
|
|
41
47
|
export function environmentRelativePoint(environmentBox, ratios, target = new THREE.Vector3()) {
|
|
42
48
|
const center = environmentBox.getCenter(new THREE.Vector3());
|
|
43
49
|
const size = environmentBox.getSize(new THREE.Vector3());
|
|
@@ -154,8 +160,12 @@ export function createEnvironmentSunRig({
|
|
|
154
160
|
|
|
155
161
|
const group = new THREE.Group();
|
|
156
162
|
group.name = 'Environment sun rig';
|
|
163
|
+
markFactorySystemOwned(group, 'lighting', 'toonlab/environment-sun-rig');
|
|
157
164
|
|
|
158
|
-
const light = new THREE.DirectionalLight(
|
|
165
|
+
const light = new THREE.DirectionalLight(
|
|
166
|
+
color,
|
|
167
|
+
intensity * ENVIRONMENT_SUN_INTENSITY_SCALE,
|
|
168
|
+
);
|
|
159
169
|
light.name = 'Environment sun key';
|
|
160
170
|
light.castShadow = shadow.enabled !== false;
|
|
161
171
|
light.shadow.mapSize.set(mapSize, mapSize);
|
|
@@ -253,7 +263,9 @@ export function createEnvironmentSunRig({
|
|
|
253
263
|
shaftOpacity,
|
|
254
264
|
} = {}) {
|
|
255
265
|
if (nextColor) light.color.set(nextColor);
|
|
256
|
-
if (Number.isFinite(nextIntensity))
|
|
266
|
+
if (Number.isFinite(nextIntensity)) {
|
|
267
|
+
light.intensity = nextIntensity * ENVIRONMENT_SUN_INTENSITY_SCALE;
|
|
268
|
+
}
|
|
257
269
|
if (nextSource) {
|
|
258
270
|
light.position.copy(environmentRelativePoint(environmentBox, nextSource));
|
|
259
271
|
disk?.position.copy(light.position).multiplyScalar(1.15);
|
|
@@ -383,6 +395,7 @@ export function createEnvironmentLampRig({
|
|
|
383
395
|
|
|
384
396
|
const group = new THREE.Group();
|
|
385
397
|
group.name = 'Environment lamp rig';
|
|
398
|
+
markFactorySystemOwned(group, 'lighting', 'toonlab/environment-lamp-rig');
|
|
386
399
|
const lamps = [];
|
|
387
400
|
|
|
388
401
|
lampPositions.forEach((position, index) => {
|
|
@@ -538,6 +551,7 @@ export function createEnvironmentBackdrop({
|
|
|
538
551
|
new THREE.MeshBasicMaterial({ toneMapped: false }),
|
|
539
552
|
);
|
|
540
553
|
mesh.name = 'Environment backdrop';
|
|
554
|
+
markFactorySystemOwned(mesh, 'sky', 'toonlab/environment-backdrop');
|
|
541
555
|
mesh.position.set(
|
|
542
556
|
center.x,
|
|
543
557
|
yOffset ?? environmentBox.min.y + size.y * 0.57,
|
|
@@ -683,6 +697,7 @@ export function createEnvironmentDustMotes({
|
|
|
683
697
|
for (let i = 0; i < count; i += 1) instances.setMatrixAt(i, identity);
|
|
684
698
|
instances.instanceMatrix.needsUpdate = true;
|
|
685
699
|
instances.name = 'Environment dust motes';
|
|
700
|
+
markFactorySystemOwned(instances, 'lighting', 'toonlab/environment-dust-motes');
|
|
686
701
|
instances.frustumCulled = false;
|
|
687
702
|
instances.renderOrder = 16;
|
|
688
703
|
scene.add(instances);
|