I need to admit something.

I've been a part of this community since the very beginning. I'm the person that created this subreddit, and yet even after spending 14 years in the voxel game dev sphere, I still suck at voxel game development. You'd think I would have picked some of this stuff up. You'd think that I'd know all of the techniques inside and out. But honestly, there's even a lot of terminology that I don't even understand. I will be totally honest and say that I still have no clue what raymarching is. I don't know what cone tracing is. I had to implement 3D DDA from scratch with my own understanding of math because I couldn't wrap my head around the whitepaper.

I made this community in the hopes that I could learn more about voxel game development, but I'm still nowhere near as knowledgeable as many of the people in here.

I've made several voxel engines, but never finished any of them.

I don't know where I'm going with this post. I just feel really jaded about all the time and work that I put into improving my programming skill only to come to the conclusion that I'm really not even that good at programming. Barely better than an amateur. And I've been programming for nearly 18 years! Maybe it's just time that I give up on programming and move on to something else. Something that I can actually become skilled at. Because as much as I have felt in my heart that programming is the right thing for me, I just really am not good at it, and really don't seem to be able to get better at it.

reddit.com
u/foofnordbaz — 7 days ago

I've been programming for just shy of 18 years, and I'm terrible at programming.

Nearly 18 years across a dozen programming languages, hundreds of thousands of lines of code written, and I still suck at programming. Programming has been my entire life for almost all of that time. I fell in love with it instantly. But now, 18 years later, I'm still nowhere near as good as I thought I would be. I still suck at programming.

The most impressive thing that I've ever written was a voxel engine (or multiple, I should say). A couple raytracers, one of them CPU based that could render an 8K image in 1.2s. Somewhat impressive, I guess, but not really.

I feel like a complete and total failure, as if I've wasted my time all of these years not focusing hard enough. Not doing what it takes to really grind my skills. 18 years, and you'd think I would be an expert by now. But I'm not. I'm still an amateur. And it really depresses me. I don't know what to do, because I feel like I can never catch up to where I should be.

reddit.com
u/foofnordbaz — 7 days ago

Anyone working solo on a Rust project that could use some help?

I'm looking to just make some open source contributions on some Rust voxel projects. I don't want to make a contribution to a large project, I want to make a contribution to someone's personal project. If they're struggling with some particular problem, or something like that, I'd like to take a crack at it. I've been doing voxel game dev for a long time and have written a few voxel engines.

reddit.com
u/foofnordbaz — 24 days ago

Looking for friends to talk about Voxel engine development (particularly in Rust)

I was initially looking to see if anyone wanted to collaborate on the voxel engine that I wanted to develop because I thought it would be fun, but no one was interested, and people were even a little mean, so now I'm just looking for friends to talk about Voxel engine development.

I'll probably regret asking this on Reddit.

reddit.com
u/foofnordbaz — 1 month ago

Looking for FOSS collaborators on future Voxel Engine project in Rust.

I'm planning on starting a very big Voxel Engine project in Rust.

I currently own the voxel crate name on crates.io, so I would like to put the engine in that crate. Currently, it has my advanced voxel orientation library inside of it, but I would like to add a lot more stuff that would simplify the process of making voxel games/simulations in Rust.

I'll work on this project regardless if I can find collaborators, but I thought it would be interesting to find other people interested in contributing. I have some more stuff to finish, so this will likely be months out before the major work begins.

If you're interested, let me know and I'll send you a DM with my Discord username.

reddit.com
u/foofnordbaz — 1 month ago
▲ 17 r/rust

Looking for friends to talk about Rust

I've been spending so much time writing code, that I've neglected to acquire programming friends. Currently, I only have 4 programming friends that I rarely talk to. I'm hoping to find some (preferably experienced) Rust programmers. You don't have to be experienced in Rust, just programming experience while being a Rust programmer is enough. But it's not a requirement. I've been programming for almost 18 years, and 4.5 years in Rust, so I'd like to find friends that can actually understand the stuff that I'm talking about.

Lately I've been working on a Bash loadable-builtin FFI library that enables the easy creation of Bash loadable builtins so you can use native Rust in Bash. So if you have C experience as well, that would also be appreciated.

I particularly am interested in FOSS friends. I'm a full-time FOSS developer, so I'm very much interested in finding other people that spend a lot of time writing FOSS.

reddit.com
u/foofnordbaz — 1 month ago
▲ 22 r/rust

isit :: A compile time type checking library.

Previously, I had the code for this library in another one of my crates, but that crate was a little too general purpose, and I wanted to make a new crate that was focused entirely around the compile time assertions I had in my other crate. So this morning, I sat down and copied the code over into a new project, wrote all the documentation, and wrote a readme for the examples. I use these checks in almost all of my projects these days, and I think that other people will find them useful as well. It's best to look at the documentation and examples to understand the functionality.

(No LLM generated code in this project whatsoever, all hand written)

https://crates.io/crates/isit

Documentation: https://docs.rs/isit/latest/isit/

Repository: https://github.com/ErisianArchitect/isit

Please let me know if there's anything that you think I should add (or even something I should remove!).

reddit.com
u/foofnordbaz — 2 months ago
▲ 10 r/VoxelGameDev+1 crossposts

crates.io: https://crates.io/crates/voxel-orient

docs.rs: https://docs.rs/voxel-orient/0.1.0-indev/voxel_orient/

github: https://github.com/ErisianArchitect/voxel/tree/master/crates/voxel_orient

I've been working on this on and off for a pretty long time. I've verified the code to the best of my ability (I still have more verification to do). I wanted to give people an early look into my library so I can maybe get some feedback. There's not much documentation at the moment, and that's something that I'll need to work on, but I've tried to make the code as understandable as possible.

This library can be used to handle voxel orientations (rotations and axis inversion). There are 48 possible axis aligned orientations of a voxel (including axis inversion). There are what I call canonical orientations. Canonical orientations are orientations that are equivalent but have distinct representations. There are four canonical orientations per orientation. There are 192 possible representations of orientations. You have 24 rotations multiplied by 4 angles multiplied by 3 flip axes. This data is stored in a single byte.

Some Features:

  • Reorient/deorient an orientation.
  • Rotate/Unrotate a rotation/orientation
  • Perform local orient/deorient.
  • Rotate a face/axis/corner.
  • Cycle Rotations/Orientations
  • flip all 3 axes.
  • canonicalize orientations so that equivalent orientations have the same representation.
  • remap vertex coordinates and UV coordinates.
  • Determine where a face has been oriented to, or where it came from.
  • Iterate orientations.
  • Edit: Forgot to mention, basically the whole library is compile time compatible.

I added as many things as I can think of that would be useful for orientations. It's not finished.

This library was quite tedious to make because it works using lookup tables, which was quite a laborious data entry task. But after I did it by hand, I realized that I actually could have generated (not with LLMs, but with algorithms) the lookup tables with code. Nonetheless, I used generated (yet again, with algorithms!) data to verify much of my hand written data.

I haven't done the calculations, but these lookup tables are fairly costly in terms of memory. Kilobytes of memory, for sure. But it's worth it in my opinion for what this library is able to do. I've used this code in a previous voxel project almost 2 years ago for my voxel orientations.

I don't know if people will quite "get it", because this is somewhat uncharted territory in many ways. I would not be surprised if this is the most advanced voxel orientation library in existence.

Anyway, I hope someone can find it useful.

The source code is under MIT license, so you're free to do with it as you wish! I would love to see someone port my library to another language.

reddit.com
u/foofnordbaz — 2 months ago

A little over a year ago, I was writing a CPU based raytracer, and I was trying to eek as much performance out of the CPU so that I could go from executing the program to having a full 8k render in a little over a second.

One of the ways that I accomplished this had to do with how I precalculated my rays. You see, you can either calculate the ray at the moment of the raycast, or you can precalculate it and then perform a simple rotation on it.

For the precalculation step, what you want to do is have a grid to store your rays inside of for each pixel that you are tracing.

First, you will need to calculate a Vec2 multiplier. This is very easy to calculate. First you take the field of view in radians, and your screen size in pixels. You calculate the aspect ratio from the screen size aspect_ratio = screen_size.x / screen_size.y.

Next, you'll need to calculate the tan_fov_half value: tan_fov_half = (fov_rad * 0.5).tan()

Next, the asp_fov value: aspect_ratio * tan_fov_half. Now you will have your multiplier values.

multiplier = vec2(asp_fov, tan_fov_half).

Then you iterate through the grid, and calculate the NDC (normalized device coordinate) for each pixel. Once you have the ndc, the final calculation is dead simple:

let ndc: Vec2 = ...;
let multiplier: Vec2 = ...;
let m = ndc * multiplier;
let ray_dir = vec3(m.x, m.y, -1.0).normalize()

Now you've calculated the ray direction. The ray origin is the camera position.

All that's left to do is rotate the ray direction by the camera rotation, then use the camera position as the ray origin, and you have your accurate ray calculated. All without having to do extra calculations at the time of raycasting.

On my desktop, I can calculate 33 million ray directions in 20ms (multithreaded).

I hope that this will be helpful to someone that wants a fast way to precalculate their rays. This is a very fast and cheap option for recalculating your rays when the render target size changes. It can be done on the GPU without problem.

reddit.com
u/foofnordbaz — 2 months ago