A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
chore(gates): the note and the API surface for the water's eight waves
yhhe65574e39f79
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f7b8842c5..568d994ed 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -18,6 +18,7 @@ published separately; it ships inside the editor.- **A texture says whether it is a picture or numbers.** Import settings have a **Use**: Colour, or Data for an image read a number a texel (a heightmap, a mask of measured values, a lookup table). A build treats Data as what it is: never compressed, never decoded as sRGB or filled, kept at its depth, and at its own size unless Max Size (which now offers Source size) says otherwise, in which case it is resampled at 16 bits and not through 8. Nobody has to know to set it: a PNG of 16 bits a sample is imported as Data from the editor and the CLI alike, a texture put in a `Terrain`'s heightmap or splatmap is marked Data there and then (a splatmap cooked as a picture had its weights overwritten wherever the fourth was 0, and the ground fell back to grass everywhere), and Project Health lists textures a component reads as numbers that are still set up as pictures, with the fix on the row.- **An ocean reaches the horizon.** The sea's surface is rings of mesh round the camera, and it ended where they did: from a hill, or with a small `cells` and `rings`, a straight edge with nothing past it. A flat apron now carries it on to 80 km, at the cost of one row of quads.+- **A sea is eight waves spread about the wind.** Water's waves were four peaked sines, the longest far taller than the rest, and from any height the sea read as regular curved bands. The set is now eight: the first heads with the wind, each after it is 0.78 of the length before, nearly as steep, and off the wind by a golden-ratio step within 65 degrees, each at the speed its length gives deep water. Their heights add up to what the four's did, so `waveHeight` raises a crest as high as before and nothing built on the old bound moves. `Waters.sample`, `Floating` and the drawn surface still share one formula: the shader's waves are now written out from the table in `water/waves.ts` (`WAVE_SET`) when its source is assembled, where the same numbers were kept by hand in five places. A quality level's `waterWaves` is 3 / 5 / 8 (was 2 / 3 / 4), longest first. A scene tuned against the old four will look different: the same height spread over more, smaller waves.- **The wind's ripples are a map of many waves.** The small ripples on water were six straight wave trains summed in the shader. Low across the water the short ones faded and the two longest crossed in a regular board of dark spots. They are now two fields of a tiling normal map the engine makes from 96 waves at every heading, read with mips and scrolled downwind, as Unreal's water reads its normal maps: no lattice, nothing finer than a pixel, and two texture reads where there were six waves. `u_rippleStrength`, `u_rippleLength`, the wind's direction and speed mean what they did. The map is `default(ripples)`, a built-in a shader of your own can name; water's `u_detailMap` defaults to it, so a material that sets its own detail map gets its ripples from that map.- **A shader param's range is where its slider runs.** `range(min,max)` on a `#pragma param` set the slider in the material inspector and also clamped the number typed beside it, so a value the shader's author had not thought of could not be entered. The range is now the slider's reach only, as a UI range is in Unreal: the box takes any number, and the thumb rests at the end of the track.- **One setting says what a unit is, for materials too.** A shader param declares `unit(length)` or `unit(perLength)` and its default and range follow the project's Units per Metre, as a component's lengths and a post-process effect's already did; the inspector shows the project's numbers. The water was the reason: its shader, `WaterBody`, `WaterZone` and the sky's World Units per km held their defaults in metres while the engine's reference is centimetres, so stock water in a default project was a hundredth of its size and a scene in metres copied from one in centimetres drew clear water. They are now written once, at the reference, and are the same water in either. **A scene that relied on the old defaults in a centimetre project** (a `WaterBody` or `WaterZone` field left unset, a Water material with unset lengths, clouds with World Units per km unset) draws them a hundred times larger than before, which is what they were meant to be; state the values, or set Units per Metre to 1 if the scene is in metres.diff --git a/sdk/etc/index.api.md b/sdk/etc/index.api.mdindex bc44fb1af..a0deb1c67 100644--- a/sdk/etc/index.api.md+++ b/sdk/etc/index.api.md@@ -1,7 +1,7 @@# API surface — esengine/index<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->-Symbols: 115 public · 166 beta · 2167 experimental · 3 deprecated+Symbols: 115 public · 166 beta · 2168 experimental · 3 deprecated## ABI_LAYOUT_HASH — const @experimental```@@ -6183,6 +6183,11 @@ Restart = 13```+## MOST_WATER_WAVES — const @experimental+```+8+```+## ManifestModel — class @experimental```allAssets: () => AddressableManifestAsset[]diff --git a/sdk/etc/index.native.api.md b/sdk/etc/index.native.api.mdindex 8cbe42675..28719a198 100644--- a/sdk/etc/index.native.api.md+++ b/sdk/etc/index.native.api.md@@ -1,7 +1,7 @@# API surface — esengine/index.native<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->-Symbols: 115 public · 171 beta · 2187 experimental · 3 deprecated+Symbols: 115 public · 171 beta · 2188 experimental · 3 deprecated## ABI_LAYOUT_HASH — const @experimental```@@ -6191,6 +6191,11 @@ Restart = 13```+## MOST_WATER_WAVES — const @experimental+```+8+```+## ManifestModel — class @experimental```allAssets: () => AddressableManifestAsset[]diff --git a/sdk/etc/index.node.api.md b/sdk/etc/index.node.api.mdindex 4bc6e389d..081c9604b 100644--- a/sdk/etc/index.node.api.md+++ b/sdk/etc/index.node.api.md@@ -1,7 +1,7 @@# API surface — esengine/index.node<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->-Symbols: 115 public · 168 beta · 2166 experimental · 3 deprecated+Symbols: 115 public · 168 beta · 2167 experimental · 3 deprecated## ANCHOR_AXES — const @experimental```@@ -6178,6 +6178,11 @@ Restart = 13```+## MOST_WATER_WAVES — const @experimental+```+8+```+## ManifestModel — class @experimental```allAssets: () => AddressableManifestAsset[]diff --git a/sdk/etc/minigame.api.md b/sdk/etc/minigame.api.mdindex 00b7f1eba..90651f0a5 100644--- a/sdk/etc/minigame.api.md+++ b/sdk/etc/minigame.api.md@@ -1,7 +1,7 @@# API surface — esengine/minigame<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->-Symbols: 115 public · 166 beta · 2188 experimental · 3 deprecated+Symbols: 115 public · 166 beta · 2189 experimental · 3 deprecated## ANCHOR_AXES — const @experimental```@@ -6178,6 +6178,11 @@ Restart = 13```+## MOST_WATER_WAVES — const @experimental+```+8+```+## ManifestModel — class @experimental```allAssets: () => AddressableManifestAsset[]diff --git a/sdk/etc/wechat.api.md b/sdk/etc/wechat.api.mdindex b8ac52129..d7d8a2b99 100644--- a/sdk/etc/wechat.api.md+++ b/sdk/etc/wechat.api.md@@ -1,7 +1,7 @@# API surface — esengine/wechat<!-- Generated by tools/api-surface.mjs — do not edit. Run --update to accept changes. -->-Symbols: 115 public · 166 beta · 2179 experimental · 3 deprecated+Symbols: 115 public · 166 beta · 2180 experimental · 3 deprecated## ANCHOR_AXES — const @experimental```@@ -6185,6 +6185,11 @@ Restart = 13```+## MOST_WATER_WAVES — const @experimental+```+8+```+## ManifestModel — class @experimental```allAssets: () => AddressableManifestAsset[]diff --git a/sdk/src/water/waterShader.ts b/sdk/src/water/waterShader.tsindex cd1a837a0..84c5b9928 100644--- a/sdk/src/water/waterShader.ts+++ b/sdk/src/water/waterShader.ts@@ -137,7 +137,6 @@ const WATER = `#pragma shader "Water"#pragma vertexbounds 16#pragma vertexoffset-// The height of the waves at p: the same peaked sines the fragment takes its slope from, so the surface that is lit is the one that is drawn.// Where the waves are read for the true place p, bent by the given span (waves.ts: waveBend): crests of straight sines a few directions apart// add up to long parallel lines, a sea scored with strokes that turn with the wind. xy to read at; zw dx/dz and dz/dx, for a slope. One// sine an axis: this runs for every pixel of the water, and with a term more a phone paid 11 ms a frame for it.diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjsindex 6bdcf5fcb..f97a49a8e 100644--- a/tools/releaseNotes.mjs+++ b/tools/releaseNotes.mjs@@ -4532,6 +4532,10 @@ export const NOTED = {{"note": "A shader param's range is where its slider runs."},"feat(water): the wind's ripples are a map of many waves, not six - two fields of a built-in tiling normal map, default(ripples), read with mips, where six straight wave trains crossed in a board of dark spots once the short ones had faded":{"note": "The wind's ripples are a map of many waves."},+ "feat(water): a sea is eight waves spread about the wind, not four - each shorter and lower than the last at a heading of its own, so the swell no longer reads as bands; the shader's waves are written out from the one table the CPU sums, and a quality level allows 3, 5 or 8 of them":+ {"note": "A sea is eight waves spread about the wind."},+ "feat(water): the quality row and the checks know the water's eight waves":+ {"note": "A sea is eight waves spread about the wind."},"fix(terrain): a splatmap is numbers too - cooked as a picture its three weights were overwritten wherever the fourth was 0, and the whole ground was painted as grass; it is marked Data when it is set, as the heightmap is":{"note": "A texture says whether it is a picture or numbers."},};