bsc_stage
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
bsc_stage
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
try(label: string, fn: () → void
Every call into a screen-space system below is guarded: this slice owns the whole look, and one refused setting must not take the other twenty with it. `try` is that guard, and it says which one failed rather than swallowing it.
| arg | type | description |
|---|---|---|
| label | string | |
| fn | ( |
pushPractical(p: Practical) → void
| arg | type | description |
|---|---|---|
| p | Practical |
buildPracticalList( ) → void
sunVector(h: number) → void
The sun's arc. This is the SAME formula the procedural sky orients its own disc with (6:00 on the east horizon, 12:00 overhead), so the light, the shadows and the sun in the sky agree. Below the horizon the block is lit by the moon instead, which rides the same arc twelve hours behind.
| arg | type | description |
|---|---|---|
| h | number |
keyLightDirection(h: number) → void
The direction the LIGHT travels: from the body toward the ground.
| arg | type | description |
|---|---|---|
| h | number |
lerp3(a: { number }, b: { number }, t: number) → void
Interpolating the look table.
| arg | type | description |
|---|---|---|
| a | { number } | |
| b | { number } | |
| t | number |
smooth(t: number) → number
| arg | type | description |
|---|---|---|
| t | number |
lookAt(h: number) → LookKey
| arg | type | description |
|---|---|---|
| h | number |
addPost(name: string, shaderRef: any, priority: number, props: { [string]: any }) → void
POST CHAIN. Every effect this game has is registered here and nowhere else. Lower priority runs first: grade -> three looks -> bloom -> tonemap -> vignette, so the table is indexed by scene-referred colour and the vignette is the last thing laid over the graded image.
| arg | type | description |
|---|---|---|
| name | string | |
| shaderRef | any | |
| priority | number | |
| props | { [string]: any } |
buildPostChain( ) → void
setProp(effect: string, prop: string, value: any) → void
| arg | type | description |
|---|---|---|
| effect | string | |
| prop | string | |
| value | any |
spawnEmitter(name: string, x: number, y: number, z: number, cfg: { [string]: any }) → void
THE AIR — petals, motes, insects, rain. Every emitter hangs off Fx; the three that follow the player are moved each frame so the air is always where the camera is looking rather than where it was authored.
| arg | type | description |
|---|---|---|
| name | string | |
| x | number | |
| y | number | |
| z | number | |
| cfg | { [string]: any } |
buildAir( ) → void
setRate(name: string, rate: number) → void
| arg | type | description |
|---|---|---|
| name | string | |
| rate | number |
moveEmitter(name: string, x: number, y: number, z: number) → void
| arg | type | description |
|---|---|---|
| name | string | |
| x | number | |
| y | number | |
| z | number |
playerPoint( ) → void
Where the player is. The hero slice owns the body; the camera rig is the reliable read because the scene guarantees it.
applyCamera(t: number) → void
| arg | type | description |
|---|---|---|
| t | number |
say(key: string) → void
CUTSCENES Three, all over authored framing. Every camera anchor is read out of BSC.BLOCK so a shot cannot disagree with the block it is photographing. Spoken lines go out on the bus as "voice" AND ride the cutscene's own subtitles, so the line is on the screen whether or not the audio exists.
| arg | type | description |
|---|---|---|
| key | string |
introDef( ) → any
turnDef( ) → any
endingDef( ) → any
setPhase(p: string) → void
Phase. Stage owns the transitions; everyone else reads BSC.state.phase.
| arg | type | description |
|---|---|---|
| p | string |
setFestival(on: boolean) → void
| arg | type | description |
|---|---|---|
| on | boolean |
playCutscene(name: string) → any
| arg | type | description |
|---|---|---|
| name | string |
skipCutscene( ) → boolean
End whatever is on screen early, the way a skip key would. The ui slice's pause and photo mode both want this.
cutscenePlaying( ) → boolean
beginIntro( ) → void
The intro, on demand. The ui slice can call this to cut its title short; otherwise the title holds for M.TITLE_HOLD seconds and this fires itself.
setHour(h: number) → void
Time of day.
| arg | type | description |
|---|---|---|
| h | number |
hour( ) → number
setRain(on: boolean) → void
Weather. The wetness the surface pass reads is BSC.state.wet, and it is driven from here alone.
| arg | type | description |
|---|---|---|
| on | boolean |
raining( ) → boolean
build( ) → void
BUILD
grabHandles( ) → void
Every scene handle the look writes through, re-read from the scene. A hot reload drops all of them, so this is called again whenever one is missing rather than only once at build.
wireLook( ) → void
The half of the stage that is renderer state rather than scene entities: the sun, the sky, the camera, the post chain and every screen-space system. Split out because it can be applied and looked at without spawning anything, which is what makes the grade reviewable one hour at a time.
preview(h: number) → void
Light the block at one hour and look at it, without building the rest of the slice. This is how the grade at 07:00, 17:30 and 23:00 is reviewed.
| arg | type | description |
|---|---|---|
| h | number |
applyHour(h: number, blend: number) → void
| arg | type | description |
|---|---|---|
| h | number | |
| blend | number |
update(dt: number) → void
UPDATE
| arg | type | description |
|---|---|---|
| dt | number |
report( ) → void
Read-out, for anyone checking what the stage is doing.
LookKey = {Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.