Namespace in reactor_3d_lighting.js
Reactor3D
137 public functions in 5 groups · show internal (_) functions
Quick Reference
Getting Information 2
| currentLightMapId() | The current light map id. |
| currentLightOverrides() | The current light overrides. |
Checks (True / False) 3
| isMirrorFinish() | Whether a model is a mirror finish: some lit material reflecting fully and nearly perfectly smooth. |
| isWeakGpu() | Whether it is weak gpu. |
| isLit() | Whether anything has asked for lighting on this map. |
Actions 12
| setKeyLight() | The key light from the packed lights: the first sun's place, else the default direction. |
| sendUniformArray() | A cached array uniform's setValue (the uniform is this; what three's own sends with and the last values sent… |
| clearCameraPath() | Keep a camera out of the walls. |
| clearCameraGround() | Clears the camera ground. |
| clearCameraRoof() | Clears the camera roof. |
| clearCameraAttic() | Keep a camera out of a roof's hollow, wherever its player is: it rises over the tiles above it, still looking… |
| useSceneWater() | Load a scene's water into the shared uniforms before it draws. |
| setLights() | Declare the lights on the map this frame. |
| setAmbient() | The light everything gets regardless. |
| clampConeReach() | How far a beam gets before the first wall in its way, in tiles. |
| setLightOn() | Runtime on/off overrides, carried on Game_Map so a save keeps them. |
| setMapAmbient() | Ease the map's ambient light to a new level and colour; values === null restores the authored ambient. |
Updating & Drawing 2
| rendererDescription() | Read the renderer's own name out of a live context, or "" if it will not say. |
| animateLight() | A light's pulse and flicker for one frame: arithmetic on the frame counter, deterministic, so a save replays… |
Other 118
| lightIsAimed() | Whether a light has a direction to aim: a cone or a beam. |
| lightModeFor() | Light mode for. |
| lightUniforms() | Light uniforms. |
| shadowGlsl() | The shadow term, when a program carries one. |
| lightGlsl() | The light term, with or without the shadow lookup inside its loop. |
| packLightUniforms() | Pack compositor lights straight into the shared uniforms: no map, no facades, no view culling. |
| sameAsFloat32() | Same as float32. |
| sameAsArray() | Same as array. |
| sameAsOther() | Same as other. |
| cacheUniformArrays() | Cache uniform arrays. |
| injectWorldNormal() | Inject world normal. |
| facesPerLight() | Whether each light in the loop is weighed by a model's facing: on every tier but the weak one. |
| facesLight() | Whether a material is lit by which way its faces point (a model's, see MODEL_FACING). |
| faceGlsl() | The GLSL that sets a model's facing before its light is asked for: its normal, turned toward the eye (a doubl… |
| normalOnUv1() | Whether a model material's normal map rides the second coordinates (TEXCOORD_1, geometry attribute uv1). |
| injectUv1() | The second coordinates handed to the fragment shader as vRRUv1 (three declares uv1 only when a map of its own… |
| injectVertexFacing() | Local light moments at vertices: all packed lights count, with no shadow or pixel light loop. |
| injectLightShader() | Inject light shader. |
| injectBlendColor() | A blend colour on a lit material, the way a sprite's colour filter blends one over its pixels: a damage flash… |
| cutawayUniforms() | The cutaway: what a player inside a building must not have in the way. |
| injectCutaway() | Inject cutaway. |
| pieceCoverAt() | What stands over a character's head on its cell — a roof, a floor above — as the footprint the cut should rea… |
| cutRegion() | Cut region. |
| segmentCrossesRect() | Whether the segment (ax, ay) to (bx, by) touches the rectangle (x0, y0) to (x1, y1). |
| cutawayInBattle() | Whether a battle runs on the map being played (never in the editor, which has no game). |
| cutawayMarkBodies() | Marks the models of every character as bodies the fades leave whole: the player, the followers, a battle's un… |
| cutawayMarkBody() | Cutaway mark body. |
| cutawayMarkRide() | A ridden vehicle is its rider's body, battle or none (on), and scenery again when it is left: the fades that… |
| cutawayMarkMaterials() | Every material of a model is told it is a body's. |
| cutawayHides() | Whether something built stands between the eye and a character: on the line to its chest or to its head. |
| cutawayShows() | Whether what is built is opened for a character standing at a point of the map: a corridor is being held open… |
| sightBuilt() | Whether a piece stands on the first reach tiles of the line from one point to another (posts and rails aside). |
| pieceSolidAt() | Piece solid at. |
| doorSolidAt() | Whether a height over a door's cell is in the door: the wall over its leaves always, and the leaves themselve… |
| doorClosing() | Whether a door is shut or swinging shut (the game's doors only: nothing swings in the editor). |
| shapeFrame() | A shape's own frame, kept per piece: its middle, its size, the turn that takes a world offset into it, and fo… |
| shapeHolds() | Whether a world point is inside a shape (see pieceSolidAt). |
| cameraArm() | Camera arm. |
| cameraArmBlocked() | One point of cameraArm's way: under the ground (and a margin over it), or inside a piece. |
| inRoofVoid() | Whether a world point is in the hollow of a roof: under its tiles (a ramp, a slab laid at a tilt, the ridge's… |
| injectLevelCut() | The openings between a map and the map under or over it (Reactor3D.Levels): inside each box, what faces up wi… |
| injectDissolve() | Inject dissolve. |
| waterVolumeUniforms() | Water volume uniforms. |
| waterEyeSheet() | The sheet the camera's eye is in, of the first count volumes: the one whose water covers the eye's own cell w… |
| underWaterAt() | Whether a world point is under one of the scene's water sheets (the eye, for the underwater wash). |
| injectWaterVolume() | The water volume on a material: its fragments dim through the water in front of them. |
| keepOutOfLevel() | A material whose surface is not drawn inside the map under this one (Reactor3D.Levels: rrLvlFoot, rrLvlTop):… |
| waterVolumeMaterial() | The water volume on a material that is not lit (the sky). |
| reflectionSize() | Reflection size. |
| withSkyAt() | Draw with the sky dome around position (a mirror's or the capture's eye), then put it back: the dome follows… |
| sharePassOutput() | A picture the world is drawn into for a surface to reflect (a mirror's, the reflection cube) is written as th… |
| mirrorUniformDeclarations() | The mirror slots' uniforms, declared for a fragment shader. |
| mirrorLookup() | The fragment code that takes the first mirror slot this fragment lies on (on(slot) says whether it does) and… |
| mirrorPanels() | Mirror panels. |
| shineOf() | How a material shines: its rrShine of { vector: (reflect, roughness, metal, texture kept), tint }, or null fo… |
| injectShine() | The reflection term for a shiny lit material: the world in the capture, mirrored about the surface normal, bl… |
| glowKey() | Glow key. |
| injectSurfaceGlow() | Inject surface glow. |
| surfaceMapsKey() | Surface maps key. |
| injectSurfaceOcclusion() | Surface cavities shade the base before reflections and glow are added. |
| litMaterial() | Lit material. |
| classifyGpu() | "weak", "full" or "unknown" for a renderer description. |
| tier() | The tier every cost decision in this file asks for: an explicit override first, then the game's, and "full" w… |
| fastShading() | Fast shading. |
| activeCamera() | Active camera. |
| viewFrustum() | The view frustum, rebuilt at most once a frame. |
| viewEye() | Where the drawing camera stands, in world units, or null with no viewport. |
| sphereInView() | Whether a sphere of radius at (x, y, z) can reach anything on screen. |
| shadowsWanted() | Whether this map wants shadows at all: the engine switch, the mode, the sidecar. |
| shadowsBuilt() | Whether this map's lit programs carry the shadow lookup: the engine switch, the mode and the sidecar, but not… |
| claimShadows() | Claim shadows. |
| mapRowsIdle() | Whether owner is the game map's renderer while a scene other than the map runs (it draws nothing then). |
| lights() | Lights. |
| ambient() | Ambient. |
| daylightOf() | The time of day an ambient { intensity, colour } stands for, written into out (made once when absent): day, t… |
| daylight() | The time of day of the current ambient (setAmbient), worked out again only when it changes. |
| sunDirection() | The unit vector toward a sun, into out, from its authored yaw and pitch in degrees (as the sidecar holds them… |
| sunAtDaylight() | Sun at daylight. |
| nearestLights() | The lights worth carrying, nearest a point first. |
| lightEyeInterior() | Whether the camera stands in the walkable interior, where hiding a lamp behind a wall means something. |
| lightSolidGrid() | Where a room map has no floor tile at all it is wall, cached per map. |
| lightBlockHeightAt() | How high the world stands at a cell, as far as light is concerned. |
| lightSegmentBlocked() | Whether a straight line between two heighted points crosses something taller than itself. |
| frameStamp() | Frame stamp. |
| sameMatrix() | Same matrix. |
| beamHit() | Beam hit. |
| litCharacters() | Every character on the map that carries a RaveLighting config. |
| raveOffset() | Where a light sits relative to its character, in pixels. |
| raveYaw() | Which way a cone points, in degrees, with south at zero. |
| parseColour() | #rrggbb or a number, to a number. |
| noteModelFacing() | Record the heading a character's model is drawn at this frame, in scene radians. |
| carrierFacingYaw() | Carrier facing yaw. |
| facingYaw() | RPG Maker's direction numbers as a yaw in degrees: 2 is south, 8 north. |
| suppressFlatLighting() | Put every plugin's 2D lightmap away, or bring them all back. |
| wantsLights3D() | Whether this map wants its lights in three dimensions. |
| authoredLights3D() | Whether the map lights itself in three dimensions, before any AmbientLight command. |
| ambientOverrideActive() | Whether an AmbientLight command holds this map's ambient. |
| mapLightingChoice() | What the map's sidecar says about lighting: true or false, or null when it says nothing and the note or the p… |
| mapMeta() | The map's note tags: meta as the game's DataManager made it, or read from the note the same way when the map… |
| authoredAmbient() | A map's ambient as its sidecar writes it, before any AmbientLight command. |
| ambientFor() | Ambient for. |
| seamAmbient() | The ambient ambient of the map played, taken toward the neighbor's as far as _seamLight says. |
| seamSunOf() | The neighbor's sun, as { light, ground } (its authored light and the ground under it), or null: read once per… |
| blendSeamSun() | The map's lights (out, from nativeLights) with its sun taken toward the neighbor's as far as _seamLight says:… |
| flatAmbientTint() | Display-space ambient tint for the flat multiply overlay. |
| collectLights() | Collect this frame's lights from whichever lighting plugin is present. |
| readMapLights() | Read map lights. |
| lightingEnabled() | Whether this map has native lighting at all, in either renderer. |
| authoredLighting() | Whether the map lights itself, before any AmbientLight command. |
| overrideProgress() | Override progress. |
| mixColour() | Mix colour. |
| lightOverrideFor() | The override block a light reads: its own id first, then its tag's. |
| liveLightValues() | Live light values. |
| lightsTargeted() | Every authored light a command target names: one id, or all of a tag. |
| switchLight() | Turn a light, or every light of a tag, on, off or over. |
| transformLight() | Ease a light, or every light of a tag, to new values over duration frames. |
| lightIsOn() | Light is on. |
| nativeLights() | This frame's native lights, resolved into the compositor's shape. |
Getting Information
currentLightMapId
static sourceReactor3D.currentLightMapId()
The current light map id.
currentLightOverrides
static sourceReactor3D.currentLightOverrides()
The current light overrides.
Checks (True / False)
isMirrorFinish
static sourceReactor3D.isMirrorFinish(object)
Whether a model is a mirror finish: some lit material reflecting fully and nearly perfectly smooth.
isWeakGpu
static sourceReactor3D.isWeakGpu()
Whether it is weak gpu.
isLit
static sourceReactor3D.isLit()
Whether anything has asked for lighting on this map.
Actions
setKeyLight
static sourceReactor3D.setKeyLight(uniforms, count)
The key light from the packed lights: the first sun's place, else the default direction.
sendUniformArray
static sourceReactor3D.sendUniformArray(gl, v, textures)
A cached array uniform's setValue (the uniform is this; what three's own sends with and the last values sent are kept on it).
Details
A cached array uniform's setValue (the uniform is this; what three's own
sends with and the last values sent are kept on it). One function for every
uniform of every program: a closure apiece ran hundreds of cold copies of
the compare, each boxing every number it read.
clearCameraPath
static sourceReactor3D.clearCameraPath(camera, focus, mapData)
Keep a camera out of the walls.
Details
Keep a camera out of the walls. A wall between the camera and the player is left alone: the sight-line fade sees through it, and a camera shoved in against every interior wall was a close-up of the player's back. Only a camera that would stand inside a solid piece moves: it comes in along its own line of sight until it is out of that solid, plus a margin. A doorway and a door are no solid to it, lintel and all: a camera trailing its player out of a house passes over the door, and coming in for that one cell was a jump. Nothing happens on a map without pieces.
clearCameraGround
static sourceReactor3D.clearCameraGround(camera, focus, mapData)
Clears the camera ground.
clearCameraRoof
static sourceReactor3D.clearCameraRoof(camera, focus, mapData, feet)
Clears the camera roof.
clearCameraAttic
static sourceReactor3D.clearCameraAttic(camera, focus, mapData)
Keep a camera out of a roof's hollow, wherever its player is: it rises over the tiles above it, still looking where it looked.
Details
Keep a camera out of a roof's hollow, wherever its player is: it rises over the tiles above it, still looking where it looked. A roof the cutaway has taken off (the player is under it) is left.
useSceneWater
static sourceReactor3D.useSceneWater(scene, camera)
Load a scene's water into the shared uniforms before it draws.
Details
Load a scene's water into the shared uniforms before it draws. The shader
lays the volumes on in the order they are loaded, and that order is the
same whatever order the map lists its sheets in: the larger boxes first
(where two boxes claim the same stretch of a line of sight, the smaller,
a pond in the corner of a lake's box, is laid over the larger), and the
sheet camera's eye is in (waterEyeSheet) last of all, its colour being
the one nearest the eye. With the eye in a sheet, another sheet's volume
whose box holds the eye is left out: the eye is in one body of water, and
what is round it is that body's (the lake whose box takes in the pond
being dived in is not round the diver; where a river runs into a lake the
swimmer and all that is near are in the one the eye is in, not both).
setLights
static sourceReactor3D.setLights(lights)
Declare the lights on the map this frame.
Details
Declare the lights on the map this frame.
Each entry: { type, x, y, height, radius, colour, intensity, angle, yaw }.
x/y are map cells and radius is in tiles; angle and yaw are degrees
and only mean anything for a spot. Everything but a position has a sensible
default, so the smallest useful light is { x, y, radius }.
Called every frame by a shim. Cheap to call: the descriptors are compared against what is already in the scene, and only a change of count or kind rebuilds anything.
setAmbient
static sourceReactor3D.setAmbient(ambient)
The light everything gets regardless.
Details
The light everything gets regardless.
A lighting plugin's darkness is the absence of its lights, so without an
ambient floor an unlit corner of a 3D map is pure black rather than dim.
null means "no lighting at all" — the unlit look, which is what a map with
no lighting plugin should keep.
clampConeReach
static sourceReactor3D.clampConeReach(x, y, h, ax, az, radius)
How far a beam gets before the first wall in its way, in tiles.
setLightOn
static sourceReactor3D.setLightOn(key, on)
Runtime on/off overrides, carried on Game_Map so a save keeps them.
Details
Runtime on/off overrides, carried on Game_Map so a save keeps them. Stored sparsely — only lights a command has touched appear here. Keys are a light's id, or "#tag" to speak to every light sharing a tag, held in one record per map id: every map numbers its lights light1, light2, …, so a state must not reach the light of the same name on another map.
A save from before the states were kept per map holds them flat (key to true or false) with nothing to say which map each was made on. Those are not read, and are taken out when the next state is written.
setMapAmbient
static sourceReactor3D.setMapAmbient(values, duration)
Ease the map's ambient light to a new level and colour; values === null restores the authored ambient.
Updating & Drawing
rendererDescription
static sourceReactor3D.rendererDescription(gl)
Read the renderer's own name out of a live context, or "" if it will not say.
animateLight
static sourceReactor3D.animateLight(spec, frame, seedIndex, radius, intensity)
A light's pulse and flicker for one frame: arithmetic on the frame counter, deterministic, so a save replays identically and both the map's lights and a model's anchored lights breathe the same way.
Details
A light's pulse and flicker for one frame: arithmetic on the frame counter, deterministic, so a save replays identically and both the map's lights and a model's anchored lights breathe the same way. Two incommensurate sines beat irregularly enough to read as flame without a random source. Returns the radius and intensity to draw.
Other
lightIsAimed
static sourceReactor3D.lightIsAimed(light)
Whether a light has a direction to aim: a cone or a beam.
lightModeFor
static sourceReactor3D.lightModeFor(mapData)
Light mode for.
lightUniforms
static sourceReactor3D.lightUniforms()
Light uniforms.
shadowGlsl
static sourceReactor3D.shadowGlsl(taps)
The shadow term, when a program carries one.
Details
The shadow term, when a program carries one. Every casting light owns a
row of the atlas: six 90-degree faces side by side, rendered from the
light (see Reactor3D.Shadows) and sampled with hardware depth
comparison. A light with a tile multiplies its falloff by the visibility
of the fragment from the source: the static atlas holds the props and
the map's models, the dynamic one whoever moved this frame, and the
darker of the two wins. The face is chosen from the major axis of the
light-to-fragment vector exactly as a cube map would choose it, then
projected onto that face and offset into the row.
lightGlsl
static sourceReactor3D.lightGlsl(shadows, taps)
The light term, with or without the shadow lookup inside its loop.
packLightUniforms
static sourceReactor3D.packLightUniforms(lights, ambient, uniforms = this.lightUniforms()
Pack compositor lights straight into the shared uniforms: no map, no facades, no view culling.
Details
Pack compositor lights straight into the shared uniforms: no map, no
facades, no view culling. What a preview outside a MapScene needs — the
3D database lights a model with the game's own shader this way. Lights
are placed by the scene packer's rule (x + 0.5, ground + height, y + 1),
with groundY absolute. An optional private uniform set lets retained
previews pack lights without changing another viewport. Returns how many
were packed; shared-uniform callers restore their previous state as needed.
shadows, when given, is { candidates: [], focus } (focus a world point):
each light that may cast is added to candidates for Shadows.
sameAsFloat32
static sourceReactor3D.sameAsFloat32(last, v)
Same as float32.
sameAsArray
static sourceReactor3D.sameAsArray(last, v)
Same as array.
sameAsOther
static sourceReactor3D.sameAsOther(last, v)
Same as other.
cacheUniformArrays
static sourceReactor3D.cacheUniformArrays(renderer)
Cache uniform arrays.
injectWorldNormal
static sourceReactor3D.injectWorldNormal(shader)
Inject world normal.
facesPerLight
static sourceReactor3D.facesPerLight()
Whether each light in the loop is weighed by a model's facing: on every tier but the weak one.
facesLight
static sourceReactor3D.facesLight(material)
Whether a material is lit by which way its faces point (a model's, see MODEL_FACING).
faceGlsl
static sourceReactor3D.faceGlsl(normalMap, uv1)
The GLSL that sets a model's facing before its light is asked for: its normal, turned toward the eye (a double-sided leaf or cloth lights from the side seen), bent by its normal map where it has one.
normalOnUv1
static sourceReactor3D.normalOnUv1(material)
Whether a model material's normal map rides the second coordinates (TEXCOORD_1, geometry attribute uv1).
injectUv1
static sourceReactor3D.injectUv1(shader)
The second coordinates handed to the fragment shader as vRRUv1 (three declares uv1 only when a map of its own uses it).
injectVertexFacing
static sourceReactor3D.injectVertexFacing(shader)
Local light moments at vertices: all packed lights count, with no shadow or pixel light loop.
injectLightShader
static sourceReactor3D.injectLightShader(shader, renderer, material)
Inject light shader.
injectBlendColor
static sourceReactor3D.injectBlendColor(material, shader)
A blend colour on a lit material, the way a sprite's colour filter blends one over its pixels: a damage flash, an animation's flash on its targets, the red of a collapse.
Details
A blend colour on a lit material, the way a sprite's colour filter blends
one over its pixels: a damage flash, an animation's flash on its targets,
the red of a collapse. material.userData.rrBlend.value is {x,y,z,w} in
0..1 (w the strength), created here or by whoever sets it first; a plain
object so a material cloned through JSON still owns one the shader reads.
cutawayUniforms
static sourceReactor3D.cutawayUniforms()
The cutaway: what a player inside a building must not have in the way.
Details
The cutaway: what a player inside a building must not have in the way.
Two cuts, both in the pieces' fragment shader so a merged wall mesh
needs no splitting: everything above rrCutTop (the storey the player
stands in, so the roof and the floors above go), and everything inside
a tube of rrCutRadius around the line from the eye to the player, so
a wall the camera looks through is opened where it hides the party.
One set of values for every piece material, written once a frame by
updateCutaway; 1e9 and 0 mean no cut, which is what the editor shows.
injectCutaway
static sourceReactor3D.injectCutaway(material, shader)
Inject cutaway.
pieceCoverAt
static sourceReactor3D.pieceCoverAt(mapData, wx, wz, near)
What stands over a character's head on its cell — a roof, a floor above — as the footprint the cut should reach: the building it belongs to, or a stretch of map around the cell for pieces laid by hand.
Details
What stands over a character's head on its cell — a roof, a floor above — as the footprint the cut should reach: the building it belongs to, or a stretch of map around the cell for pieces laid by hand. Null in the open.
cutRegion
static sourceReactor3D.cutRegion(was, now)
Cut region.
segmentCrossesRect
static sourceReactor3D.segmentCrossesRect(ax, ay, bx, by, x0, y0, x1, y1)
Whether the segment (ax, ay) to (bx, by) touches the rectangle (x0, y0) to (x1, y1).
cutawayInBattle
static sourceReactor3D.cutawayInBattle()
Whether a battle runs on the map being played (never in the editor, which has no game).
cutawayMarkBodies
static sourceReactor3D.cutawayMarkBodies(player)
Marks the models of every character as bodies the fades leave whole: the player, the followers, a battle's units, and every other character on the map (scenery, the placed models, is not one).
Details
Marks the models of every character as bodies the fades leave whole: the player, the followers, a battle's units, and every other character on the map (scenery, the placed models, is not one). A model instance is marked once; one that arrives later is found on a later look.
cutawayMarkBody
static sourceReactor3D.cutawayMarkBody(character)
Cutaway mark body.
cutawayMarkRide
static sourceReactor3D.cutawayMarkRide(object, on)
A ridden vehicle is its rider's body, battle or none (on), and scenery again when it is left: the fades that thin what stands between the eye and the party pass it by, however far behind its rider it reaches.
Details
A ridden vehicle is its rider's body, battle or none (on), and scenery again when it is left: the fades that
thin what stands between the eye and the party pass it by, however far behind its rider it reaches. Instances of
one model share their materials, so each material counts who rides.
cutawayMarkMaterials
static sourceReactor3D.cutawayMarkMaterials(object)
Every material of a model is told it is a body's.
cutawayHides
static sourceReactor3D.cutawayHides(mapData, eye, character, x, ground, z, fresh, frame)
Whether something built stands between the eye and a character: on the line to its chest or to its head.
Details
Whether something built stands between the eye and a character: on the line to its chest or to its head. The
answer is kept per character and looked at again when fresh, or when it is CUTAWAY_FOCI frames old.
cutawayShows
static sourceReactor3D.cutawayShows(character, wx, wz)
Whether what is built is opened for a character standing at a point of the map: a corridor is being held open to it, or it stands on a battle's ground, which nothing built may hide (reactor_fight_tactical.js).
Details
Whether what is built is opened for a character standing at a point of the map: a corridor is being held open to it, or it stands on a battle's ground, which nothing built may hide (reactor_fight_tactical.js). Who the picture shows through a wall is in plain view: a number or an animation on it is shown too.
sightBuilt
static sourceReactor3D.sightBuilt(mapData, from, to, reach)
Whether a piece stands on the first reach tiles of the line from one point to another (posts and rails aside).
pieceSolidAt
static sourceReactor3D.pieceSolidAt(mapData, wx, wy, wz, cut, thin, doors)
Piece solid at.
doorSolidAt
static sourceReactor3D.doorSolidAt(piece, h, closing)
Whether a height over a door's cell is in the door: the wall over its leaves always, and the leaves themselves while they stand across the doorway (doorShut: what stops a shot or a look stops a camera).
Details
Whether a height over a door's cell is in the door: the wall over its
leaves always, and the leaves themselves while they stand across the
doorway (doorShut: what stops a shot or a look stops a camera). A gate
has nothing over it. With closing, leaves on their way shut count from
the moment they begin to swing: a camera starts in before they meet.
doorClosing
static sourceReactor3D.doorClosing(piece)
Whether a door is shut or swinging shut (the game's doors only: nothing swings in the editor).
shapeFrame
static sourceReactor3D.shapeFrame(piece)
A shape's own frame, kept per piece: its middle, its size, the turn that takes a world offset into it, and for one laid at a tilt or a roll how high its middle stands over its foot.
shapeHolds
static sourceReactor3D.shapeHolds(mapData, piece, wx, wy, wz, cellBase, slim)
Whether a world point is inside a shape (see pieceSolidAt).
Details
Whether a world point is inside a shape (see pieceSolidAt). cellBase is the ground of the cell the point is in.
cameraArm
static sourceReactor3D.cameraArm(mapData, focus, to, least, margin, step, how)
Camera arm.
cameraArmBlocked
static sourceReactor3D.cameraArmBlocked(mapData, focus, dx, dy, dz, t, built, cut, thin, doors)
One point of cameraArm's way: under the ground (and a margin over it), or inside a piece.
Details
One point of cameraArm's way: under the ground (and a margin over it), or inside a piece. Past the
map's edge, the neighboring map whose world stands there answers (Neighbors.solidAt).
inRoofVoid
static sourceReactor3D.inRoofVoid(mapData, wx, wy, wz)
Whether a world point is in the hollow of a roof: under its tiles (a ramp, a slab laid at a tilt, the ridge's strip of floor) and over the ceiling below them, where nothing is solid and a camera would look at the roof from inside.
Details
Whether a world point is in the hollow of a roof: under its tiles (a ramp, a slab laid at a tilt, the ridge's strip of floor) and over the ceiling below them, where nothing is solid and a camera would look at the roof from inside. A room is not one, up to its ceiling: that is a storey over its floor. Nor is the open air under an eave, which has only the ground below it.
injectLevelCut
static sourceReactor3D.injectLevelCut(material, shader)
The openings between a map and the map under or over it (Reactor3D.Levels): inside each box, what faces up within the upper map's ground band and what faces down at the lower map's ceiling is not drawn, so the other map is seen through.
Details
The openings between a map and the map under or over it (Reactor3D.Levels): inside each box, what faces up within the upper map's ground band and what faces down at the lower map's ceiling is not drawn, so the other map is seen through. One set of values for every lit material, written once a frame; a count of 0 cuts nothing. (A surface with no normal of its own is taken for either.)
injectDissolve
static sourceReactor3D.injectDissolve(material, shader)
Inject dissolve.
waterVolumeUniforms
static sourceReactor3D.waterVolumeUniforms()
Water volume uniforms.
waterEyeSheet
static sourceReactor3D.waterEyeSheet(water, count, camera)
The sheet the camera's eye is in, of the first count volumes: the one whose water covers the eye's own cell with its surface above the eye.
Details
The sheet the camera's eye is in, of the first count volumes: the one
whose water covers the eye's own cell with its surface above the eye. A
volume's box holds dry land too (a lake's box takes in its banks and
whatever pond lies in a corner of it), so the sheet is asked, not the box.
Where two sheets cover the cell (a river running into a lake) the higher
surface wins: it is the one a swimmer is at and the one seen from above.
Null when the eye is in none. Each volume is marked _rrAside when its
box holds the eye under its level.
underWaterAt
static sourceReactor3D.underWaterAt(scene, x, y, z)
Whether a world point is under one of the scene's water sheets (the eye, for the underwater wash).
injectWaterVolume
static sourceReactor3D.injectWaterVolume(material, shader)
The water volume on a material: its fragments dim through the water in front of them.
Details
The water volume on a material: its fragments dim through the water in front of them. The water sheet itself is exempt.
keepOutOfLevel
static sourceReactor3D.keepOutOfLevel(material)
A material whose surface is not drawn inside the map under this one (Reactor3D.Levels: rrLvlFoot, rrLvlTop): a water sheet is laid over its whole box at its level, under a hill too, and showed inside the room in the hill.
waterVolumeMaterial
static sourceReactor3D.waterVolumeMaterial(material)
The water volume on a material that is not lit (the sky).
reflectionSize
static sourceReactor3D.reflectionSize()
Reflection size.
withSkyAt
static sourceReactor3D.withSkyAt(scene, position, draw)
Draw with the sky dome around position (a mirror's or the capture's eye), then put it back: the dome follows the main camera, and a reflected eye stood outside it looking at nothing.
mirrorUniformDeclarations
static sourceReactor3D.mirrorUniformDeclarations()
The mirror slots' uniforms, declared for a fragment shader.
mirrorLookup
static sourceReactor3D.mirrorLookup(target, on, offset, scale)
The fragment code that takes the first mirror slot this fragment lies on (on(slot) says whether it does) and writes its picture into target, the lookup nudged by offset (water's ripple) and scaled by scale.
Details
The fragment code that takes the first mirror slot this fragment lies on
(on(slot) says whether it does) and writes its picture into target,
the lookup nudged by offset (water's ripple) and scaled by scale.
mirrorPanels
static sourceReactor3D.mirrorPanels(object)
Mirror panels.
shineOf
static sourceReactor3D.shineOf(material)
How a material shines: its rrShine of { vector: (reflect, roughness, metal, texture kept), tint }, or null for a plain surface.
Details
How a material shines: its rrShine of { vector: (reflect, roughness,
metal, texture kept), tint }, or null for a plain surface. Set by
applyModelSurface (a model's own settings, or its file's metal).
injectShine
static sourceReactor3D.injectShine(material, shader)
The reflection term for a shiny lit material: the world in the capture, mirrored about the surface normal, blurred by roughness, stronger at a glancing angle (fresnel) unless it is metal, which reflects as strongly face on, in the surface's tint (white chrome, yellow gold).
Details
The reflection term for a shiny lit material: the world in the capture, mirrored about the surface normal, blurred by roughness, stronger at a glancing angle (fresnel) unless it is metal, which reflects as strongly face on, in the surface's tint (white chrome, yellow gold). A mirror-bright metal is almost all reflection.
glowKey
static sourceReactor3D.glowKey(material)
Glow key.
injectSurfaceGlow
static sourceReactor3D.injectSurfaceGlow(material, shader)
Inject surface glow.
surfaceMapsKey
static sourceReactor3D.surfaceMapsKey(material)
Surface maps key.
injectSurfaceOcclusion
static sourceReactor3D.injectSurfaceOcclusion(material, shader)
Surface cavities shade the base before reflections and glow are added.
litMaterial
static sourceReactor3D.litMaterial(material)
Lit material.
classifyGpu
static sourceReactor3D.classifyGpu(description)
"weak", "full" or "unknown" for a renderer description.
tier
static sourceReactor3D.tier()
The tier every cost decision in this file asks for: an explicit override first, then the game's, and "full" when nobody knows — an unknown GPU is left sharp rather than quietly demoted.
fastShading
static sourceReactor3D.fastShading()
Fast shading.
activeCamera
static sourceReactor3D.activeCamera()
Active camera.
viewFrustum
static sourceReactor3D.viewFrustum()
The view frustum, rebuilt at most once a frame.
Details
The view frustum, rebuilt at most once a frame.
A light whose sphere of reach does not touch the frustum cannot light a single fragment anyone can see — every visible fragment is inside the frustum by definition — so dropping it changes no pixel. On the Demo's start map nine of the ten lights are off screen at any moment, and every lit pixel was running the distance and falloff maths for all ten. Null when there is no camera to ask, in which case nothing is culled.
viewEye
static sourceReactor3D.viewEye()
Where the drawing camera stands, in world units, or null with no viewport.
sphereInView
static sourceReactor3D.sphereInView(x, y, z, radius)
Whether a sphere of radius at (x, y, z) can reach anything on screen.
shadowsWanted
static sourceReactor3D.shadowsWanted(mapData)
Whether this map wants shadows at all: the engine switch, the mode, the sidecar.
shadowsBuilt
static sourceReactor3D.shadowsBuilt(mapData)
Whether this map's lit programs carry the shadow lookup: the engine switch, the mode and the sidecar, but not the Quality levels.
Details
Whether this map's lit programs carry the shadow lookup: the engine switch, the mode and the sidecar, but not the
Quality levels. Auto's levels turn shadows off and on as a machine falls short or recovers; when that changed the
programs, every lit one was built again at the step, on the machine least able to afford it: on the Iris Xe laptop
(OpenGL, programs kept from the run before) 32 programs and 12 s of frames of 0.7 to 2.4 s as the first room
stepped from GPU 4 to GPU 5 (2026-11-18). A level without shadows now keeps the programs and only stops drawing
and reading the rows (Shadows.render, held): no light reads a row, which the shader skips before any lookup.
claimShadows
static sourceReactor3D.claimShadows(renderer)
Claim shadows.
mapRowsIdle
static sourceReactor3D.mapRowsIdle(owner)
Whether owner is the game map's renderer while a scene other than the map runs (it draws nothing then).
lights
static sourceReactor3D.lights()
Lights.
ambient
static sourceReactor3D.ambient()
Ambient.
daylightOf
static sourceReactor3D.daylightOf(ambient, out)
The time of day an ambient { intensity, colour } stands for, written into out (made once when absent): day, twilight and night (weights summing to 1), warm (0-1, how amber the twilight is), sun (a following sun's brightness factor), sunMix/amberMix/moonMix (how its colour is made: authored, amber, moon), sky ([r, g, b] as seen) and skyLinear (the same in light, what the dome and the studio reflec…
Details
The time of day an ambient { intensity, colour } stands for, written into
out (made once when absent): day, twilight and night (weights summing
to 1), warm (0-1, how amber the twilight is), sun (a following sun's
brightness factor), sunMix/amberMix/moonMix (how its colour is made:
authored, amber, moon), sky ([r, g, b] as seen) and skyLinear (the same in
light, what the dome and the studio reflection are multiplied by). No ambient
(an unlit map) is full day.
daylight
static sourceReactor3D.daylight(ambient = this._ambient)
The time of day of the current ambient (setAmbient), worked out again only when it changes.
sunDirection
static sourceReactor3D.sunDirection(yaw, pitch, day, fixed, out)
The unit vector toward a sun, into out, from its authored yaw and pitch in degrees (as the sidecar holds them) and the time of day day (from daylight; null or a fixed sun keeps its elevation).
Details
The unit vector toward a sun, into out, from its authored yaw and
pitch in degrees (as the sidecar holds them) and the time of day day
(from daylight; null or a fixed sun keeps its elevation).
sunAtDaylight
static sourceReactor3D.sunAtDaylight(light, colour, intensity, day, out)
Sun at daylight.
nearestLights
static sourceReactor3D.nearestLights(lights, focus)
The lights worth carrying, nearest a point first.
Details
The lights worth carrying, nearest a point first.
A light is only worth a slot if it can be seen from where the camera is looking, so the budget goes to the closest — and a light whose radius does not reach the focus at all is dropped before the sort, which on a city map removes most of them for nothing.
lightEyeInterior
static sourceReactor3D.lightEyeInterior(eye)
Whether the camera stands in the walkable interior, where hiding a lamp behind a wall means something.
Details
Whether the camera stands in the walkable interior, where hiding a lamp behind a wall means something. Outside the grid, or embedded in a cell the solid grid calls wall (a room's unpainted shell), the eye is a cinematic viewpoint: it sees the interior the renderer draws regardless, so its sight-lines must not be marched through the shell.
lightSolidGrid
static sourceReactor3D.lightSolidGrid()
Where a room map has no floor tile at all it is wall, cached per map.
lightBlockHeightAt
static sourceReactor3D.lightBlockHeightAt(x, y)
How high the world stands at a cell, as far as light is concerned.
lightSegmentBlocked
static sourceReactor3D.lightSegmentBlocked(x0, y0, h0, x1, y1, h1)
Whether a straight line between two heighted points crosses something taller than itself.
Details
Whether a straight line between two heighted points crosses something taller than itself. Neither endpoint's own cell may block: the wall a lamp hangs on is not between the lamp and anything.
frameStamp
static sourceReactor3D.frameStamp()
Frame stamp.
sameMatrix
static sourceReactor3D.sameMatrix(a, b)
Same matrix.
beamHit
static sourceReactor3D.beamHit(x, y, h, ax, ay, az, length, scene, bounds)
Beam hit.
litCharacters
static sourceReactor3D.litCharacters()
Every character on the map that carries a RaveLighting config.
raveOffset
static sourceReactor3D.raveOffset(cfg)
Where a light sits relative to its character, in pixels.
Details
Where a light sits relative to its character, in pixels. Per shape.
raveYaw
static sourceReactor3D.raveYaw(cfg, character)
Which way a cone points, in degrees, with south at zero.
parseColour
static sourceReactor3D.parseColour(value)
#rrggbb or a number, to a number.
Details
#rrggbb or a number, to a number. White for anything unreadable.
noteModelFacing
static sourceReactor3D.noteModelFacing(character, radians)
Record the heading a character's model is drawn at this frame, in scene radians.
Details
Record the heading a character's model is drawn at this frame, in scene radians. Facing itself is discrete, but the mesh eases between compass points over about a quarter second, and anything riding the character - a carried spotlight above all - should swing with the mesh rather than jump ahead of it.
carrierFacingYaw
static sourceReactor3D.carrierFacingYaw(carrier)
Carrier facing yaw.
facingYaw
static sourceReactor3D.facingYaw(direction)
RPG Maker's direction numbers as a yaw in degrees: 2 is south, 8 north.
suppressFlatLighting
static sourceReactor3D.suppressFlatLighting(hide)
Put every plugin's 2D lightmap away, or bring them all back.
wantsLights3D
static sourceReactor3D.wantsLights3D(mapData)
Whether this map wants its lights in three dimensions.
Details
Whether this map wants its lights in three dimensions.
Off unless asked for. A project already lit to its author's satisfaction in
2D should not have that quietly replaced by something that looks different,
so it is opted into per map with <3d lights> in the note, beside the <3d>
that made it a 3D map at all.
authoredLights3D
static sourceReactor3D.authoredLights3D(mapData)
Whether the map lights itself in three dimensions, before any AmbientLight command.
ambientOverrideActive
static sourceReactor3D.ambientOverrideActive()
Whether an AmbientLight command holds this map's ambient.
mapLightingChoice
static sourceReactor3D.mapLightingChoice(mapData)
What the map's sidecar says about lighting: true or false, or null when it says nothing and the note or the placed models decide.
Details
What the map's sidecar says about lighting: true or false, or null
when it says nothing and the note or the placed models decide. The
enabled flag is final. Otherwise placed lights opt in (an author who put
a lamp somewhere wants to see it lit), and so does an ambient that darkens
or tints: an author who set the map to night wants night. Full white
daylight is the unlit look and asks for nothing.
mapMeta
static sourceReactor3D.mapMeta(mapData)
The map's note tags: meta as the game's DataManager made it, or read from the note the same way when the map came without one (the editor's maps).
authoredAmbient
static sourceReactor3D.authoredAmbient(mapData)
A map's ambient as its sidecar writes it, before any AmbientLight command.
ambientFor
static sourceReactor3D.ambientFor(mapData)
Ambient for.
seamAmbient
static sourceReactor3D.seamAmbient(ambient, mapData)
The ambient ambient of the map played, taken toward the neighbor's as far as _seamLight says.
seamSunOf
static sourceReactor3D.seamSunOf(seam)
The neighbor's sun, as { light, ground } (its authored light and the ground under it), or null: read once per map.
blendSeamSun
static sourceReactor3D.blendSeamSun(out, map, day)
The map's lights (out, from nativeLights) with its sun taken toward the neighbor's as far as _seamLight says: its place, the ground it stands over, its height, reach, colour and brightness, both at the time of day day.
Details
The map's lights (out, from nativeLights) with its sun taken toward the
neighbor's as far as _seamLight says: its place, the ground it stands
over, its height, reach, colour and brightness, both at the time of day
day. A sun only one of the two maps has fades toward none. It keeps its
id, so its shadow row stays its own.
flatAmbientTint
static sourceReactor3D.flatAmbientTint(ambient)
Display-space ambient tint for the flat multiply overlay.
collectLights
static sourceReactor3D.collectLights()
Collect this frame's lights from whichever lighting plugin is present.
Details
Collect this frame's lights from whichever lighting plugin is present.
Each shim is tried and each may fail without taking the frame with it: a plugin can be updated underneath this at any time, and a 3D map going black because a shim threw would be a poor trade for lighting.
readMapLights
static sourceReactor3D.readMapLights(mapData)
Read map lights.
lightingEnabled
static sourceReactor3D.lightingEnabled(mapData)
Whether this map has native lighting at all, in either renderer.
Details
Whether this map has native lighting at all, in either renderer.
The sidecar's word is final when it says anything; otherwise placed lights
or a darkened or tinted ambient mean yes (mapLightingChoice), and the map
notes can ask for it by hand.
authoredLighting
static sourceReactor3D.authoredLighting(mapData)
Whether the map lights itself, before any AmbientLight command.
overrideProgress
static sourceReactor3D.overrideProgress(block, frame)
Override progress.
mixColour
static sourceReactor3D.mixColour(a, b, t)
Mix colour.
lightOverrideFor
static sourceReactor3D.lightOverrideFor(light)
The override block a light reads: its own id first, then its tag's.
liveLightValues
static sourceReactor3D.liveLightValues(light, frame)
Live light values.
lightsTargeted
static sourceReactor3D.lightsTargeted(target)
Every authored light a command target names: one id, or all of a tag.
switchLight
static sourceReactor3D.switchLight(target, state)
Turn a light, or every light of a tag, on, off or over.
transformLight
static sourceReactor3D.transformLight(target, values, duration)
Ease a light, or every light of a tag, to new values over duration frames.
Details
Ease a light, or every light of a tag, to new values over duration
frames. values holds any of LIGHT_OVERRIDE_FIELDS; a field left out is
left alone. Colour may be "#rrggbb" or a number. values === null
clears the target's overrides.
lightIsOn
static sourceReactor3D.lightIsOn(light)
Light is on.
nativeLights
static sourceReactor3D.nativeLights(mapData)
This frame's native lights, resolved into the compositor's shape.
Details
This frame's native lights, resolved into the compositor's shape.
Animation is arithmetic on the frame counter — deterministic, allocation- light, identical in both renderers. A light attached to an event or the player rides its carrier, its x/y read as offsets in tiles. Yaw flips sign on the way out because the scene aims anticlockwise from south while the schema (and the screen) run clockwise — the same flip the shims make.