@origingame/engine 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/og.mjs +25 -0
- package/dist/web/origin-engine.d.ts +1233 -0
- package/dist/web/origin-engine.js +8628 -0
- package/dist/web/origin-engine_bg.wasm +0 -0
- package/dist/web/origin-engine_bg.wasm.d.ts +366 -0
- package/dist/web-publish/origin-engine-lanes.js +8509 -0
- package/dist/web-publish/origin-engine-lanes_bg.wasm +0 -0
- package/dist/web-publish/origin-engine.d.ts +1176 -0
- package/dist/web-publish/origin-engine.js +8313 -0
- package/dist/web-publish/origin-engine_bg.wasm +0 -0
- package/dist/web-publish/origin-engine_bg.wasm.d.ts +347 -0
- package/dist/web-publish/snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.no-bundler.js +77 -0
- package/dist/web-publish-2d/origin-engine-lanes.js +8509 -0
- package/dist/web-publish-2d/origin-engine-lanes_bg.wasm +0 -0
- package/dist/web-publish-2d/origin-engine.d.ts +1176 -0
- package/dist/web-publish-2d/origin-engine.js +8313 -0
- package/dist/web-publish-2d/origin-engine_bg.wasm +0 -0
- package/dist/web-publish-2d/origin-engine_bg.wasm.d.ts +347 -0
- package/dist/web-publish-2d/snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.no-bundler.js +77 -0
- package/knowledge/README.md +31 -0
- package/knowledge/knowledge.json +13 -0
- package/knowledge/looks/catalogue.json +1871 -0
- package/knowledge/package.json +33 -0
- package/knowledge/rules/platform.json +329 -0
- package/knowledge/scaffold/README.md +27 -0
- package/knowledge/scaffold/distribution.json +48 -0
- package/knowledge/scaffold/origin-engine.json +19 -0
- package/knowledge/scaffold/template/.origin/setup +14 -0
- package/knowledge/scaffold/template/LICENSES.md +23 -0
- package/knowledge/scaffold/template/README.md +37 -0
- package/knowledge/scaffold/template/assets/ai/guard.ogt +48 -0
- package/knowledge/scaffold/template/assets/audio/click.ogt +9 -0
- package/knowledge/scaffold/template/assets/fonts/NotoSansSC-Regular-subset.ttf.ogt +12 -0
- package/knowledge/scaffold/template/assets/fonts/OFL.txt +93 -0
- package/knowledge/scaffold/template/assets/looks/origin-game.ogt +12 -0
- package/knowledge/scaffold/template/assets/nav/yard.ogt +27 -0
- package/knowledge/scaffold/template/assets/scenes/main.ogt +34 -0
- package/knowledge/scaffold/template/assets/strings/en.ogt +14 -0
- package/knowledge/scaffold/template/assets/textures/stone_n.png.ogt +7 -0
- package/knowledge/scaffold/template/gitattributes +22 -0
- package/knowledge/scaffold/template/gitignore +8 -0
- package/knowledge/scaffold/template/package.json +18 -0
- package/knowledge/scaffold/template/project.ogt +25 -0
- package/knowledge/scaffold/template/src/main.ts +246 -0
- package/knowledge/scaffold/template/tests/guard.og.ts +67 -0
- package/knowledge/scaffold/template/tests/smoke.og.ts +43 -0
- package/knowledge/scaffold/template/tsconfig.json +17 -0
- package/knowledge/scripts/lib.ts +207 -0
- package/knowledge/scripts/mount.ts +210 -0
- package/knowledge/scripts/pack.ts +25 -0
- package/knowledge/scripts/scaffold.ts +72 -0
- package/knowledge/scripts/validate.ts +749 -0
- package/knowledge/skills/og-ai/SKILL.md +386 -0
- package/knowledge/skills/og-audio/SKILL.md +191 -0
- package/knowledge/skills/og-build/SKILL.md +330 -0
- package/knowledge/skills/og-core/SKILL.md +285 -0
- package/knowledge/skills/og-feel/SKILL.md +385 -0
- package/knowledge/skills/og-game/SKILL.md +1479 -0
- package/knowledge/skills/og-i18n/SKILL.md +220 -0
- package/knowledge/skills/og-platform-sdk/SKILL.md +199 -0
- package/knowledge/skills/og-taste/SKILL.md +537 -0
- package/knowledge/skills/og-ui/SKILL.md +444 -0
- package/knowledge/wiki/ai.md +627 -0
- package/knowledge/wiki/anim.md +1187 -0
- package/knowledge/wiki/atmosphere.md +636 -0
- package/knowledge/wiki/audio.md +732 -0
- package/knowledge/wiki/camera.md +711 -0
- package/knowledge/wiki/commands.md +357 -0
- package/knowledge/wiki/game.md +220 -0
- package/knowledge/wiki/i18n.md +213 -0
- package/knowledge/wiki/index.md +1027 -0
- package/knowledge/wiki/input.md +1714 -0
- package/knowledge/wiki/load.md +1280 -0
- package/knowledge/wiki/math.md +166 -0
- package/knowledge/wiki/nav.md +1154 -0
- package/knowledge/wiki/physics.md +3142 -0
- package/knowledge/wiki/platform.md +857 -0
- package/knowledge/wiki/probe.md +1692 -0
- package/knowledge/wiki/reflect.md +285 -0
- package/knowledge/wiki/render.md +3511 -0
- package/knowledge/wiki/rng.md +393 -0
- package/knowledge/wiki/stream.md +376 -0
- package/knowledge/wiki/system.md +197 -0
- package/knowledge/wiki/systems.md +43 -0
- package/knowledge/wiki/terrain.md +727 -0
- package/knowledge/wiki/tilemap.md +422 -0
- package/knowledge/wiki/time.md +150 -0
- package/knowledge/wiki/transform.md +230 -0
- package/knowledge/wiki/tween.md +580 -0
- package/knowledge/wiki/ui.md +8000 -0
- package/knowledge/wiki/world.md +909 -0
- package/package.json +68 -4
- package/schema/api.schema.json +29675 -0
- package/shell/README.md +22 -0
- package/shell/brand/README.md +23 -0
- package/shell/brand/icon-192.png +0 -0
- package/shell/brand/icon-512.png +0 -0
- package/shell/brand/mark-on-paper.svg +6 -0
- package/shell/brand/origin-mark.svg +5 -0
- package/shell/brand/origin-motion.css +251 -0
- package/shell/brand/tokens.css +20 -0
- package/shell/brand.ts +132 -0
- package/shell/page.ts +715 -0
- package/shell/platform.ts +203 -0
- package/shell/player.ts +238 -0
- package/shell/shell.css +185 -0
- package/shell/sw.ts +177 -0
- package/shell/transport.ts +515 -0
- package/shell/wire.ts +369 -0
- package/src/e6.ts +69 -0
- package/src/env.d.ts +100 -0
- package/src/generated/abi.ts +980 -0
- package/src/index.ts +193 -0
- package/src/node/audio.ts +86 -0
- package/src/node/build.ts +109 -0
- package/src/node/device.ts +981 -0
- package/src/node/doctor.ts +60 -0
- package/src/node/index.ts +102 -0
- package/src/node/platform.ts +24 -0
- package/src/node/playtest-run.ts +249 -0
- package/src/node/png.ts +130 -0
- package/src/node/polish.ts +976 -0
- package/src/node/run.ts +373 -0
- package/src/node/web-build.ts +808 -0
- package/src/p2.ts +35 -0
- package/src/platform-local.ts +211 -0
- package/src/playtest.ts +131 -0
- package/src/runtime.ts +1509 -0
- package/src/systems/cameras.ts +247 -0
- package/src/ui-kit/bind.ts +141 -0
- package/src/ui-kit/huds.ts +303 -0
- package/src/ui-kit/index.ts +36 -0
- package/src/ui-kit/menus.ts +187 -0
- package/src/ui-kit/settings.ts +131 -0
- package/src/ui-kit/store.ts +222 -0
- package/src/ui-kit/story.ts +89 -0
- package/src/ui-kit/util.ts +106 -0
- package/src/web/a11y.ts +429 -0
- package/src/web/audio-worklet.ts +193 -0
- package/src/web/audio.ts +307 -0
- package/src/web/basis.ts +239 -0
- package/src/web/gamepad.ts +123 -0
- package/src/web/host.ts +166 -0
- package/src/web/input.ts +237 -0
- package/src/web/lanes.ts +21 -0
- package/src/web/play.ts +20 -0
- package/src/web/rpc-ring.ts +110 -0
- package/src/web/settle.ts +122 -0
- package/src/web/shell.ts +643 -0
- package/src/web/text-input.ts +248 -0
- package/src/web/worker.ts +1002 -0
- package/types/bindings.json +13654 -0
- package/types/index.d.ts +20090 -0
- package/vendor/basis/LICENSE +201 -0
- package/vendor/basis/NOTICE +15 -0
- package/vendor/basis/README.md +18 -0
- package/vendor/basis/basis_transcoder.js +19 -0
- package/vendor/basis/basis_transcoder.wasm +0 -0
- package/README.md +0 -3
|
@@ -0,0 +1,636 @@
|
|
|
1
|
+
<!-- Generated from crates/og-api/api.ogt by `og api gen`. Do not edit: `og api check` fails on any difference; change api.ogt and regenerate. -->
|
|
2
|
+
|
|
3
|
+
# The `atmosphere` module
|
|
4
|
+
|
|
5
|
+
Fog, a procedural sky, the day-night cycle, weather and water, declared as resources and components (the E5 round). Everything is off by default: a world that sets none of them draws exactly as before.
|
|
6
|
+
|
|
7
|
+
The day-night clock is a function of the tick (DayNight.start plus the simulated time times speed), so it is the same on every run and after a restore; rendering reads the world and never writes it.
|
|
8
|
+
|
|
9
|
+
- **TypeScript**: functions are the namespace `og.atmosphere`; components, resources and events are tokens on `og`.
|
|
10
|
+
- **Publish builds**: kept (members may override).
|
|
11
|
+
- **Skill**: `og-game`, which teaches the module (how much of it to use, and how to prove it).
|
|
12
|
+
- **Index**: [every module and name](index.md).
|
|
13
|
+
|
|
14
|
+
```ogt
|
|
15
|
+
module atmosphere {
|
|
16
|
+
# declarations follow, each quoted below
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
<sub>`api.ogt` line 5220</sub>
|
|
20
|
+
|
|
21
|
+
## Contents
|
|
22
|
+
|
|
23
|
+
| Name | Kind | Summary |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| [`WEATHER_NONE`](#const-WEATHER_NONE) | constant | Weather.kind: clear. |
|
|
26
|
+
| [`WEATHER_RAIN`](#const-WEATHER_RAIN) | constant | Weather.kind: rain streaks falling with the wind, the light dimmed and a grey distance fog. |
|
|
27
|
+
| [`WEATHER_SNOW`](#const-WEATHER_SNOW) | constant | Weather.kind: flakes drifting down on gusts, a pale fog. |
|
|
28
|
+
| [`WEATHER_DUST`](#const-WEATHER_DUST) | constant | Weather.kind: dust blowing along the wind near the ground, a warm thick fog. |
|
|
29
|
+
| [`WEATHER_MIST`](#const-WEATHER_MIST) | constant | Weather.kind: no particles, a dense low height fog. |
|
|
30
|
+
| [`og.Fog`](#record-Fog) | resource | Distance and height fog over the 3D scene and world sprites: distance fog thickens exponentially by density from start (or linearly from start to end when end > start), height fog is densest below height and thins by falloff per metre above it; looking into the sun it turns towards sunColor. The overlay is never fogged. |
|
|
31
|
+
| [`og.Sky`](#record-Sky) | resource | A procedural sky of chosen colours, drawn behind the scene per pixel and lighting it (the image-based light follows it). Without it, RenderSettings.sky draws the built-in sky. A DayNight that is enabled sets the sky itself. |
|
|
32
|
+
| [`og.DayNight`](#record-DayNight) | resource | A day-night cycle: the time of day drives the sun's direction, the sky's colours, stars and the moon disc, the first DirectionalLight (the sun by day, a dim moon opposite it by night), the ambient light and the fog's colour. The clock is start plus the simulated seconds times speed, wrapped to 24 hours; the image-based light is regenerated every `step` minutes of game time while the sky drawn per pixel moves smoothly. The drive happens as the frame is drawn and never writes the world: the DirectionalLight keeps the colour, intensity and transform it was given. The probe's `get` answers what is drawn, a pure function of the tick: `get:og.DayNight` adds `hours`, `toSun`, `toLight` (towards the sun by day, the moon by night), `lightColor` and `lightIntensity`, and `get:<sun>.og.DirectionalLight` on the driven light answers the drawn `color` and `intensity` with `toLight` and `drivenBy`. |
|
|
33
|
+
| [`og.Weather`](#record-Weather) | resource | A weather preset around the camera: particles (rain, snow, dust), its fog (unless og.Fog is enabled, which takes precedence) and dimmed sunlight. Particles are simulated by the renderer from the tick, so they look the same on every run; they never touch the simulation. |
|
|
34
|
+
| [`og.Water`](#record-Water) | component | A planar water surface on the entity's xz plane (centred on it, turned with it): colour by the water's depth over what is below, foam where it meets geometry, animated waves, refraction and reflections (screen-space where the tier allows, the sky's cubemap on WebGL2, or a planar reflection), the sun's shadows, caustics below it and an underwater view. With an og.WaterSurface on the same entity its wave heights displace the surface (centred on the entity, unrotated). |
|
|
35
|
+
| [`og.Water2D`](#record-Water2D) | component | Draws the og.WaterLine on the same entity in the sprite order: the body from its surface down, a gradient from the top colour to the bottom one, and a bright lip along the surface. |
|
|
36
|
+
| [`og.atmosphere.timeOfDay`](#fn-timeOfDay) | function | The DayNight clock at the current tick, in hours from 0 to 24 (its start when the cycle is off): for lamps that light at dusk and shops that close at night. Inside a system, declare og.DayNight among its reads. |
|
|
37
|
+
|
|
38
|
+
## Functions
|
|
39
|
+
|
|
40
|
+
<a id="fn-timeOfDay"></a>
|
|
41
|
+
|
|
42
|
+
### `og.atmosphere.timeOfDay`
|
|
43
|
+
|
|
44
|
+
The DayNight clock at the current tick, in hours from 0 to 24 (its start when the cycle is off): for lamps that light at dusk and shops that close at night. Inside a system, declare og.DayNight among its reads.
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
og.atmosphere.timeOfDay(world: World): number
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
| Parameter | Type | Optional | Doc |
|
|
51
|
+
|---|---|---|---|
|
|
52
|
+
| `world` | `World` | no | The world. |
|
|
53
|
+
|
|
54
|
+
**Returns** `number`.
|
|
55
|
+
|
|
56
|
+
Binding symbol `og_atmosphere_time_of_day` · publish builds: kept
|
|
57
|
+
|
|
58
|
+
```ogt
|
|
59
|
+
fn timeOfDay {
|
|
60
|
+
doc "The DayNight clock at the current tick, in hours from 0 to 24 (its start when the cycle is off): for lamps that light at dusk and shops that close at night. Inside a system, declare og.DayNight among its reads."
|
|
61
|
+
param world World "The world."
|
|
62
|
+
returns f32
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
<sub>`api.ogt` line 5597</sub>
|
|
67
|
+
|
|
68
|
+
## Components, resources and events
|
|
69
|
+
|
|
70
|
+
<a id="record-Fog"></a>
|
|
71
|
+
|
|
72
|
+
### `og.Fog` (resource)
|
|
73
|
+
|
|
74
|
+
Distance and height fog over the 3D scene and world sprites: distance fog thickens exponentially by density from start (or linearly from start to end when end > start), height fog is densest below height and thins by falloff per metre above it; looking into the sun it turns towards sunColor. The overlay is never fogged.
|
|
75
|
+
|
|
76
|
+
Token `og.Fog`, registered under the schema name `og.Fog`; its value type is `Fog`.
|
|
77
|
+
|
|
78
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
79
|
+
|---|---|---|---|---|---|---|
|
|
80
|
+
| `enabled` | `boolean` | `false` | — | — | — | Draw the fog. |
|
|
81
|
+
| `color` | `Color` | `{ r: 0.62, g: 0.68, b: 0.76 }` | — | — | — | The colour the fog tends to (linear, before exposure). |
|
|
82
|
+
| `density` | `number` | `0.02` | 0 … 2 | — | tunable | Distance fog per metre (0: none). |
|
|
83
|
+
| `start` | `number` | `0` | ≥ 0 | `m` | tunable | Where distance fog starts. |
|
|
84
|
+
| `end` | `number` | `0` | ≥ 0 | `m` | tunable | With end > start, a linear ramp to full fog at end as well. |
|
|
85
|
+
| `heightDensity` | `number` | `0` | 0 … 10 | — | tunable | Height fog at and below height (0: none). |
|
|
86
|
+
| `height` | `number` | `0` | — | `m` | tunable | The world height below which height fog is densest. |
|
|
87
|
+
| `falloff` | `number` | `0.5` | 0.0001 … 20 | — | tunable | How fast height fog thins above height, per metre. |
|
|
88
|
+
| `sunColor` | `Color` | `{ r: 1, g: 0.86, b: 0.62 }` | — | — | — | The fog's colour looking into the sun (forward scattering). |
|
|
89
|
+
| `sunPower` | `number` | `8` | 0 … 256 | — | tunable | How tight the sun's glow in the fog is (higher: smaller). |
|
|
90
|
+
| `maxOpacity` | `number` | `1` | 0 … 1 | `ratio` | tunable | The most the fog hides. |
|
|
91
|
+
| `sky` | `number` | `1` | 0 … 1 | `ratio` | tunable | How much of the fog covers the sky (0: the sky stays clear). |
|
|
92
|
+
|
|
93
|
+
```ogt
|
|
94
|
+
resource Fog {
|
|
95
|
+
doc "Distance and height fog over the 3D scene and world sprites: distance fog thickens exponentially by density from start (or linearly from start to end when end > start), height fog is densest below height and thins by falloff per metre above it; looking into the sun it turns towards sunColor. The overlay is never fogged."
|
|
96
|
+
field enabled bool "Draw the fog."
|
|
97
|
+
field color Color "The colour the fog tends to (linear, before exposure)." {
|
|
98
|
+
default 0.62 0.68 0.76
|
|
99
|
+
}
|
|
100
|
+
field density f32 "Distance fog per metre (0: none)." {
|
|
101
|
+
default 0.02
|
|
102
|
+
min 0
|
|
103
|
+
max 2
|
|
104
|
+
tunable true
|
|
105
|
+
}
|
|
106
|
+
field start f32 "Where distance fog starts." {
|
|
107
|
+
min 0
|
|
108
|
+
unit m
|
|
109
|
+
tunable true
|
|
110
|
+
}
|
|
111
|
+
field end f32 "With end > start, a linear ramp to full fog at end as well." {
|
|
112
|
+
min 0
|
|
113
|
+
unit m
|
|
114
|
+
tunable true
|
|
115
|
+
}
|
|
116
|
+
field heightDensity f32 "Height fog at and below height (0: none)." {
|
|
117
|
+
min 0
|
|
118
|
+
max 10
|
|
119
|
+
tunable true
|
|
120
|
+
}
|
|
121
|
+
field height f32 "The world height below which height fog is densest." {
|
|
122
|
+
unit m
|
|
123
|
+
tunable true
|
|
124
|
+
}
|
|
125
|
+
field falloff f32 "How fast height fog thins above height, per metre." {
|
|
126
|
+
default 0.5
|
|
127
|
+
min 0.0001
|
|
128
|
+
max 20
|
|
129
|
+
tunable true
|
|
130
|
+
}
|
|
131
|
+
field sunColor Color "The fog's colour looking into the sun (forward scattering)." {
|
|
132
|
+
default 1 0.86 0.62
|
|
133
|
+
}
|
|
134
|
+
field sunPower f32 "How tight the sun's glow in the fog is (higher: smaller)." {
|
|
135
|
+
default 8
|
|
136
|
+
min 0
|
|
137
|
+
max 256
|
|
138
|
+
tunable true
|
|
139
|
+
}
|
|
140
|
+
field maxOpacity f32 "The most the fog hides." {
|
|
141
|
+
default 1
|
|
142
|
+
min 0
|
|
143
|
+
max 1
|
|
144
|
+
unit ratio
|
|
145
|
+
tunable true
|
|
146
|
+
}
|
|
147
|
+
field sky f32 "How much of the fog covers the sky (0: the sky stays clear)." {
|
|
148
|
+
default 1
|
|
149
|
+
min 0
|
|
150
|
+
max 1
|
|
151
|
+
unit ratio
|
|
152
|
+
tunable true
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
<sub>`api.ogt` line 5231</sub>
|
|
158
|
+
|
|
159
|
+
<a id="record-Sky"></a>
|
|
160
|
+
|
|
161
|
+
### `og.Sky` (resource)
|
|
162
|
+
|
|
163
|
+
A procedural sky of chosen colours, drawn behind the scene per pixel and lighting it (the image-based light follows it). Without it, RenderSettings.sky draws the built-in sky. A DayNight that is enabled sets the sky itself.
|
|
164
|
+
|
|
165
|
+
Token `og.Sky`, registered under the schema name `og.Sky`; its value type is `Sky`.
|
|
166
|
+
|
|
167
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
168
|
+
|---|---|---|---|---|---|---|
|
|
169
|
+
| `enabled` | `boolean` | `false` | — | — | — | Draw and light by this sky. |
|
|
170
|
+
| `zenith` | `Color` | `{ r: 0.18, g: 0.36, b: 0.78 }` | — | — | — | Overhead. |
|
|
171
|
+
| `horizon` | `Color` | `{ r: 0.78, g: 0.84, b: 0.92 }` | — | — | — | At the horizon. |
|
|
172
|
+
| `ground` | `Color` | `{ r: 0.16, g: 0.14, b: 0.12 }` | — | — | — | Below the horizon. |
|
|
173
|
+
| `sunDirection` | `Vector3` | `{ x: 0.45, y: 0.8, z: 0.35 }` | — | — | — | Towards the sun (match your DirectionalLight). |
|
|
174
|
+
| `sunColor` | `Color` | `{ r: 1, g: 0.95, b: 0.88 }` | — | — | — | The sun's colour. |
|
|
175
|
+
| `sunSize` | `number` | `1.8` | 0 … 20 | `deg` | tunable | The sun disc's angular radius (0: no disc). |
|
|
176
|
+
| `sunIntensity` | `number` | `40` | ≥ 0 | — | tunable | The disc's brightness. |
|
|
177
|
+
| `glow` | `number` | `0.6` | ≥ 0 | — | tunable | The glow around the sun. |
|
|
178
|
+
| `glowPower` | `number` | `24` | ≥ 1 | — | tunable | How tight the glow is. |
|
|
179
|
+
| `stars` | `number` | `0` | 0 … 1 | `ratio` | tunable | Stars where the sky is dark: 0 none, 1 a full night sky. |
|
|
180
|
+
| `brightness` | `number` | `1.1` | ≥ 0 | — | tunable | A multiplier on the whole sky. |
|
|
181
|
+
| `moonSize` | `number` | `0` | 0 … 20 | `deg` | tunable | The moon disc's angular radius (0: no moon). It sets below the horizon and hides the stars behind it. |
|
|
182
|
+
| `moonPhase` | `number` | `0.5` | 0 … 1 | `ratio` | tunable | How much of the moon is lit: 0 new, 0.25 the first quarter (its right half), 0.5 full, 0.75 the last quarter (its left half). |
|
|
183
|
+
| `moonIntensity` | `number` | `1.4` | ≥ 0 | — | tunable | The lit moon's brightness. |
|
|
184
|
+
| `moonColor` | `Color` | `{ r: 0.9, g: 0.92, b: 1 }` | — | — | — | The moon's colour. |
|
|
185
|
+
| `moonDirection` | `Vector3` | `{ x: 0, y: 0, z: 0 }` | — | — | — | Towards the moon; zero puts it opposite sunDirection. |
|
|
186
|
+
|
|
187
|
+
```ogt
|
|
188
|
+
resource Sky {
|
|
189
|
+
doc "A procedural sky of chosen colours, drawn behind the scene per pixel and lighting it (the image-based light follows it). Without it, RenderSettings.sky draws the built-in sky. A DayNight that is enabled sets the sky itself."
|
|
190
|
+
field enabled bool "Draw and light by this sky."
|
|
191
|
+
field zenith Color "Overhead." {
|
|
192
|
+
default 0.18 0.36 0.78
|
|
193
|
+
}
|
|
194
|
+
field horizon Color "At the horizon." {
|
|
195
|
+
default 0.78 0.84 0.92
|
|
196
|
+
}
|
|
197
|
+
field ground Color "Below the horizon." {
|
|
198
|
+
default 0.16 0.14 0.12
|
|
199
|
+
}
|
|
200
|
+
field sunDirection Vector3 "Towards the sun (match your DirectionalLight)." {
|
|
201
|
+
default 0.45 0.8 0.35
|
|
202
|
+
}
|
|
203
|
+
field sunColor Color "The sun's colour." {
|
|
204
|
+
default 1 0.95 0.88
|
|
205
|
+
}
|
|
206
|
+
field sunSize f32 "The sun disc's angular radius (0: no disc)." {
|
|
207
|
+
default 1.8
|
|
208
|
+
min 0
|
|
209
|
+
max 20
|
|
210
|
+
unit deg
|
|
211
|
+
tunable true
|
|
212
|
+
}
|
|
213
|
+
field sunIntensity f32 "The disc's brightness." {
|
|
214
|
+
default 40
|
|
215
|
+
min 0
|
|
216
|
+
tunable true
|
|
217
|
+
}
|
|
218
|
+
field glow f32 "The glow around the sun." {
|
|
219
|
+
default 0.6
|
|
220
|
+
min 0
|
|
221
|
+
tunable true
|
|
222
|
+
}
|
|
223
|
+
field glowPower f32 "How tight the glow is." {
|
|
224
|
+
default 24
|
|
225
|
+
min 1
|
|
226
|
+
tunable true
|
|
227
|
+
}
|
|
228
|
+
field stars f32 "Stars where the sky is dark: 0 none, 1 a full night sky." {
|
|
229
|
+
min 0
|
|
230
|
+
max 1
|
|
231
|
+
unit ratio
|
|
232
|
+
tunable true
|
|
233
|
+
}
|
|
234
|
+
field brightness f32 "A multiplier on the whole sky." {
|
|
235
|
+
default 1.1
|
|
236
|
+
min 0
|
|
237
|
+
tunable true
|
|
238
|
+
}
|
|
239
|
+
field moonSize f32 "The moon disc's angular radius (0: no moon). It sets below the horizon and hides the stars behind it." {
|
|
240
|
+
min 0
|
|
241
|
+
max 20
|
|
242
|
+
unit deg
|
|
243
|
+
tunable true
|
|
244
|
+
}
|
|
245
|
+
field moonPhase f32 "How much of the moon is lit: 0 new, 0.25 the first quarter (its right half), 0.5 full, 0.75 the last quarter (its left half)." {
|
|
246
|
+
default 0.5
|
|
247
|
+
min 0
|
|
248
|
+
max 1
|
|
249
|
+
unit ratio
|
|
250
|
+
tunable true
|
|
251
|
+
}
|
|
252
|
+
field moonIntensity f32 "The lit moon's brightness." {
|
|
253
|
+
default 1.4
|
|
254
|
+
min 0
|
|
255
|
+
tunable true
|
|
256
|
+
}
|
|
257
|
+
field moonColor Color "The moon's colour." {
|
|
258
|
+
default 0.9 0.92 1
|
|
259
|
+
}
|
|
260
|
+
field moonDirection Vector3 "Towards the moon; zero puts it opposite sunDirection."
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
<sub>`api.ogt` line 5293</sub>
|
|
265
|
+
|
|
266
|
+
<a id="record-DayNight"></a>
|
|
267
|
+
|
|
268
|
+
### `og.DayNight` (resource)
|
|
269
|
+
|
|
270
|
+
A day-night cycle: the time of day drives the sun's direction, the sky's colours, stars and the moon disc, the first DirectionalLight (the sun by day, a dim moon opposite it by night), the ambient light and the fog's colour. The clock is start plus the simulated seconds times speed, wrapped to 24 hours; the image-based light is regenerated every `step` minutes of game time while the sky drawn per pixel moves smoothly. The drive happens as the frame is drawn and never writes the world: the DirectionalLight keeps the colour, intensity and transform it was given. The probe's `get` answers what is drawn, a pure function of the tick: `get:og.DayNight` adds `hours`, `toSun`, `toLight` (towards the sun by day, the moon by night), `lightColor` and `lightIntensity`, and `get:<sun>.og.DirectionalLight` on the driven light answers the drawn `color` and `intensity` with `toLight` and `drivenBy`.
|
|
271
|
+
|
|
272
|
+
Token `og.DayNight`, registered under the schema name `og.DayNight`; its value type is `DayNight`.
|
|
273
|
+
|
|
274
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
275
|
+
|---|---|---|---|---|---|---|
|
|
276
|
+
| `enabled` | `boolean` | `false` | — | — | — | Run the cycle. |
|
|
277
|
+
| `start` | `number` | `9` | 0 … 24 | — | tunable | The time of day at tick 0, in hours (6 sunrise, 12 noon, 18 sunset). |
|
|
278
|
+
| `speed` | `number` | `0.05` | 0 … 24 | — | tunable | Game hours per simulated second (0.05: a day in 8 minutes; 0 holds the time). |
|
|
279
|
+
| `tilt` | `number` | `25` | 0 … 89 | `deg` | tunable | How far the sun's path leans from overhead. |
|
|
280
|
+
| `azimuth` | `number` | `0` | — | `deg` | tunable | Where the sun rises, turned about +y from +x. |
|
|
281
|
+
| `lightIntensity` | `number` | `1` | 0 … 10 | — | tunable | A multiplier on the sun and moon light. |
|
|
282
|
+
| `tintFog` | `boolean` | `true` | — | — | — | Turn the og.Fog colour towards the horizon's. |
|
|
283
|
+
| `step` | `number` | `10` | 1 … 120 | — | tunable | Game minutes between regenerations of the image-based light. |
|
|
284
|
+
| `moonSize` | `number` | `1.6` | 0 … 20 | `deg` | tunable | The moon disc's angular radius, opposite the sun so it rises as the sun sets (0: no moon). |
|
|
285
|
+
| `moonPhase` | `number` | `0.5` | 0 … 1 | `ratio` | tunable | How much of the moon is lit: 0 new, 0.25 the first quarter, 0.5 full, 0.75 the last quarter. |
|
|
286
|
+
|
|
287
|
+
```ogt
|
|
288
|
+
resource DayNight {
|
|
289
|
+
doc "A day-night cycle: the time of day drives the sun's direction, the sky's colours, stars and the moon disc, the first DirectionalLight (the sun by day, a dim moon opposite it by night), the ambient light and the fog's colour. The clock is start plus the simulated seconds times speed, wrapped to 24 hours; the image-based light is regenerated every `step` minutes of game time while the sky drawn per pixel moves smoothly. The drive happens as the frame is drawn and never writes the world: the DirectionalLight keeps the colour, intensity and transform it was given. The probe's `get` answers what is drawn, a pure function of the tick: `get:og.DayNight` adds `hours`, `toSun`, `toLight` (towards the sun by day, the moon by night), `lightColor` and `lightIntensity`, and `get:<sun>.og.DirectionalLight` on the driven light answers the drawn `color` and `intensity` with `toLight` and `drivenBy`."
|
|
290
|
+
field enabled bool "Run the cycle."
|
|
291
|
+
field start f32 "The time of day at tick 0, in hours (6 sunrise, 12 noon, 18 sunset)." {
|
|
292
|
+
default 9
|
|
293
|
+
min 0
|
|
294
|
+
max 24
|
|
295
|
+
tunable true
|
|
296
|
+
}
|
|
297
|
+
field speed f32 "Game hours per simulated second (0.05: a day in 8 minutes; 0 holds the time)." {
|
|
298
|
+
default 0.05
|
|
299
|
+
min 0
|
|
300
|
+
max 24
|
|
301
|
+
tunable true
|
|
302
|
+
}
|
|
303
|
+
field tilt f32 "How far the sun's path leans from overhead." {
|
|
304
|
+
default 25
|
|
305
|
+
min 0
|
|
306
|
+
max 89
|
|
307
|
+
unit deg
|
|
308
|
+
tunable true
|
|
309
|
+
}
|
|
310
|
+
field azimuth f32 "Where the sun rises, turned about +y from +x." {
|
|
311
|
+
unit deg
|
|
312
|
+
tunable true
|
|
313
|
+
}
|
|
314
|
+
field lightIntensity f32 "A multiplier on the sun and moon light." {
|
|
315
|
+
default 1
|
|
316
|
+
min 0
|
|
317
|
+
max 10
|
|
318
|
+
tunable true
|
|
319
|
+
}
|
|
320
|
+
field tintFog bool "Turn the og.Fog colour towards the horizon's." {
|
|
321
|
+
default true
|
|
322
|
+
}
|
|
323
|
+
field step f32 "Game minutes between regenerations of the image-based light." {
|
|
324
|
+
default 10
|
|
325
|
+
min 1
|
|
326
|
+
max 120
|
|
327
|
+
tunable true
|
|
328
|
+
}
|
|
329
|
+
field moonSize f32 "The moon disc's angular radius, opposite the sun so it rises as the sun sets (0: no moon)." {
|
|
330
|
+
default 1.6
|
|
331
|
+
min 0
|
|
332
|
+
max 20
|
|
333
|
+
unit deg
|
|
334
|
+
tunable true
|
|
335
|
+
}
|
|
336
|
+
field moonPhase f32 "How much of the moon is lit: 0 new, 0.25 the first quarter, 0.5 full, 0.75 the last quarter." {
|
|
337
|
+
default 0.5
|
|
338
|
+
min 0
|
|
339
|
+
max 1
|
|
340
|
+
unit ratio
|
|
341
|
+
tunable true
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
<sub>`api.ogt` line 5368</sub>
|
|
347
|
+
|
|
348
|
+
<a id="record-Weather"></a>
|
|
349
|
+
|
|
350
|
+
### `og.Weather` (resource)
|
|
351
|
+
|
|
352
|
+
A weather preset around the camera: particles (rain, snow, dust), its fog (unless og.Fog is enabled, which takes precedence) and dimmed sunlight. Particles are simulated by the renderer from the tick, so they look the same on every run; they never touch the simulation.
|
|
353
|
+
|
|
354
|
+
Token `og.Weather`, registered under the schema name `og.Weather`; its value type is `Weather`.
|
|
355
|
+
|
|
356
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
357
|
+
|---|---|---|---|---|---|---|
|
|
358
|
+
| `kind` | `number` | `0` | 0 … 4 | — | label “Kind” | WEATHER_NONE 0, WEATHER_RAIN 1, WEATHER_SNOW 2, WEATHER_DUST 3, WEATHER_MIST 4. |
|
|
359
|
+
| `intensity` | `number` | `1` | 0 … 2 | — | tunable | How heavy: scales the particle rate, the fog and the dimming. |
|
|
360
|
+
| `wind` | `Vector3` | `{ x: 1.5, y: 0, z: 0.5 }` | — | `mps` | tunable | Where the wind blows the particles. |
|
|
361
|
+
| `radius` | `number` | `18` | 1 … 200 | `m` | tunable | The size of the region around the camera the particles fill. |
|
|
362
|
+
| `tint` | `Color` | `{ r: 1, g: 1, b: 1 }` | — | — | — | Multiplies the particles' colour. |
|
|
363
|
+
| `dim` | `number` | `1` | 0 … 1 | `ratio` | tunable | How much of the preset's dimming of the sunlight applies. |
|
|
364
|
+
| `layer` | `number` | `50` | — | — | — | With an orthographic camera (2D), the sprite layer the particles draw in. |
|
|
365
|
+
|
|
366
|
+
```ogt
|
|
367
|
+
resource Weather {
|
|
368
|
+
doc "A weather preset around the camera: particles (rain, snow, dust), its fog (unless og.Fog is enabled, which takes precedence) and dimmed sunlight. Particles are simulated by the renderer from the tick, so they look the same on every run; they never touch the simulation."
|
|
369
|
+
field kind u32 "WEATHER_NONE 0, WEATHER_RAIN 1, WEATHER_SNOW 2, WEATHER_DUST 3, WEATHER_MIST 4." {
|
|
370
|
+
min 0
|
|
371
|
+
max 4
|
|
372
|
+
label "Kind"
|
|
373
|
+
}
|
|
374
|
+
field intensity f32 "How heavy: scales the particle rate, the fog and the dimming." {
|
|
375
|
+
default 1
|
|
376
|
+
min 0
|
|
377
|
+
max 2
|
|
378
|
+
tunable true
|
|
379
|
+
}
|
|
380
|
+
field wind Vector3 "Where the wind blows the particles." {
|
|
381
|
+
default 1.5 0 0.5
|
|
382
|
+
unit mps
|
|
383
|
+
tunable true
|
|
384
|
+
}
|
|
385
|
+
field radius f32 "The size of the region around the camera the particles fill." {
|
|
386
|
+
default 18
|
|
387
|
+
min 1
|
|
388
|
+
max 200
|
|
389
|
+
unit m
|
|
390
|
+
tunable true
|
|
391
|
+
}
|
|
392
|
+
field tint Color "Multiplies the particles' colour." {
|
|
393
|
+
default 1 1 1
|
|
394
|
+
}
|
|
395
|
+
field dim f32 "How much of the preset's dimming of the sunlight applies." {
|
|
396
|
+
default 1
|
|
397
|
+
min 0
|
|
398
|
+
max 1
|
|
399
|
+
unit ratio
|
|
400
|
+
tunable true
|
|
401
|
+
}
|
|
402
|
+
field layer i32 "With an orthographic camera (2D), the sprite layer the particles draw in." {
|
|
403
|
+
default 50
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
<sub>`api.ogt` line 5425</sub>
|
|
409
|
+
|
|
410
|
+
<a id="record-Water"></a>
|
|
411
|
+
|
|
412
|
+
### `og.Water` (component)
|
|
413
|
+
|
|
414
|
+
A planar water surface on the entity's xz plane (centred on it, turned with it): colour by the water's depth over what is below, foam where it meets geometry, animated waves, refraction and reflections (screen-space where the tier allows, the sky's cubemap on WebGL2, or a planar reflection), the sun's shadows, caustics below it and an underwater view. With an og.WaterSurface on the same entity its wave heights displace the surface (centred on the entity, unrotated).
|
|
415
|
+
|
|
416
|
+
Token `og.Water`, registered under the schema name `og.Water`; its value type is `Water`.
|
|
417
|
+
|
|
418
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
419
|
+
|---|---|---|---|---|---|---|
|
|
420
|
+
| `size` | `Vector2` | `{ x: 16, y: 16 }` | — | `m` | tunable | The extent along the entity's x and z. |
|
|
421
|
+
| `segments` | `number` | `64` | 1 … 256 | — | — | Grid cells per side (the height field's detail). |
|
|
422
|
+
| `shallow` | `Color` | `{ r: 0.55, g: 0.85, b: 0.82 }` | — | — | — | Shallow water's colour (tints what is seen through it). |
|
|
423
|
+
| `deep` | `Color` | `{ r: 0.02, g: 0.09, b: 0.14 }` | — | — | — | Deep water's colour. |
|
|
424
|
+
| `depthFade` | `number` | `2.5` | ≥ 0.01 | `m` | tunable | The depth over which water turns from shallow to deep. |
|
|
425
|
+
| `opacity` | `number` | `0.92` | 0 … 1 | `ratio` | tunable | How opaque deep water gets. |
|
|
426
|
+
| `foam` | `Color` | `{ r: 0.95, g: 0.97, b: 1 }` | — | — | — | The foam's colour. |
|
|
427
|
+
| `foamWidth` | `number` | `0.35` | ≥ 0 | `m` | tunable | The water depth over which foam rings geometry (0: none). |
|
|
428
|
+
| `waveScale` | `number` | `0.6` | ≥ 0 | — | tunable | Detail waves per metre. |
|
|
429
|
+
| `waveSpeed` | `number` | `1` | — | — | tunable | How fast the detail waves travel. |
|
|
430
|
+
| `waveStrength` | `number` | `0.35` | 0 … 4 | — | tunable | How strongly they bend the surface (0: a mirror). |
|
|
431
|
+
| `refraction` | `number` | `1` | ≥ 0 | — | tunable | How far refraction shifts what is seen through the water. |
|
|
432
|
+
| `reflectivity` | `number` | `1` | 0 … 2 | — | tunable | How much it reflects. |
|
|
433
|
+
| `planarReflection` | `number` | `0` | 0 … 1 | `ratio` | tunable | Reflect the scene by drawing it again from the camera mirrored in the surface, at this fraction of the screen's resolution (0: off, the screen-space and sky reflections). One surface a frame, the first that asks; it costs about a second scene pass at that resolution. |
|
|
434
|
+
| `shadows` | `number` | `0` | 0 … 1 | `ratio` | tunable | How much the sun's shadows darken the surface: its highlight, foam and colour (0: none). |
|
|
435
|
+
| `underwaterColor` | `Color` | `{ r: 0.03, g: 0.16, b: 0.2 }` | — | — | — | With the camera below the surface: the water's fog colour. |
|
|
436
|
+
| `underwaterDensity` | `number` | `0.09` | 0 … 2 | — | tunable | Its fog per metre (0: no underwater view). Below the surface the frame's fog becomes the water's, and the surface seen from below shows the sky inside Snell's window. |
|
|
437
|
+
| `caustics` | `number` | `0` | 0 … 4 | — | tunable | Caustics of the sunlight on everything below the surface (0: none). One surface a frame, the first that has them. |
|
|
438
|
+
| `causticsScale` | `number` | `0.6` | 0.01 … 10 | — | tunable | The caustics' cells per metre. |
|
|
439
|
+
|
|
440
|
+
```ogt
|
|
441
|
+
component Water {
|
|
442
|
+
doc "A planar water surface on the entity's xz plane (centred on it, turned with it): colour by the water's depth over what is below, foam where it meets geometry, animated waves, refraction and reflections (screen-space where the tier allows, the sky's cubemap on WebGL2, or a planar reflection), the sun's shadows, caustics below it and an underwater view. With an og.WaterSurface on the same entity its wave heights displace the surface (centred on the entity, unrotated)."
|
|
443
|
+
field size Vector2 "The extent along the entity's x and z." {
|
|
444
|
+
default 16 16
|
|
445
|
+
unit m
|
|
446
|
+
tunable true
|
|
447
|
+
}
|
|
448
|
+
field segments u32 "Grid cells per side (the height field's detail)." {
|
|
449
|
+
default 64
|
|
450
|
+
min 1
|
|
451
|
+
max 256
|
|
452
|
+
}
|
|
453
|
+
field shallow Color "Shallow water's colour (tints what is seen through it)." {
|
|
454
|
+
default 0.55 0.85 0.82
|
|
455
|
+
}
|
|
456
|
+
field deep Color "Deep water's colour." {
|
|
457
|
+
default 0.02 0.09 0.14
|
|
458
|
+
}
|
|
459
|
+
field depthFade f32 "The depth over which water turns from shallow to deep." {
|
|
460
|
+
default 2.5
|
|
461
|
+
min 0.01
|
|
462
|
+
unit m
|
|
463
|
+
tunable true
|
|
464
|
+
}
|
|
465
|
+
field opacity f32 "How opaque deep water gets." {
|
|
466
|
+
default 0.92
|
|
467
|
+
min 0
|
|
468
|
+
max 1
|
|
469
|
+
unit ratio
|
|
470
|
+
tunable true
|
|
471
|
+
}
|
|
472
|
+
field foam Color "The foam's colour." {
|
|
473
|
+
default 0.95 0.97 1
|
|
474
|
+
}
|
|
475
|
+
field foamWidth f32 "The water depth over which foam rings geometry (0: none)." {
|
|
476
|
+
default 0.35
|
|
477
|
+
min 0
|
|
478
|
+
unit m
|
|
479
|
+
tunable true
|
|
480
|
+
}
|
|
481
|
+
field waveScale f32 "Detail waves per metre." {
|
|
482
|
+
default 0.6
|
|
483
|
+
min 0
|
|
484
|
+
tunable true
|
|
485
|
+
}
|
|
486
|
+
field waveSpeed f32 "How fast the detail waves travel." {
|
|
487
|
+
default 1
|
|
488
|
+
tunable true
|
|
489
|
+
}
|
|
490
|
+
field waveStrength f32 "How strongly they bend the surface (0: a mirror)." {
|
|
491
|
+
default 0.35
|
|
492
|
+
min 0
|
|
493
|
+
max 4
|
|
494
|
+
tunable true
|
|
495
|
+
}
|
|
496
|
+
field refraction f32 "How far refraction shifts what is seen through the water." {
|
|
497
|
+
default 1
|
|
498
|
+
min 0
|
|
499
|
+
tunable true
|
|
500
|
+
}
|
|
501
|
+
field reflectivity f32 "How much it reflects." {
|
|
502
|
+
default 1
|
|
503
|
+
min 0
|
|
504
|
+
max 2
|
|
505
|
+
tunable true
|
|
506
|
+
}
|
|
507
|
+
field planarReflection f32 "Reflect the scene by drawing it again from the camera mirrored in the surface, at this fraction of the screen's resolution (0: off, the screen-space and sky reflections). One surface a frame, the first that asks; it costs about a second scene pass at that resolution." {
|
|
508
|
+
min 0
|
|
509
|
+
max 1
|
|
510
|
+
unit ratio
|
|
511
|
+
tunable true
|
|
512
|
+
}
|
|
513
|
+
field shadows f32 "How much the sun's shadows darken the surface: its highlight, foam and colour (0: none)." {
|
|
514
|
+
min 0
|
|
515
|
+
max 1
|
|
516
|
+
unit ratio
|
|
517
|
+
tunable true
|
|
518
|
+
}
|
|
519
|
+
field underwaterColor Color "With the camera below the surface: the water's fog colour." {
|
|
520
|
+
default 0.03 0.16 0.2
|
|
521
|
+
}
|
|
522
|
+
field underwaterDensity f32 "Its fog per metre (0: no underwater view). Below the surface the frame's fog becomes the water's, and the surface seen from below shows the sky inside Snell's window." {
|
|
523
|
+
default 0.09
|
|
524
|
+
min 0
|
|
525
|
+
max 2
|
|
526
|
+
tunable true
|
|
527
|
+
}
|
|
528
|
+
field caustics f32 "Caustics of the sunlight on everything below the surface (0: none). One surface a frame, the first that has them." {
|
|
529
|
+
min 0
|
|
530
|
+
max 4
|
|
531
|
+
tunable true
|
|
532
|
+
}
|
|
533
|
+
field causticsScale f32 "The caustics' cells per metre." {
|
|
534
|
+
default 0.6
|
|
535
|
+
min 0.01
|
|
536
|
+
max 10
|
|
537
|
+
tunable true
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
<sub>`api.ogt` line 5465</sub>
|
|
543
|
+
|
|
544
|
+
<a id="record-Water2D"></a>
|
|
545
|
+
|
|
546
|
+
### `og.Water2D` (component)
|
|
547
|
+
|
|
548
|
+
Draws the og.WaterLine on the same entity in the sprite order: the body from its surface down, a gradient from the top colour to the bottom one, and a bright lip along the surface.
|
|
549
|
+
|
|
550
|
+
Token `og.Water2D`, registered under the schema name `og.Water2D`; its value type is `Water2D`.
|
|
551
|
+
|
|
552
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
553
|
+
|---|---|---|---|---|---|---|
|
|
554
|
+
| `top` | `Color` | `{ r: 0.16, g: 0.5, b: 0.72 }` | — | — | — | The body's colour at the surface. |
|
|
555
|
+
| `topOpacity` | `number` | `0.72` | 0 … 1 | `ratio` | — | Its opacity there. |
|
|
556
|
+
| `bottom` | `Color` | `{ r: 0.02, g: 0.1, b: 0.25 }` | — | — | — | The colour at the bottom. |
|
|
557
|
+
| `bottomOpacity` | `number` | `0.92` | 0 … 1 | `ratio` | — | Its opacity there. |
|
|
558
|
+
| `lip` | `Color` | `{ r: 0.8, g: 0.95, b: 1 }` | — | — | — | The lip along the surface. |
|
|
559
|
+
| `lipWidth` | `number` | `0.06` | ≥ 0 | `m` | tunable | How thick the lip is (0: none). |
|
|
560
|
+
| `layer` | `number` | `0` | — | — | — | The sprite layer it is drawn in. |
|
|
561
|
+
|
|
562
|
+
```ogt
|
|
563
|
+
component Water2D {
|
|
564
|
+
doc "Draws the og.WaterLine on the same entity in the sprite order: the body from its surface down, a gradient from the top colour to the bottom one, and a bright lip along the surface."
|
|
565
|
+
field top Color "The body's colour at the surface." {
|
|
566
|
+
default 0.16 0.5 0.72
|
|
567
|
+
}
|
|
568
|
+
field topOpacity f32 "Its opacity there." {
|
|
569
|
+
default 0.72
|
|
570
|
+
min 0
|
|
571
|
+
max 1
|
|
572
|
+
unit ratio
|
|
573
|
+
}
|
|
574
|
+
field bottom Color "The colour at the bottom." {
|
|
575
|
+
default 0.02 0.1 0.25
|
|
576
|
+
}
|
|
577
|
+
field bottomOpacity f32 "Its opacity there." {
|
|
578
|
+
default 0.92
|
|
579
|
+
min 0
|
|
580
|
+
max 1
|
|
581
|
+
unit ratio
|
|
582
|
+
}
|
|
583
|
+
field lip Color "The lip along the surface." {
|
|
584
|
+
default 0.8 0.95 1
|
|
585
|
+
}
|
|
586
|
+
field lipWidth f32 "How thick the lip is (0: none)." {
|
|
587
|
+
default 0.06
|
|
588
|
+
min 0
|
|
589
|
+
unit m
|
|
590
|
+
tunable true
|
|
591
|
+
}
|
|
592
|
+
field layer i32 "The sprite layer it is drawn in."
|
|
593
|
+
}
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
<sub>`api.ogt` line 5565</sub>
|
|
597
|
+
|
|
598
|
+
## Constants
|
|
599
|
+
|
|
600
|
+
| Constant | Type | Value | Doc |
|
|
601
|
+
|---|---|---|---|
|
|
602
|
+
| <a id="const-WEATHER_NONE"></a>`WEATHER_NONE` | `number` | `0` | Weather.kind: clear. |
|
|
603
|
+
| <a id="const-WEATHER_RAIN"></a>`WEATHER_RAIN` | `number` | `1` | Weather.kind: rain streaks falling with the wind, the light dimmed and a grey distance fog. |
|
|
604
|
+
| <a id="const-WEATHER_SNOW"></a>`WEATHER_SNOW` | `number` | `2` | Weather.kind: flakes drifting down on gusts, a pale fog. |
|
|
605
|
+
| <a id="const-WEATHER_DUST"></a>`WEATHER_DUST` | `number` | `3` | Weather.kind: dust blowing along the wind near the ground, a warm thick fog. |
|
|
606
|
+
| <a id="const-WEATHER_MIST"></a>`WEATHER_MIST` | `number` | `4` | Weather.kind: no particles, a dense low height fog. |
|
|
607
|
+
|
|
608
|
+
```ogt
|
|
609
|
+
const WEATHER_NONE u32 0 "Weather.kind: clear."
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
<sub>`api.ogt` line 5225</sub>
|
|
613
|
+
|
|
614
|
+
```ogt
|
|
615
|
+
const WEATHER_RAIN u32 1 "Weather.kind: rain streaks falling with the wind, the light dimmed and a grey distance fog."
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
<sub>`api.ogt` line 5226</sub>
|
|
619
|
+
|
|
620
|
+
```ogt
|
|
621
|
+
const WEATHER_SNOW u32 2 "Weather.kind: flakes drifting down on gusts, a pale fog."
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
<sub>`api.ogt` line 5227</sub>
|
|
625
|
+
|
|
626
|
+
```ogt
|
|
627
|
+
const WEATHER_DUST u32 3 "Weather.kind: dust blowing along the wind near the ground, a warm thick fog."
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
<sub>`api.ogt` line 5228</sub>
|
|
631
|
+
|
|
632
|
+
```ogt
|
|
633
|
+
const WEATHER_MIST u32 4 "Weather.kind: no particles, a dense low height fog."
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
<sub>`api.ogt` line 5229</sub>
|