Commit Graph

151 Commits

Author SHA1 Message Date
Jarrod Doyle 1098c418f1
Rename render module to gfx 2023-09-08 14:33:33 +01:00
Jarrod Doyle e3a00341bc
Rename currently unused brickgrid flags 2023-09-08 14:24:30 +01:00
Jarrod Doyle 404c7875bf
Increase brickmap parameters 2023-07-28 14:28:28 +01:00
Jarrod Doyle a91b48bf46
Move neighbour block getting into the brickmap culling function 2023-07-28 12:21:19 +01:00
Jarrod Doyle 7cdca0a406
Slight refactor to Chunk get_block and gen_block 2023-07-28 11:55:05 +01:00
Jarrod Doyle 081ce7ec77
Renamed chunk get_block pos argument to block_pos 2023-07-28 11:48:00 +01:00
Jarrod Doyle e1d621f573
Extract chunk block generation out to it's own function 2023-07-28 11:45:24 +01:00
Jarrod Doyle 42fdf48660
Consider neighbouring brickmaps when doing non-surface voxel culling 2023-07-28 11:03:32 +01:00
Jarrod Doyle ea84b43158
Fix surface voxel detection logic 2023-07-27 22:09:26 +01:00
Jarrod Doyle 34bcae4693
grid_pos_to_world_pos now handles negative grid positions 2023-07-27 21:34:38 +01:00
Jarrod Doyle 26f66813dd
Simplified brickmap grid_pos_to_world_pos 2023-07-27 21:14:52 +01:00
Jarrod Doyle ca7a894ff5
Make function perform more accurate to it's name 2023-07-27 21:04:31 +01:00
Jarrod Doyle e7eda73d98
Increase max buffer size 2023-07-27 19:12:24 +01:00
Jarrod Doyle 997de994e5
Make upload and feedback buffer max counts parameterised 2023-07-27 19:07:52 +01:00
Jarrod Doyle 1cdabc0854
Make brickmap cache and shading table bucket sizes parameterised 2023-07-27 18:59:46 +01:00
Jarrod Doyle de0f845cb6
Added labels to all relevant WGPU constructs 2023-07-05 15:34:23 +01:00
Jarrod Doyle 8d74443e17
Display more realtime framerate in title 2023-07-05 14:34:24 +01:00
Jarrod Doyle 9d4223a1cc
Made unpack buffer size variable and increased the max element count to 512 2023-07-05 14:11:11 +01:00
Jarrod Doyle 5824bea07e
Remove old commented code 2023-07-05 14:02:41 +01:00
Jarrod Doyle d9697b0179
Begin using new GPU side brickgrid/map unpack shader 2023-07-05 14:01:53 +01:00
Jarrod Doyle 3ea0b58ec8
Inline unneccesary variables 2023-07-03 11:15:27 +01:00
Jarrod Doyle 374dd254b2
Cull interior voxels now creates the bitmask and albedo data itself 2023-07-03 11:11:23 +01:00
Jarrod Doyle 95788f3795
Add helper function for grid-world coordinate conversion 2023-07-03 11:09:27 +01:00
Jarrod Doyle b2b4942a59
Only request required part of feedback buffer rather than full range 2023-06-30 15:06:57 +01:00
Jarrod Doyle b163fa0177
Refactored CPU brickmap to make it easier to work on 2023-06-30 12:01:26 +01:00
Jarrod Doyle bb97a5036e
Make brickmap cache cyclic, unloading loaded maps when necessary. Fix crash when cache is full 2023-06-29 15:27:36 +01:00
Jarrod Doyle 5ccebf89cb
Fixed shading table deallocation bug 2023-06-29 15:24:46 +01:00
Jarrod Doyle d8ba20d06e
Remove unnecessary count parameter in bind layout uniform entries 2023-06-29 11:27:24 +01:00
Jarrod Doyle fdd4cbde9c
Remove unnecessary count parameter in bind layout storage entries 2023-06-29 11:26:11 +01:00
Jarrod Doyle 056c35a441
Add common generic entries to BindGroupLayoutBuilder 2023-06-29 10:56:51 +01:00
Jarrod Doyle c56fe7d69b
Reduced repitition in layout entry building 2023-06-29 10:49:21 +01:00
Jarrod Doyle 604f11a40f
Implement Default for CameraUniform 2023-06-27 20:38:30 +01:00
Jarrod Doyle 8470507391
Rename world_state.brickmap_cache_dims 2023-06-27 20:35:22 +01:00
Jarrod Doyle 5866d691f7
Restore 32^3 world chunk size 2023-06-27 20:32:08 +01:00
Jarrod Doyle c4107c61ea
GPU Brickgrid dimensions are now defined by the renderer 2023-06-27 20:31:44 +01:00
Jarrod Doyle 0e1b844f96
CPU Brickmap now requests the correct chunk 2023-06-27 20:24:26 +01:00
Jarrod Doyle 64ddcf7e10
Fix incorrect chunk noise offsets 2023-06-27 20:23:09 +01:00
Jarrod Doyle f57bf565e4
Allow for arbitrary world chunk sizes 2023-06-27 20:20:25 +01:00
Jarrod Doyle 27b61c624d
Implement clippy suggestions 2023-06-26 15:10:31 +01:00
Jarrod Doyle a29b4979ef
Simplify block gen code path when all corners are empty 2023-05-13 11:53:26 +01:00
Jarrod Doyle 2f99b0ea4e
Don't interpolate if all block corners are negative 2023-05-12 11:10:23 +01:00
Jarrod Doyle 2f3c214c98
Use new trilinear interpolation function for chunk block generation 2023-05-12 11:05:00 +01:00
Jarrod Doyle f3be07cbc4
Add block trilinear interpolation function 2023-05-12 11:02:28 +01:00
Jarrod Doyle dc205d24ef
Inline math functions, optimise trilerp 2023-05-09 20:09:32 +01:00
Jarrod Doyle 7e6746a8cd
Use new world generator 2023-05-09 17:33:46 +01:00
Jarrod Doyle 8a3b0ed4ea
Add simple world generator 2023-05-09 17:32:53 +01:00
Jarrod Doyle cd3fd9cd68
Add basic math module 2023-05-09 17:31:41 +01:00
Jarrod Doyle d5f6d73296
Basic FBM based terrain generation 2023-05-08 12:35:35 +01:00
Jarrod Doyle 3d8719275d
Correctly update brickgrid when brickmaps are empty 2023-05-06 12:43:40 +01:00
Jarrod Doyle 95dd469f7a
Don't skip generation of some chunks 2023-05-06 12:42:47 +01:00
Jarrod Doyle ed46752c92
Remove unnecessary reupload of entire brickmap buffers 2023-05-06 12:29:36 +01:00
Jarrod Doyle 4eaf55a61c
Remove unnecessary CPU side duplicate of the shading table 2023-05-06 12:28:22 +01:00
Jarrod Doyle 3896027ea9
Remove unused code/comments 2023-05-05 17:18:03 +01:00
Jarrod Doyle b1d012c05b
Remove pub from shading table bucket/allocator functions 2023-05-05 14:54:38 +01:00
Jarrod Doyle 3ab9bcb3a1
Correct GPU shading table size 2023-05-05 14:53:29 +01:00
Jarrod Doyle f3f10d5513
Use shading table allocator in brickmap 2023-05-05 14:49:07 +01:00
Jarrod Doyle e86af05a1f
Add shading table bucket allocator 2023-05-05 14:48:54 +01:00
Jarrod Doyle a4179fa307
Cull interior voxels from gpu brickmap upload 2023-05-05 10:47:08 +01:00
Jarrod Doyle 12cde87246
Adjust buffer sizes and add todo list 2023-05-04 16:27:15 +01:00
Jarrod Doyle 71d547cd62
Define device limits in App, and raise buffer size limits 2023-05-04 16:17:32 +01:00
Jarrod Doyle 6d9fc9b0b8
Use cache index to place shader table values 2023-05-04 16:16:04 +01:00
Jarrod Doyle 0625d2e264
Correctly calculate chunk index when processing the load queue 2023-05-04 16:14:54 +01:00
Jarrod Doyle 53ccebf4a6
Add brickmaps to the cache sequentially 2023-05-04 10:51:47 +01:00
Jarrod Doyle 66dfffd78b
Only upload modified parts of brickmap buffers 2023-05-03 15:10:18 +01:00
Jarrod Doyle af0ab3bb66
Add basic CPU to GPU streaming system 2023-05-03 14:44:42 +01:00
Jarrod Doyle 3fb089d392
Remove unnecessary New function from Brickmap uniform struct 2023-04-29 14:51:35 +01:00
Jarrod Doyle b51f0b42e2
Revert brickmap sphere colour changes 2023-04-29 14:50:59 +01:00
Jarrod Doyle 63e1fd94bd
Simple framerate logging 2023-04-29 10:30:49 +01:00
Jarrod Doyle 2555ec55b4
Start work on brickgrids 2023-04-25 13:54:33 +01:00
Jarrod Doyle 1823d8b52c
Add initial multi-brickmap support 2023-04-25 12:23:55 +01:00
Jarrod Doyle 225c76b1a8
Add a basic brickmap shading table 2023-04-24 19:34:19 +01:00
Jarrod Doyle 6be2dd8054
Begin using basic brickmap. Doesn't include shading table 2023-04-24 17:17:56 +01:00
Jarrod Doyle 5914efaea8
Remove unused code 2023-04-24 14:01:36 +01:00
Jarrod Doyle 249ab27777
Make Renderer a trait and implement it for VoxelRenderer 2023-04-24 13:52:38 +01:00
Jarrod Doyle a0df8d2bfc
Implement Debug for Texture and TextureBuilder 2023-04-24 13:50:22 +01:00
Jarrod Doyle 057d849e24
Make CameraController public 2023-04-24 13:47:59 +01:00
Jarrod Doyle 55b79f0b39
Fix voxel sphere offset 2023-04-24 09:49:07 +01:00
Jarrod Doyle 230024ac63
Move app and camera to core module 2023-04-24 09:28:33 +01:00
Jarrod Doyle a94932836f
Moved renderer to render module 2023-04-24 09:24:22 +01:00
Jarrod Doyle bbc43b53fd
Remove unused imports 2023-04-23 09:56:48 +01:00
Jarrod Doyle 4f8602c48e
Move camera out of renderer 2023-04-21 12:53:42 +01:00
Jarrod Doyle c6932e6646
Use bind group and bind group layout builders 2023-04-21 12:29:46 +01:00
Jarrod Doyle 20aeaa304d
Add bind group and bind group layout builders 2023-04-21 12:29:45 +01:00
Jarrod Doyle b73d9b8f2b
Clamp camera pitch between -85 and 85 degrees 2023-04-21 12:29:45 +01:00
Jarrod Doyle fddb07d51e
Move texture and context structures to new Render module 2023-04-18 21:57:28 +01:00
Jarrod Doyle 9554f3ba7f
Integrate camera system 2023-04-18 17:06:59 +01:00
Jarrod Doyle 1d26c78b3e
Add simple camera system 2023-04-18 17:06:33 +01:00
Jarrod Doyle 64b0c9d308
Added frame delta time calculation 2023-04-18 17:04:55 +01:00
Jarrod Doyle 892747d6c4
Begin using the voxel volume shader 2023-04-18 10:56:17 +01:00
Jarrod Doyle 7d29cdf86a
Texture views take dimension from texture dimension 2023-04-18 10:42:11 +01:00
Jarrod Doyle e13aab1808
Use the voxel raycast shader 2023-04-08 21:54:20 +01:00
Jarrod Doyle 2887a0a0af
Use compute shader to change texture 2023-04-08 21:54:20 +01:00
Jarrod Doyle 94ade95743
Add shader stage visibility and texture usage to TextureBuilder 2023-04-08 21:54:20 +01:00
Jarrod Doyle 9cf17a8066
Update shader and renderer to use a dummy render texture 2023-04-08 21:54:20 +01:00
Jarrod Doyle 34da4bf0fc
Add texture bind group generation 2023-04-08 21:54:19 +01:00
Jarrod Doyle b391d04a91
Add WGPU Texture wrapper 2023-04-08 21:54:19 +01:00
Jarrod Doyle a9e0547f5a
Rename AppWindow to App 2023-04-08 21:54:19 +01:00
Jarrod Doyle 3e001a930f
Use new RenderCtx and Renderer structs 2023-04-08 21:54:19 +01:00
Jarrod Doyle 6a9335089b
Create RenderContext and Renderer structs 2023-04-08 21:54:19 +01:00
Jarrod Doyle fa9b8dd855
Basic window creation 2023-04-08 21:54:18 +01:00