This project has been deleted.

Voxel Tools Bevy

Voxel Tools Bevy Used AI

23 devlogs
192h 33m
Created by Raphael Larsen

Some voxel tools for Bevy Engine.

Repository

Timeline

I ran into another problem and I've refined my setup some more. wgpu the graphics crate doesnt nativly support draw_id which I need. I tried to find some ways around it but I didnt find anything. I started making a barebones version because I kept getting caught up in many changes happening at once.

Update attachment

I've like figured out maybe how to setup a custom pipeline and stuff, but its super confusing.

Update attachment

Whoops. I went way over. Anyway I have learned that my last solution wouldnt work and have been working on a new solution that properly syncs between the Main and Render worlds.

Update attachment

I'm trying to write more devlogs.

I've made the freelist generics like WAY cleaner by simply separating concerns. I've also set it up so I allocate a single chunk as a single allocation instead of one allocation per axis. This reduces the load on the cpu by 6 as well as making sure data is next to itself on the buffer.

Update attachment

I setup the buffer to allocate more memory on the gpu when it runs out of space. Still havent figured out how to put it into the rendering pipeline.

Update attachment

So basically the next step was to setup a gpu buffer to use the the allocator, but I kept procrastinating by making my math crate and freelist crate prettier. I did get stuff done with a structure for interfacing with the gpu buffer, I just really dont want to figure out how to insert it into the rendering pipeline.

Update attachment

I've been trying to copy a video online about a fast voxel engine. I'm unfamiliar with graphics but I have a plan. Either way I was making a simple allocator to help out with interfacing, which is pretty fun.

Update attachment

I finished the mesher now Im reworking the block library. Its sorta been a mess me working on many things at once and not really finishing anything difinitivly.

Update attachment

I've still been working on meshing as well as revamping jsut everything. I've been trying to make it super idiomatic for rust.

Update attachment

I finished the block_library and saw another engine using binary greedy meshing, which I started cloning.

Update attachment

I compeltely forgot about logging. Anyways I've been working on a way to fix the weird uv problems by using a texture array

Update attachment

I finally figured out the bug (more of a PEBKAC error) which I could've fixed if I read the docs better. I got some jank working, still not entierly sure whats happening though.

Update attachment

So I have a framework for the block library thats theoretically done, it should now properly lookup attributes from the block library, however i'm unable to load the block library for some reason.

Update attachment

So after I setup the basic thing I started setting up an external blocklibrary asset so that I could map voxels to textures and materials without baking it into the binary. But I'm been having a ton of trouble actually using the blocklibrary. At first I had threading issues because bevys assets arent nativly threadsafe. Now I'm trying to figure out how to map the textures and materials to Meshes.

Update attachment

I did a bunch of stuff integrated ndshape and block-mesh, and greatly simplified how chunks worked. I finally got a working prototype.

Update attachment

I started to setup baking visibility into the voxels to efficiently mesh, but it got really confusing with my current setup. I also started looking at some other voxel engines and I'm switching how a few things are setup to make this easier as well as using some external crates I didn't know existed.

Update attachment

I've switched back to linear arrays as a representation. I also managed to start rendering some basic chunks however I've started switching some of the systems to be more reliant on bevy.

Update attachment

I started octree representation of chunks and starting meshing.

Update attachment

I've finally finished pallet chunk and array chunk. It took like super long because I generified everything. It was super satisfying but if i'm going to finish i think I gotta code rough.
Heres all the stuff I did:
Voxel:
A wrapper around an id.

Space:
I define a global voxel position as a ChunkPos with a VoxelLocalPosition (bound from 0 to chunk length)
I defined some traits to help with VoxelLocalPosition, CyclicBoundInt, BoundInt, and Wrapper that provide methods to ensure that the internal value doesn't leave the bounds.

Chunk Storage:
VoxelLocalPosition -> flatarrayindex
ArrayChunk, just a array of voxels.
PalletChunk --
Pallet - A sorted array of Voxels
PackedIndices - A array of numbers that pack smaller numbers (indices pointing to Pallet) in them using the smallest number of bits.

You can see more info in the Repo.

Next im gonna define a volumetric object made of chunks that will eventually turn into the world/ other objects made of voxels.

Update attachment

I've finished the PalletChunk and ArrayChunk implimentation as well as chunk space.

Update attachment

I've finished the utils required for chunks. They are super polished. I have a rough structure for both flat chunks and for pallet chunks. You can see more commits in the repo.

Update attachment

I've made a number of changes however I haven't really finished any features. Notably I refined the bit_struct to have more methods to handle changing its internal data. I also am working on some other traits to help impliment a BoundInt that must be with a range: this is for local chunk coords which must be between 0 and 15.

Update attachment

I added a tool to store voxel pallets as a data efficient bit struct.
Anyway now I have to go actually create all the important systems instead of spending way too long optimizing.

Update attachment