Repository navigation
fork release 6: r186 scattering-LUT kernel fix
Fork release 6 of @takram/three-atmosphere and @takram/three-geospatial. It is release 5 plus a fix that lets the atmosphere's scattering-LUT kernel compile correctly on stock three r186. It is not an upstream release, and it keeps the upstream package names so that one copy of each package resolves.
Base: fork/release-5 @ fc5605ed (release 3 plus the four-lane mask fd6804ba, lookupGroundLift 5ebaffb3 and the marker 775c670d).
Commits on top of release 5 (git log fork/release-5..fork/release-6):
c4f717acBuild the scattering texel radius once per scope (packages/atmosphere/src/webgpu/common.ts).37afce19fork release 6: version metadata and forkBuild marker.forkBuildis now{ release: 6, raySpheresIntersectionsLanes: 4, r186Kernels: true }.
What three r186 broke. three r186 changed ContextNode.setup() to return its child's build (mrdoob/three.js#34251, "ContextNode: Avoid redundant calls", f6080cc6). After that change, a plain TSL node that is read in an If, in its Else and again after the branch is declared as a var in one branch only, so the later read is an orphan. getParamsFromScatteringTextureCoord read one radius node in all three places. On stock 0.186.1, the scattering kernel's ScatteringParams(...) reads the radius var declared only in the Else, so every texel with coord.z < 0.5 gets radius 0. The fix builds the radius separately in each scope, which matches what r185 emits.
| Package | Version | SHA-256 |
|---|---|---|
| @takram/three-atmosphere | 0.19.1+fork.6 | 2847a6e02681846370bc3aef37fb6b9e6a74095dccb622539813a9ef7d63d351 |
| @takram/three-geospatial | 0.9.1+fork.6 | 7a5f33c1cda0073f836678c05eb5b8d63774848605efdce440b324eb55bae60c |
Atmosphere's build/webgpu.js SHA-256 is fb3ac44e565f896c0af5f7467e22bff89dbf1389b892e4ee8c6e17a68ccbe1f3; release 5's was e68b439d….
Evidence (CPU only). The four LUT kernels and ten render graphs were compiled to WGSL with a stub renderer:
- Stock three 0.185.1: all 14 shaders are byte-identical between release 5 and release 6. The scattering kernel is
876c66c9532e2a7a70351bf0d5d0788cefb0d5df4467fa63f6b6b15fb25d0fb1in both. - Stock three 0.186.1:
- The scan from the clouds port (PR #345) finds 1 orphan radius read in release 5 (
47192c81…, exit 1) and 0 in release 6 (4fd73d77…, exit 0, 2 sqrt vars checked). - Release 6's four kernels on 0.186.1 match 0.185.1 apart from blank lines and the version banner.
- The ten render graphs (sky, aerial perspective, the intersection functions, the TAA resolve, the lens-glare compute) did not change between releases, and r186 adds no orphan read to them.
- The scan from the clouds port (PR #345) finds 1 orphan radius read in release 5 (
- Fork gates at
37afce19: core and atmosphere lint, typecheck and test all exit 0. - Consumers (stock three 0.186.1 and 0.185.1, node 24.16.0, pnpm 11.8.0): install,
pnpm peers check, vite build, both webgpu imports (29 / 70 exports) and the built bundle all exit 0.
Releases 1 to 5 stay published.