feat(paint-slots): concrete-plate finish + try defaults (wall=concrete, slab=wood plank 48, ceiling=soft white)
- material-library: add 'concrete-plate' KTX2 finish (512, fabric/leather-style pipeline) + editor-app texture mirror. - viewer: shared resolveSlotDefaultMaterial(colour|library ref) so a kind's slot default can be a catalog finish, not just a flat colour. - wall default -> library:concrete-plate (interior + exterior). - slab default -> library:wood-woodplank48 (slab geometry resolves it via the shared helper). - ceiling default -> soft white #f2eee6 (ceiling renders flat-tinted). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
967a905e3b
commit
737c4e9d1d
@@ -69,6 +69,7 @@ export {
|
||||
PRESET_PALETTES,
|
||||
type RenderShading,
|
||||
resolveMaterialRef,
|
||||
resolveSlotDefaultMaterial,
|
||||
resolveSurfaceColor,
|
||||
WHITE_PALETTE,
|
||||
} from './lib/materials'
|
||||
|
||||
@@ -516,6 +516,26 @@ export function resolveMaterialRef(
|
||||
return createMaterial(sceneMaterial.material, shading)
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a node kind's declared slot default — either a catalog `library:<id>`
|
||||
* finish or a flat `#rrggbb` colour — to a renderable material. Shared by the
|
||||
* procedural kinds whose colored-mode unpainted appearance comes from a
|
||||
* declarative default (slab, wall).
|
||||
*/
|
||||
export function resolveSlotDefaultMaterial(
|
||||
slotDefault: string,
|
||||
shading: RenderShading = 'rendered',
|
||||
roughness = 0.9,
|
||||
): THREE.Material {
|
||||
if (parseMaterialRef(slotDefault)?.kind === 'library') {
|
||||
return (
|
||||
createMaterialFromPresetRef(slotDefault, shading) ??
|
||||
createDefaultMaterial('#ffffff', roughness, shading)
|
||||
)
|
||||
}
|
||||
return createDefaultMaterial(slotDefault, roughness, shading)
|
||||
}
|
||||
|
||||
export function createDefaultMaterial(
|
||||
color = '#ffffff',
|
||||
roughness = 0.9,
|
||||
|
||||
Reference in New Issue
Block a user