feat(terrain): renderoni/terrain — tiled heightfield cache and streamed LOD mesh - #40
Open
cmaycumber wants to merge 1 commit into
Open
cmaycumber wants to merge 1 commit into
cmaycumber wants to merge 1 commit into
Conversation
…ed LOD terrain mesh TiledHeightfield caches a caller's analytic height function in lazily filled, LRU-evicted tiles (bilinear heightAt, slopeAt with a tile-free coarse mode, prewarm, extra cached channels). Tiles are a pure function of the sampler so evictions rebuild bit-identically. TerrainMesh streams chunked, distance-LOD three.js terrain with skirts, a per-update build budget, unloading, any material, per-vertex attribute callbacks, and ray picking with an analytic raymarch fallback. TileCache and Buckets are exported on their own. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A new
renderoni/terrainentry point for large procedural worlds, extracted from a shipping game.TiledHeightfield: caches a caller's analytic height function in lazily filled, LRU-evicted tiles. Subclass it and overrideanalytic(and optionallysampleExtrafor extra cached channels). It provides bilinearheightAt,slopeAtwith a tile-free coarse mode,prewarm,channel()and stats. Tiles are a pure function of the sampler, so an evicted tile rebuilds bit-identically, which keeps determinism.TerrainMesh: streamed, chunked, distance-LOD three.js terrain over anyHeightSource. It has skirts against cracks, a per-update build budget, unloading, any material, and aTerrainShadingcallback for per-vertex attributes (colour, texture-layer weights). Picking uses loaded chunks with an analytic raymarch fallback (floor and ceiling options for water).TileCacheandBuckets: exported for reuse.This is presentation and caching only; it never writes simulation state. The game's own renderer now runs on
TerrainMesh, and its chunk geometry was checked value by value against the original implementation at every LOD.Verification: typecheck, build, 243/243 tests.
🤖 Generated with Claude Code