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
fix(water): a gentle beach keeps less of the breakers' white than rock does
yhhe48690b34a67
diff --git a/sdk/src/water/waterShader.ts b/sdk/src/water/waterShader.tsindex a398a6c7f..1cae5aa1d 100644--- a/sdk/src/water/waterShader.ts+++ b/sdk/src/water/waterShader.ts@@ -705,7 +705,7 @@ void main() {}float onCrest = u_foamCrest > 0.0 ? smoothstep(1.0 - 0.3 * u_foamCrest, 1.0, crest) * smoothstep(0.35, 0.75, breakup) : 0.0;// A breaker whitens as much on a beach as the waves are big, but bursts whitest on rock.- float surfFoam = surf.y * smoothstep(0.15, 0.6, breakup + surf.y * 0.4) * mix(0.45, 1.0, zoneOn ? waterZoneSteep(wp) : 1.0);+ float surfFoam = surf.y * smoothstep(0.15, 0.6, breakup + surf.y * 0.4) * mix(0.2, 1.0, zoneOn ? waterZoneSteep(wp) : 1.0);float foam = clamp(max(max(max(shore, onCrest * u_foamCrest), ripFoam * (0.55 + 0.45 * breakup)), surfFoam), 0.0, 1.0);// Foam floats on top: from under the water it is a thin shadow on the light, not a white sheet.if (below) foam *= 0.2;@@ -1157,7 +1157,7 @@ fn waterSurface(p : vec2f, time : f32, dist : f32, amp : f32, calm : f32) -> vec// A breaker whitens as much on a beach as the waves are big, but bursts whitest on rock.var steepHere = 1.0;if (zoneOn) { steepHere = waterZoneSteep(wp); }- let surfFoam = surf.y * smoothstep(0.15, 0.6, breakup + surf.y * 0.4) * mix(0.45, 1.0, steepHere);+ let surfFoam = surf.y * smoothstep(0.15, 0.6, breakup + surf.y * 0.4) * mix(0.2, 1.0, steepHere);var foam = clamp(max(max(max(shore, onCrest * mc.u_foamCrest), ripFoam * (0.55 + 0.45 * breakup)), surfFoam), 0.0, 1.0);if (below) { foam = foam * 0.2; }diff --git a/tools/releaseNotes.mjs b/tools/releaseNotes.mjsindex 71020d604..a031b81c5 100644--- a/tools/releaseNotes.mjs+++ b/tools/releaseNotes.mjs@@ -2820,4 +2820,6 @@ export const NOTED = {{"internal":"Comment length only."},"feat(water): foam bursts on steep shores and washes thinly up beaches, by how steep the shore is and how exposed the water":{"note":"Foam is where waves burst, not along every shore."},+ "fix(water): a gentle beach keeps less of the breakers' white than rock does":+ {"note":"Foam is where waves burst, not along every shore."},};