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 for water's two layers, and the API stability page
yhhaeead65b07cb
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 568d994ed..7673a1729 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -19,7 +19,8 @@ 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.+- **Water is a body and a surface.** The water's own colour was lit by the ripples' normal, as a painted surface is, so every ripple had a dark far side and a sea was blotched with dark patches no real water has. It is two layers now, as Unreal's single-layer water is: the body is lit as light from under the surface, and the surface is a coat over it that mirrors by the ripples (a coat may now state its reflectance, `coat.z` in a shader's `SurfaceExt`; 0 stays a varnish's 0.04). `u_bodyShading` says how much the ripples still shade the colour (0.25; 1 is the old look), `u_reflectance` what the surface mirrors seen straight on.+- **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 three layers of a tiling normal map the engine makes from 96 waves at every heading, read with mips at sizes that share no multiple (so no one size's repeat shows) and scrolled downwind, as Unreal's water reads its normal maps, with gusts across them: slow patches where the wind ruffles the water and slicks where it does not. No lattice, nothing finer than a pixel, three texture reads where there were six waves. Every number of it is a material param: `u_rippleTile`, `u_rippleFineSize`, `u_rippleWideSize`, the three weights, `u_rippleTurn`, `u_rippleGusts`, `u_gustCalm`, `u_gustRuffle`, `u_gustSize`. `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/docs/astro/src/data/apiStability.generated.json b/docs/astro/src/data/apiStability.generated.jsonindex b315664bd..c9e2656d5 100644--- a/docs/astro/src/data/apiStability.generated.json+++ b/docs/astro/src/data/apiStability.generated.json@@ -3,10 +3,10 @@"counts": {"public": 115,"beta": 178,- "experimental": 3056,+ "experimental": 3057,"deprecated": 3},- "total": 3349,+ "total": 3350,"subsystems": [{"id": "mobile-controls",diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjsindex f97a49a8e..11f5561cd 100644--- a/tools/releaseNotes.mjs+++ b/tools/releaseNotes.mjs@@ -4536,6 +4536,8 @@ export const NOTED = {{"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."},+ "feat(water): water is a body and a surface, and its ripples do not repeat - the body's colour is lit as light from under the surface instead of darkening on the far side of every ripple, the surface is a coat of water's reflectance over it, the ripples are three layers of the map at sizes that share no multiple with gusts and slicks across them, and every number of it is a material param":+ {"note": "Water is a body and a surface."},"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."},};