Skip to content

3.25.0

Latest

Choose a tag to compare

@kraifpatrik kraifpatrik released this 27 May 22:04

This release brings terrain optimizations, faster build times, and the ability to build chunks on the fly.

Changelog:

Terrain

  • Added new struct BBMOD_TerrainInfo for configuring a BBMOD_Terrain at construction time. Every public property of BBMOD_Terrain has a corresponding field in BBMOD_TerrainInfo with a sensible default.
  • The constructor of BBMOD_Terrain now accepts an optional BBMOD_TerrainInfo as its argument. Positional _heightmap, _subimage, and _chunkSize arguments are still supported for backward compatibility.
  • Added new properties EnableLazyBuild, LazyBuildBudget, LazyBuildInterval, and LazyBuildForceReflectionCapture to struct BBMOD_Terrain for controlling lazy chunk build scheduling and per-frame time budgets.
  • Missing terrain chunks within the visible range are now built lazily during submission in nearest-first order, respecting the configured frame interval and time budget.
  • Added new methods reset_build_profiler() and get_build_profiler() to struct BBMOD_Terrain for measuring per-chunk build time broken down by stage (smooth normals, vertex data, freeze, and bounds).
  • Methods build_normals([_chunkI[, _chunkJ]]) and build_smooth_normals([_chunkI[, _chunkJ]]) of struct BBMOD_Terrain now accept optional chunk coordinates to rebuild only a specific chunk instead of the whole terrain. Results are cached per-chunk and reused on subsequent calls.
  • Added new method get_smooth_normal(_x, _y) to struct BBMOD_Terrain, which returns the bilinearly interpolated smooth normal at a world-space coordinate.
  • Method get_normal(_x, _y) of struct BBMOD_Terrain now computes the face normal analytically using terrain scale and returns a properly normalized world-space vector.
  • Terrain chunk meshes are now generated as triangle strips instead of triangle lists, reducing vertex count and eliminating per-vertex temporary struct allocations during chunk builds.
  • Struct BBMOD_Terrain now correctly invalidates all cached chunk data when height or smoothing is modified, and disposes lazy-build resources on destroy().
  • Method smooth_height([_range]) of struct BBMOD_Terrain now accepts an optional _range argument controlling the averaging kernel radius, and invalidates chunk caches after smoothing.
  • Optimized chunk bounding sphere computation in build_chunk() of struct BBMOD_Terrain to use built-in grid min/max queries instead of a manual per-vertex loop.