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 depth
yhhe4cfb6bc9d85
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 8d3e65ef8..1b1f6b26d 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -35,6 +35,7 @@ published separately; it ships inside the editor.- **Water mirrors only what is there.** Over open sea with no ground behind it the water's reflection went black: the ray through the picture took a sky pixel for something it had met, and the sky is painted after that picture is taken. From above, the sea darkened along the edge of the terrain under it, a line across the water. And a ripple steep enough to send the ray down met the sea bed in the picture, undimmed by its water: white flecks all over a shallow sea. The copy of the scene's distances now marks where the picture holds nothing, a ray sent down goes on up as off the next wave, and waves finer than a pixel widen the sun's highlight instead of flashing pixel by pixel. The ray's step and the thickness of what it meets are shares of the distance to the water, where they were a number of units (a centimetre in one project, a metre in another).- **A mesh shader's eighth texture finds a unit.** A material's textures past the seventh take an engine unit the shader never reads. A shader that named `u_textures` at all was counted as reading all eight batch units, though a mesh shader reads only its base texture, `u_textures[0]`: so anything built on Model had seven textures and no more. Ground Blend has eight, lost the last (the wet-ground map), and did not compile on WebGPU (`unresolved value 'u_wetMask'`); voxel ground had dropped its wet map to stay under. A literal index now counts as that one unit, so a Lit mesh shader has eight, Ground Blend draws on WebGPU, and voxel ground is wet where the weather says, as other ground is.- **A Foliage field of any size is cut into cells no wider than its cell size.** An area was cut into at most 200 cells a side. Past that each cell was left wider than `cellSize`, and its plants were still scattered over `cellSize` of it: a field over a six-kilometre terrain grew in clumps 12 m across with 19 m of bare ground between. The cap dated from when every cell was made at once; cells are grown round the eye now, so it is gone, and a field of any size is covered.+- **Water is as deep as it is, not as far as the eye's line through it.** The water a pixel's light had crossed was measured along the eye's straight line to the bed. Seen low across the sea that line is ten or twenty times the depth, so shallows turned deep and blue a short way out and a lagoon was only turquoise from above. Light bends down as it enters water and is never more than 49 degrees off straight down in it: the path is now the depth over that slope, at most half as long again as the depth. The bed is also dimmed by the water its light came down through (`u_bedShade`, 1; 0 is the old look, lit as if dry), and how soon the water's own colour turns from shallow to deep is `u_deepening` (0.5 of the density, what was fixed before). A scene's shallows will read clearer from low angles and a little darker from above.- **A 16-bit heightmap keeps its depth and size in a build.** A texture is capped at its Max Size (2048 unless set) when a build cooks it, and the cap decodes a PNG to 8 bits a channel on the way. A `Terrain` heightmap of 4096 samples and 16 bits therefore shipped as 2048 samples of 256 steps: the exported ground was terraced and coarser than the same ground in the editor, which reads the file itself, and nothing said so. See Use, above; a PNG of 16 bits that is still marked Colour ships byte for byte and the build says so.## [0.103.0] - 2026-11-12diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjsindex 2dd689e0e..847fb3aeb 100644--- a/tools/releaseNotes.mjs+++ b/tools/releaseNotes.mjs@@ -4554,6 +4554,8 @@ export const NOTED = {{"note": "A Foliage field has its own material instance, grass that widens as it thins, and a palette."},"feat(terrain): a baked occlusion over the ground - Terrain.occlusionMap is an image whose red says how much of the sky reaches the ground, for the gullies and cliff feet no screen-space pass sees across; it dims the light from all round and leaves the sun's to the shadows":{"note": "A baked occlusion over the ground."},+ "fix(water): water is as deep as it is, not as far as the eye's line through it - the light a pixel shows crossed the depth under it at the slope light takes in water, where the straight line to the bed made any sea seen low across it deep and blue; the bed is dimmed by the water its light came down through too, and how soon the water's colour deepens is a param":+ {"note": "Water is as deep as it is, not as far as the eye's line through it."},"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."},};