Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion packages/melonjs/skills/melonjs-3d-assets/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,19 @@ or it renders flat. See `melonjs-3d` for the camera.
|---|---|---|
| `scale` | `1` | pixels per glTF unit, applied to the whole scene. Blender's metre-scale export usually needs 20–100. |
| `container` | `game.world` | where the nodes are added |
| `onLoaded` | `app.onLevelLoaded` | called with the **level id**, not the scene |
| `onLoaded` | `game.onLevelLoaded` | called with the **level id**, not the scene |
| `async` | `false` | return a promise that settles once the scene is in the world, instead of a boolean |
| `rightHanded` | `true` | see below |
| `lights` | `true` | instantiate authored `KHR_lights_punctual` lights as `Light3d` world children |
| `lightIntensityScale` | — | keep authored intensity ratios instead of normalising every light to 1 |

Those `game.` defaults are the engine's, not a recommendation. `game` is
whichever `Application` finished `init()` last, so **pass `container`
explicitly** from a `Stage`, where the right one is in your hand:

```js
level.load("sceneId", { container: this.app.world, scale: 40 });
```
| `castGroundShadow` | inherits the app setting (**on**) | blob shadows for this scene's meshes |
| `shadowGroundY` | each object's own base | world Y of the floor the blobs land on |
| `shadowOpacity` | `0.45` | how dark the blobs are |
Expand Down
8 changes: 4 additions & 4 deletions packages/melonjs/skills/melonjs-effects-and-shaders/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ bright pixels bleed into their neighbours — and it is the one to put on the
camera:

```js
game.viewport.addPostEffect(new BloomEffect(app.renderer));
app.viewport.addPostEffect(new BloomEffect(app.renderer));
// only the brightest highlights, with a wider halo
game.viewport.addPostEffect(
app.viewport.addPostEffect(
new BloomEffect(app.renderer, { threshold: 0.85, radius: 4 }),
);
```
Expand All @@ -154,8 +154,8 @@ reads as a white sticker. `exposure` lifts the image into the curve, and the
curve (`aces`, `reinhard` or `exponential`) is baked at construction:

```js
game.viewport.addPostEffect(new BloomEffect(app.renderer));
game.viewport.addPostEffect(
app.viewport.addPostEffect(new BloomEffect(app.renderer));
app.viewport.addPostEffect(
new ToneMappingEffect(app.renderer, { exposure: 1.6 }),
);
```
Expand Down
4 changes: 4 additions & 0 deletions packages/melonjs/skills/melonjs-tilemaps/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ also skip `src` and pass the map inline via `data` (with `format: "json"` or
`level <id> not found` for an unknown id — synchronously, in both forms, because
that is a typo rather than a load failure.

Those `game.` defaults are the engine's own, and `game` is whichever
`Application` finished `init()` last. **Pass `container` explicitly** from a
`Stage`, which has the right one: `level.load("map", { container: this.app.world })`.

**`level.load` is deferred while the game loop is running.** It calls
`state.stop()` and finishes the load on a timer, after the current frame, so by
default it returns `true` before anything is in the world. Two ways to sequence
Expand Down
Loading