Commit Graph

54 Commits (ca043bac68f6fa4bf797108ff970e191d4a7ea2a)

Author SHA1 Message Date
EmaMaker 880c634be0 camera: set atomic position at startup
this avoids the first few chunk update loops recognizing the camera as being positioned at (0,0,0), which in turns avoids wastefully generating chunks out of view at startup
2023-10-03 22:08:40 +02:00
EmaMaker f526e9b152 create debug window with imgui 2023-09-20 12:42:05 +02:00
EmaMaker 3f61a6a753 renderer: screenshot by saving render texture to file 2023-09-20 12:37:32 +02:00
EmaMaker 00a4b8e1e2 renderer: properly handle framebuffer resizing 2023-09-20 12:37:32 +02:00
EmaMaker 4b723d58fa libs: import stb_image_write 2023-09-20 12:37:32 +02:00
EmaMaker 1c0ee1315f renderer: render scene to a texture
And then render the texture onto a quad that fills the screen
The screen-filled quad upon which the texture is rendered must never be rendered in wireframe. Rendering in wireframe only makes sense when rendering the world on the texture
2023-09-20 12:37:32 +02:00
EmaMaker 6670f3b41c shader: make geometry shader not mandatory 2023-09-20 12:37:32 +02:00
EmaMaker 1bea6c835c separate mesh and generation threads, with priority queues for input
Allows blockpicking while the world is generating, without hiccups
2023-07-30 12:17:51 +02:00
EmaMaker 381cd698c7 Initial tree generation
Still very slow because multiple noise evaluations are needed
2023-07-30 12:16:32 +02:00
EmaMaker 950c43b163 refactor chunk meshing routine 2023-07-19 12:56:55 +02:00
EmaMaker ea036f403c shader.hpp: add geometry shader support 2023-07-19 12:41:44 +02:00
EmaMaker bff9e6ad4f move normal data to own array 2023-07-18 21:18:12 +02:00
EmaMaker a7b4671517 toggle wireframe with F 2023-07-18 20:12:25 +02:00
EmaMaker f798575cac chunkmanager: add function getBlockAtPos, returns block at world pos
Returns Block::NULLBLK only to signal an invalid position
2023-06-01 21:31:18 +02:00
EmaMaker 105fff0029 write number of triangles to Chunk only when sending to GPU
previously the current number of vertices was stored in the chunk, and the same variable got later reused for the number of triangles. This modification increases clarity and avoid glitches when blockpicking
2023-05-26 23:07:04 +02:00
EmaMaker 2f9b7cebcd chunk: make chunk size 32
slight increase in fps with no great increase in ram usage, with greater render distance
2023-05-20 22:15:32 +02:00
EmaMaker e225babb0c chunkmesher: external queue of chunk mesh data
instead of every chunk having its own queue

This decreases usage of ram
2023-05-20 22:15:32 +02:00
EmaMaker 78e3bc11e6 initial update and render with concurrent DS 2023-05-20 22:15:15 +02:00
EmaMaker 52537715ef chunks: make chunk state atomic 2023-04-23 16:28:36 +02:00
EmaMaker 47543c9101 intervalmap: use updated upper_bound when checking removal of next node 2023-04-10 00:30:28 +02:00
EmaMaker 1a4412c5b1 renderer: initial texture support via ArrayTextures
totally stolen textures from minecraft
2023-04-10 00:30:28 +02:00
EmaMaker 2b1991ff2b separate rendering in a dedicated file 2023-04-10 00:30:24 +02:00
EmaMaker 6bd3bdecb8 shader: allow to send vec3 uniforms 2023-03-27 21:10:45 +02:00
EmaMaker b4dd3be584 chunkmesher: push vertices normals to GPU 2023-03-27 21:10:38 +02:00
EmaMaker da6608c66a chunkmanager: only calculate update sphere indices at startup 2023-03-25 16:32:01 +01:00
EmaMaker 8584d2e974 general code cleanup 2023-03-25 16:28:12 +01:00
EmaMaker 19cd81b9fb chunkmesher/manager: move sending data to gpu in dedicated function 2023-03-23 16:19:25 +01:00
EmaMaker 19b3c68015 camera: nearer near clipping plane 2023-03-23 14:26:12 +01:00
EmaMaker e609f4858b initial blockpicking 2023-03-23 14:25:34 +01:00
EmaMaker e18a2cca05 intervalmap: solve bugs with insertion, printing and retrival 2023-03-21 22:15:46 +01:00
EmaMaker 8040868055 chunkmanager: unload chunks after a time treshold 2023-03-13 13:33:32 +01:00
EmaMaker f3d89a2e5a chunk release resources on destruction 2023-03-12 22:14:28 +01:00
EmaMaker ddd047e82f interval map: clean map on destruction 2023-03-12 22:14:05 +01:00
EmaMaker f7eb04a5f1 use unique_ptr when dumping intervalmap to array 2023-03-12 19:24:09 +01:00
EmaMaker 383fb60686 proper frustum culling 2023-03-12 19:24:05 +01:00
EmaMaker e69c58abd3 gracefully shut down secondary threads 2023-03-12 12:43:41 +01:00
EmaMaker 716056b8c5 experimental multithreaded generation and meshing 2023-03-03 21:33:11 +01:00
EmaMaker b1e420f564 camera: allow to strafe up and down 2023-02-23 19:07:17 +01:00
EmaMaker 0baa2eb649 memory: use proper delete[] 2023-02-22 21:54:15 +01:00
EmaMaker c547d11cd5 chunks: drop per-chunk chunkmesh
Use a single mesher. This, on top of the previous commits, shaves off another 20MB of total RAM usage, using a total of about 120MB for a standard world (16 chunk size, 8 render distance), of which 22 in heap
2023-02-12 14:36:59 +01:00
EmaMaker 9f82a17bd2 chunkmesh: do not create shader for every object 2023-02-12 12:18:30 +01:00
EmaMaker 2e0ed7b057 clear mesh data after sending to gpu 2023-02-11 22:26:34 +01:00
emamaker 1ccbf8b157 rudimentary frustum culling
TODO: maybe manually extract planes and check against those
2022-12-01 23:45:05 +01:00
EmaMaker 8116791dcf use hilbert curve instead of flatten array
Using valgrind heap memory tracker, this does not seem to bring any advantage on heap memory usage. To be tested more in depth
2022-12-01 23:44:47 +01:00
EmaMaker b724640384 chunkgen: take advantage of intervalmap structure
brings down heap memory usage to about 67% of that using arrays (valgrind, tested on standard terrain with renderdistance at 8)
2022-12-01 23:44:03 +01:00
EmaMaker 8eb15f4725 chunk: migration to intervalmaps 2022-12-01 23:44:03 +01:00
EmaMaker 5dd924abf7 implement intervalmaps 2022-12-01 23:44:03 +01:00
emamaker 2418c481bd camera: wider and further view 2022-12-01 23:44:03 +01:00
emamaker 9b133181ba chunkmesh: cleanup 2022-12-01 23:44:03 +01:00
EmaMaker c8f429564c chunkmgr: properly dispose allocated chunk memory 2022-12-01 23:44:03 +01:00