Marching Cubes devlog

About
Main page
Updated: 9/2024

Who

Ivan Ribeiro

https://github.com/IVSOP

What (TLDR)

I’m making a game with my own custom engine, and documenting the most interesting/useful things I’ve learned

I’m also going into it blind, never having used a game engine before

I will also share my opinions on the things I use

Why

I’ve always been interested in how games are made and how the engines work under the hood.

Recently I’ve done some small projects that enabled me to learn some of the required skills. I started by experimenting with C++ and OpenGL, learning completely on my own which brought me a lot of pain an suffering. I will never forget my first textured quad. Taking inspiration from this video, I made a particle simulator, which allowed me to learn some rendering concepts (like batching and instancing) and also get comfortable with some optimization techniques, like SIMD and spatial partitioning.

I then made an extremely naive implementation of a minecraft-like game, teaching me some 3D skills. It also made me realize how much goes into a 3D engine, and how performance intensive 3D graphics are when not optimized properly.

At university, I got to do a very simple 3D graphics engine, which pushed me to learn many more advanced concepts, like bloom, HDR and color correction, rendering models and bezier surfaces, texture buffers, framebuffers, blinn-phong lighting, and also learning the actual math behind all of these. I just used the 🐐 learnopengl for this.

Eventually I came accross videos on voxel engines like this, this and this, which were so impressive they re-sparked my interest for minecraft, and how I could make a better version of it.

Recently I’ve graduated in Software Engineering, and felt like I finally had the skills to (begin to) tackle this.

I actually managed to implement the concepts these videos talked about, like indirect rendering, many forms of culling, and even made my own binary greedy mesher (the one you find online is completely unreadable, so I made my own. I regret this, do not try it), which you can find here. Still, I just felt like something was missing. It wasn’t interesting enough, just shaping up to be another minecraft clone.

Some time ago I had seen some videos on an algorithm(?) called marching cubes. The name itself is interesting. How does a cube march?

After some head scratching, watching some videos and borrowing some code, I managed to get it to work, and I felt like I had the skills to keep going and make a full game out of it. It’s still minecraft-like voxels, but it no longer looks like a minecraft clone, and presents many different challenges.

Attribution

The monospace web https://github.com/owickstrom/the-monospace-web

I started with this as a template for the website, then expanded upon it heavily

License:

Copyright 2024 Oskar Wickström

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
highlight.js https://github.com/highlightjs/highlight.js

Used when generating the pages to highlight code blocks

License:

BSD 3-Clause License

Copyright (c) 2006, Ivan Sagalaev. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.