# op_red
Material for the outpost under the energy-shield dome in the `fx_shield` scene (the `Outpost` entity
at (110, 0, 150), the dome's centre). One entity wears it: `mast_beacon`, the small sphere at the
top of the `mast` under `Outpost`.
Shader: the built-in `pbr` shader (`@builtin::shaders.pbr`), the engine's standard physically based
material: the glTF metallic-roughness workflow lit by the shared `pbr_shading` model. Its glow
output is `emissive` times `emissive_intensity` (default 1.0) times the emissive texture (default
white).
Render state: the defaults (opaque blend, back faces culled, depth write on); mat.yaml sets only the
shader and its values.
## Properties
- `base_color: { r: 0.2, g: 0.02, b: 0.02, a: 1.0 }`: albedo, a dark red.
- `emissive: { r: 4.0, g: 0.1, b: 0.05, a: 1.0 }`: red glow colour, above 1 in red.
- `roughness: 0.4`: perceptual roughness.
- `metallic: 0.0`: dielectric.
# op_amber
Material for the outpost under the energy-shield dome in the `fx_shield` scene (the `Outpost` entity
at (110, 0, 150), the dome's centre). Six entities wear it: the window of each of the three habitats
(`hab_window` under `hab1`, `hab2`, `hab3`), the two lamp heads (`lamp_head1`, `lamp_head2`,
built-in spheres) and `pad_ring`, a 5.9 m wide, 0.04 m thick cylinder beneath the 5.55 m landing
pad, all under `Outpost`.
Shader: the built-in `pbr` shader (`@builtin::shaders.pbr`), the engine's standard physically based
material: the glTF metallic-roughness workflow lit by the shared `pbr_shading` model. Its glow
output is `emissive` times `emissive_intensity` (default 1.0) times the emissive texture (default
white).
Render state: the defaults (opaque blend, back faces culled, depth write on); mat.yaml sets only the
shader and its values.
## Properties
- `base_color: { r: 0.15, g: 0.08, b: 0.02, a: 1.0 }`: albedo, a dark brown.
- `emissive: { r: 3.0, g: 1.4, b: 0.25, a: 1.0 }`: amber glow colour, above 1 in red and green.
- `roughness: 0.4`: perceptual roughness.
- `metallic: 0.0`: dielectric.
# op_ground
Material for the outpost under the energy-shield dome in the `fx_shield` scene (the `Outpost` entity
at (110, 0, 150), the dome's centre). The scene's `ground` entity (a built-in cube scaled 56 x 0.2 x
56 at (110, -0.1, 150)) wears it.
Shader: the built-in `pbr` shader (`@builtin::shaders.pbr`), the engine's standard physically based
material: the glTF metallic-roughness workflow lit by the shared `pbr_shading` model. Its glow
output is `emissive` times `emissive_intensity` (default 1.0) times the emissive texture (default
white).
Render state: the defaults (opaque blend, back faces culled, depth write on); mat.yaml sets only the
shader and its values.
## Properties
- `base_color: { r: 0.07, g: 0.078, b: 0.10, a: 1.0 }`: albedo, a dark blue-grey.
- `emissive: { r: 0, g: 0, b: 0, a: 1.0 }`: black, so it emits nothing.
- `roughness: 0.96`: perceptual roughness, close to fully rough.
- `metallic: 0.0`: dielectric.
# ShieldFxDriver
ShieldFxDriver runs the energy-shield effect from the `ShieldFx` module around the entity it sits
on. The dome is centred on the entity's position, incoming fire hammers it, and the impact lights
named by `lights` flash where each shot lands. It runs while the scene is authored and while it
plays.
The fx_shield scene uses it on the `ShieldDome` entity (which also carries a Model), with
`radius = 9` and `lights = "ImpactLight"`; the scene holds the lights `ImpactLight1` to
`ImpactLight4`.
It requires `ShieldFx` (`require("ShieldFx")`). The impact lights are entities named `lights`
followed by 1, 2, 3 and so on, each with a `Light` component.
## Fields
| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `radius` | number | 9 | The dome's radius, in metres. |
| `lights` | string | `"ImpactLight"` | The name every impact light starts with; the entities named it followed by 1, 2, 3 and so on flash at each impact. |
Both fields are `Sync`.
## Lifecycle
- `start()`: calls `ShieldFx.start`, with `center` set to the entity's position and `radius` set to
the `radius` field, and keeps the token it returns. It then collects the impact lights, looking up
`lights .. 1`, `lights .. 2` and onward for as long as each name finds an entity with a `Light`
component, and hands them to `ShieldFx.attachLights`.
- `update(dt)`: calls `ShieldFx.step(dt)`.
- `editorUpdate(dt)`: calls `ShieldFx.step(dt)` while `engine.paused` is true.
- `onDestroy()`: calls `ShieldFx.stop(token)` with the token from `start`.
# op_hull
Material for the outpost under the energy-shield dome in the `fx_shield` scene (the `Outpost` entity
at (110, 0, 150), the dome's centre). 18 entities wear it, all under `Outpost` or its habitats: the
twelve rounded-box barriers that ring the outpost, the body of each of the three habitats
(`hab_body`), the cargo container `cargo2`, the central column `proj_column` and the dish on the
mast (`mast_dish`).
Shader: the built-in `pbr` shader (`@builtin::shaders.pbr`), the engine's standard physically based
material: the glTF metallic-roughness workflow lit by the shared `pbr_shading` model. Its glow
output is `emissive` times `emissive_intensity` (default 1.0) times the emissive texture (default
white).
Render state: the defaults (opaque blend, back faces culled, depth write on); mat.yaml sets only the
shader and its values.
## Properties
- `base_color: { r: 0.17, g: 0.19, b: 0.23, a: 1.0 }`: albedo, a blue-grey.
- `emissive: { r: 0, g: 0, b: 0, a: 1.0 }`: black, so it emits nothing.
- `roughness: 0.5`: perceptual roughness.
- `metallic: 0.55`: partly metallic.
# shield_dome_mesh
Hemisphere mesh for the energy-shield dome in the `fx_shield` scene. The `ShieldDome` entity at
(110, 0, 150) draws it with `shield_dome_mat`; the `shield_dome` shader's vertex stage moves each
vertex along its direction from the mesh origin to dent and ripple the dome at each hit.
`ShieldFx.module` builds this geometry with `M.domeGeometry(R)`: the upper half of a sphere of
radius R centred on the origin, 64 bands from the pole to the base by 160 segments around, normals
pointing out from the centre, and uv = (fraction around, fraction from the pole). The module's
comment states that this function is called once by the authoring script and that the resulting
`.mesh` assets are what the scene's Model entities reference.
`data.zmsh` is the engine-native geometry payload. Its header states format version 2 with normals
and UVs, 10465 vertices (65 x 161), 61440 indices (20480 triangles) and bounds from (-9, 0, -9) to
(9, 9, 9), so R is 9 m, the radius the `ShieldFxDriver` uses.
# shield_dome_mat
Material for the energy-shield dome in the `fx_shield` scene. The `ShieldDome` entity at (110, 0, 150)
draws `shield_dome_mesh` with it and carries the `ShieldFxDriver` component (radius 9, impact
lights named `ImpactLight`). `ShieldFx.module` resolves the material by name in `M.start` and writes
its `center` once; every frame it writes the twelve hit slots and `strain` in one
`Material.setProperties` call, the same values it writes to `ground_arcs_mat`.
Shader: `shield_dome` (`shield_dome.shader`). Its header: an energy shield dome whose hits arrive as
12 float4 material properties, with the hex lattice, ripples, flares, strain flicker and base arcs
all evaluated per pixel. A conformal projection of the sphere onto a plane keeps the hex cells
hexagonal. Each hit sends a ring and a hex-quantised wave across the dome and blooms at the impact
point; the rim brightens with a fresnel term; strain makes cells strobe, the whole shield stutter
and the colour drift toward magenta-white; back faces draw at 55% brightness. The vertex stage dents
the surface at each impact and pushes a travelling swell outward from it.
Render state: `blend: additive`, `cull: none`, `depth_write: false`.
## Properties
- `hex_scale: 12.0`: density of the hex lattice on the projected dome (default 9, range 2 to 30); a
larger value makes more, smaller cells.
- `tint` (default (0.08, 0.55, 1.0, 1.0)): base glow colour.
- `hot` (default (0.75, 0.95, 1.0, 1.0)): colour mixed in for arcs and hit heat.
- `center` (default (0, 0, 0, 9)): xyz is the dome centre in world space and w the dome radius.
ShieldFx writes the `ShieldDome` entity's position (110, 0, 150) and the driver's radius, 9.
- `strain` (default 0, range 0 to 3): overload level; the shader divides it by 2.5 and clamps it to 1.
ShieldFx raises it with every hit, more when the hit lands near recent ones, caps it at 3 and
lets it decay over time.
- `hit0` to `hit11` (default (0, 1, 0, -1)): one slot per recent hit. xyz is the unit direction of
the hit from the dome centre times its strength, w its age in seconds; an age below 0 or above 3.5
leaves the slot idle.
# op_dark
Material for the outpost under the energy-shield dome in the `fx_shield` scene (the `Outpost` entity
at (110, 0, 150), the dome's centre). 13 entities wear it: the two lamp poles, the `mast`, the base,
collar and lower torus of the central `proj_` column (`proj_base`, `proj_collar`, `proj_ring2`), the
roof and vent of each of the three habitats, and the cargo container `cargo3`.
Shader: the built-in `pbr` shader (`@builtin::shaders.pbr`), the engine's standard physically based
material: the glTF metallic-roughness workflow lit by the shared `pbr_shading` model. Its glow
output is `emissive` times `emissive_intensity` (default 1.0) times the emissive texture (default
white).
Render state: the defaults (opaque blend, back faces culled, depth write on); mat.yaml sets only the
shader and its values.
## Properties
- `base_color: { r: 0.045, g: 0.05, b: 0.06, a: 1.0 }`: albedo, near black with a blue cast.
- `emissive: { r: 0, g: 0, b: 0, a: 1.0 }`: black, so it emits nothing.
- `roughness: 0.45`: perceptual roughness.
- `metallic: 0.85`: mostly metallic.
# op_rock
Material for the outpost under the energy-shield dome in the `fx_shield` scene (the `Outpost` entity
at (110, 0, 150), the dome's centre). 70 entities wear it: `rock1` to `rock70`, built-in octahedrons
flattened in y and scattered over the ground around the outpost.
Shader: the built-in `pbr` shader (`@builtin::shaders.pbr`), the engine's standard physically based
material: the glTF metallic-roughness workflow lit by the shared `pbr_shading` model. Its glow
output is `emissive` times `emissive_intensity` (default 1.0) times the emissive texture (default
white).
Render state: the defaults (opaque blend, back faces culled, depth write on); mat.yaml sets only the
shader and its values.
## Properties
- `base_color: { r: 0.085, g: 0.08, b: 0.085, a: 1.0 }`: albedo, a dark grey.
- `emissive: { r: 0, g: 0, b: 0, a: 1.0 }`: black, so it emits nothing.
- `roughness: 0.92`: perceptual roughness.
- `metallic: 0.0`: dielectric.
# op_pad
Material for the outpost under the energy-shield dome in the `fx_shield` scene (the `Outpost` entity
at (110, 0, 150), the dome's centre). One entity wears it: `pad`, the landing pad cylinder (5.55 m
across, 0.06 m thick) under `Outpost`.
Shader: the built-in `pbr` shader (`@builtin::shaders.pbr`), the engine's standard physically based
material: the glTF metallic-roughness workflow lit by the shared `pbr_shading` model. Its glow
output is `emissive` times `emissive_intensity` (default 1.0) times the emissive texture (default
white).
Render state: the defaults (opaque blend, back faces culled, depth write on); mat.yaml sets only the
shader and its values.
## Properties
- `base_color: { r: 0.10, g: 0.11, b: 0.13, a: 1.0 }`: albedo, a dark grey.
- `emissive: { r: 0, g: 0, b: 0, a: 1.0 }`: black, so it emits nothing.
- `roughness: 0.55`: perceptual roughness.
- `metallic: 0.6`: partly metallic.
# op_cyan
Material for the outpost under the energy-shield dome in the `fx_shield` scene (the `Outpost` entity
at (110, 0, 150), the dome's centre). Six entities wear it: three parts of the `proj_` column at the
outpost's centre (the sphere `proj_core`, the upper torus `proj_ring1` and the thin cylinder
`proj_glow_band`) and the door of each of the three habitats (`hab_door`).
Shader: the built-in `pbr` shader (`@builtin::shaders.pbr`), the engine's standard physically based
material: the glTF metallic-roughness workflow lit by the shared `pbr_shading` model. Its glow
output is `emissive` times `emissive_intensity` (default 1.0) times the emissive texture (default
white).
Render state: the defaults (opaque blend, back faces culled, depth write on); mat.yaml sets only the
shader and its values.
## Properties
- `base_color: { r: 0.02, g: 0.1, b: 0.15, a: 1.0 }`: albedo, a dark blue-green.
- `emissive: { r: 0.1, g: 0.9, b: 1.4, a: 1.0 }`: cyan glow colour.
- `roughness: 0.3`: perceptual roughness.
- `metallic: 0.0`: dielectric.
# op_orange_hull
Material for the outpost under the energy-shield dome in the `fx_shield` scene (the `Outpost` entity
at (110, 0, 150), the dome's centre). One entity wears it: the cargo container `cargo1`, a built-in
cube under `Outpost`.
Shader: the built-in `pbr` shader (`@builtin::shaders.pbr`), the engine's standard physically based
material: the glTF metallic-roughness workflow lit by the shared `pbr_shading` model. Its glow
output is `emissive` times `emissive_intensity` (default 1.0) times the emissive texture (default
white).
Render state: the defaults (opaque blend, back faces culled, depth write on); mat.yaml sets only the
shader and its values.
## Properties
- `base_color: { r: 0.5, g: 0.22, b: 0.06, a: 1.0 }`: albedo, an orange-brown.
- `emissive: { r: 0, g: 0, b: 0, a: 1.0 }`: black, so it emits nothing.
- `roughness: 0.55`: perceptual roughness.
- `metallic: 0.35`: partly metallic.
# ground_arcs_mat
Material for the ring of energy on the ground around the shield dome in the `fx_shield` scene. The
`ShieldGroundArcs` entity at (110, 0, 150) draws `shield_ground_mesh` with it. `ShieldFx.module`
resolves it by name in `M.start` and writes its `center` once; every frame it writes the twelve hit
slots and `strain` in one `Material.setProperties` call, the same values it writes to
`shield_dome_mat`.
Shader: `ground_arcs` (`ground_arcs.shader`). Its header describes a flat annulus lying on the
ground around the dome's foot: a soft energy glow, jagged radial arcs crawling out from the base,
and hot spots on the ground under whichever part of the dome was just hit. Hits low on the dome heat
the ground more than hits high on it, the ring fades out between 4.5 and 9.5 m outside the dome
radius, and under strain the whole ring stutters. It is an unlit `fragment()` shader returning alpha 1.
Render state: `blend: additive`, `cull: none`, `depth_write: false`.
## Properties
mat.yaml sets only the render block. The shader's properties, and what writes them:
- `tint` (default (0.08, 0.55, 1.0, 1.0)): base glow colour.
- `hot` (default (0.75, 0.95, 1.0, 1.0)): colour mixed in for arcs and hit heat.
- `center` (default (0, 0, 0, 9)): xyz is the dome centre in world space and w the dome radius.
ShieldFx writes the `ShieldDome` entity's position (110, 0, 150) and the driver's radius, 9.
- `strain` (default 0, range 0 to 3): overload level; the shader divides it by 2.5 and clamps it to 1.
ShieldFx raises it with every hit, more when the hit lands near recent ones, caps it at 3 and
lets it decay over time.
- `hit0` to `hit11` (default (0, 1, 0, -1)): one slot per recent hit. xyz is the unit direction of
the hit from the dome centre times its strength, w its age in seconds; an age below 0 or above 3.5
leaves the slot idle.
# shield_ground_mesh
Flat ring mesh lying on the ground around the energy-shield dome in the `fx_shield` scene. The
`ShieldGroundArcs` entity at (110, 0, 150) draws it with `ground_arcs_mat`.
`ShieldFx.module` builds this geometry with `M.groundGeometry(R)`, an annulus from radius R - 1.6 to
R + 10 at height 0.04, 5 bands across by 160 segments around, normals pointing up, and uv =
(fraction around, fraction from the inner edge). The module's comment states that this function is
called once by the authoring script and that the resulting `.mesh` assets are what the scene's Model
entities reference.
`data.zmsh` is the engine-native geometry payload. Its header states format version 2 with normals
and UVs, 966 vertices (6 x 161), 4800 indices (1600 triangles) and bounds from (-19, 0.04, -19) to
(19, 0.04, 19): the ring runs from radius 7.4 to 19 m around a 9 m dome.