Commit Graph

21 Commits (e3dd39f21ab52094efd68191b1c6a8396b422095)

Author SHA1 Message Date
EmaMaker e3dd39f21a terrain gen: store noise values into a LUT
generation times went from 135uS to 35uS
2022-08-28 17:55:32 +02:00
EmaMaker a3e9786fcb terrain generation with noise
this method does not require a conversion from an array, instead can write directly to the interval map
2022-08-28 17:21:32 +02:00
EmaMaker b9e55f717b fix bugs with intervalmaps 2022-08-28 17:18:13 +02:00
EmaMaker cc68d3b434 refactor: make chunk states constants final 2022-08-23 21:08:47 +02:00
EmaMaker 9548841cc8 world gen: basic implementation of smooth terrain using opensimplexnoise 2022-08-23 21:06:59 +02:00
EmaMaker f9bee3d758 ship OpenSimplexNoise
many thanks https://gist.github.com/KdotJPG/b1270127455a94ac5d19
2022-08-23 21:06:00 +02:00
EmaMaker daf419ed40 little general refactor 2022-08-23 20:25:00 +02:00
EmaMaker be8cb056d3 experimental: use morton code to represent chunks
This avoids creating new objects (for vec3 or string) for each chunk, and just returns an int. For now, using 10bits is kind of limiting, and some other way of easily expressing ints longer than 32bits is needed
2022-08-23 11:57:07 +02:00
EmaMaker ad2c5c2c18 space-filling curves: use LUT instead of calculating indices on the fly 2022-08-23 11:21:50 +02:00
EmaMaker ed45ddc12a world update routine based on chunk states 2022-08-22 17:34:43 +02:00
EmaMaker 6ea3fbc8aa world benchmark 2022-08-22 17:34:43 +02:00
EmaMaker 3cb0a0529c use hilbert curve for better compression
space filling curves better preserve spatial locality compared to nested iteration
2022-08-22 17:34:43 +02:00
EmaMaker dd4732c1c1 only generate and mesh one chunk per loop cycle
add setup for voxel size

modeling/meshing needs optimization

switch to using a bitfield instead of queues
2022-08-22 17:34:25 +02:00
EmaMaker a96c09df4b try new approach based on interval maps
they resolve the problems and the redundancies of interval trees, while giving a serius memory usage benefit (20% of the one used by interval trees in test scene)

test scene is a world made of a cube of sides RENDER_DISTANCE*2 with player at the center
2022-08-16 21:45:26 +02:00
EmaMaker f8a31093cd chunkrenderer: generate only one mesh per chunk 2022-08-11 23:30:59 +02:00
EmaMaker 61838a93b2 chunk: handle setting blocks via Chunk
Instead of directly calling IntervalTree. This allows clamping indices to avoid out of bounds when converting to and from an array
2022-08-11 18:50:18 +02:00
EmaMaker 5bff4bc367 chunk: handle intervaltree<->array conversion 2022-08-11 16:34:12 +02:00
EmaMaker 9c6cf30120 intervaltree: support for single-unit intervals
The structure is still not perfect and needs revising in some edge cases where unneeded child nodes are left instead of being added in the parent
2022-08-11 16:05:56 +02:00
EmaMaker 83beccc48c chunkrenderer: greedy meshing like 0fps/roboleary
Also includes face culling to avoid rendering faces that are hidden by other blocks
2022-08-11 15:26:49 +02:00
EmaMaker 8fb2af285c chunk: change generation tests 2022-08-11 15:01:28 +02:00
EmaMaker 5dc4978f48 initial commit
working interval trees and stupid meshing
2022-08-08 23:37:16 +02:00