@@ -14,7 +14,7 @@ import { createCameraRig, type Vec3 as RigVec } from './cameraRig'
1414import { createChangeAnimator } from './changeAnimation'
1515import { focusOpacity } from './interaction'
1616import { backOffs , busyness , clamp , clampIntoView , districtNameHalf , easeArea , edgeLabelSize , fitDistance , fitView , fogDensity , freeArea , inFreeArea , nameBudget , overviewDir , placeLabels , sameArea , toleratedPick , turnAcross , turnGround , viewFrame , type FreeArea , type LabelCandidate , type Nudge , type ScreenBox , type V3 } from './viewMath'
17- import type { SceneBuilding , SceneConduit , SceneDistrict , SceneModel , SceneOrb , Vec3 } from './sceneModel'
17+ import { HEAT_COLOR , heatMix , type SceneBuilding , SceneConduit , SceneDistrict , SceneModel , SceneOrb , Vec3 } from './sceneModel'
1818import type { Theme , ThemeName } from './themes'
1919
2020/** Label strings and presentation lookups. The viewer derives these from the doc; the renderer only prints them. */
@@ -662,11 +662,13 @@ function buildThreeRenderer(host: HTMLElement, opts: RendererOptions, undo: Arra
662662 // A guessed-at building keeps its district's hue, washed toward the fog tint: still a building
663663 // of that district, only less certain.
664664 const lineColor = b . look === 'amber' ? extras . amber : ghost ? extras . ghost : b . look === 'fog' ? col . clone ( ) . lerp ( new THREE . Color ( extras . fogTint ) , 0.4 ) : col
665+ const heat = heatMix ( b . heat )
666+ const glowColor = col . clone ( ) . lerp ( new THREE . Color ( HEAT_COLOR ) , heat . toward ) // heat 0: the district colour itself
665667 const captions = text . floors [ b . id ] ?? [ ]
666668 for ( let k = 0 ; k < b . floors ; k ++ ) {
667669 const geo = new THREE . BoxGeometry ( FLOOR_W , fh * 0.85 , FLOOR_W )
668670 const mat = trackBase ( new THREE . MeshStandardMaterial ( {
669- color : extras . fill , emissive : col , emissiveIntensity : ghost ? 0.05 : extras . fillGlow , metalness : 0.5 , roughness : 0.3 ,
671+ color : extras . fill , emissive : glowColor , emissiveIntensity : ghost ? 0.05 : extras . fillGlow * heat . glow , metalness : 0.5 , roughness : 0.3 ,
670672 transparent : true , opacity : ghost ? 0.07 : b . look === 'fog' ? extras . fillOpacity * 0.6 : extras . fillOpacity , depthWrite : ! ghost ,
671673 } ) )
672674 n . mats . push ( mat )
0 commit comments