This is the first in a series of articles detailing a personal project where I build a simple 3D renderer that can render assets stored in the glTF format.
Goals
I want to use this project as an opportunity to learn about and work with a number of technologies that I haven’t had a chance to use much in the past.
- Build Something in Rust: Rust is a systems programming language that aims to prevent common runtime bugs related to memory usage that appear in other systems languages like C and C++. This is accomplished through the use of the borrow checker, a feature of the compiler that validates the memory safety of the programming as it is built. I’ve played around with Rust some in the past but I haven’t had the chance to use it to build something of notable complexity so I’ll be using this project as an excuse to experiment with the language in more depth. You can read more about Rust in the official book.
- The Official Rust Book: https://doc.rust-lang.org/book/
- Learn about 3D Rendering: 3D rendering is just cool. Full stop. This is an area of computing that I’ve always been fascinated by but have never had the chance to explore beyond basic tutorials. 3D rendering is a huge topic and there are many resources available for learning about it. Linked below are some that I’ll be using during this project.
- Learn OpenGL: https://learnopengl.com/
- Vulkan Tutorial: https://vulkan-tutorial.com/
Technology
In order to accomplish the goals listed above I will be utilizing several libraries and standards.
- wgpu: This is a Rust library designed around the WebGPU API. The WebGPU API seeks to provide an efficient graphics API for software running in the browser and was created to supersede the WebGL standard. It’s worth noting that while wgpu is based on the WebGPU API it is capable of targeting all major 3D graphics APIs. Initially I’ll be making use of this to target Vulkan on my local Linux machine while I build out the renderer. Later I will make the necessary modifications to allow the renderer to be built for the browser as well. Since I’ll be writing this in Rust the browser version of the application will be compiled to WebAssembly, also known as WASM. You can read more about wgpu, WebGPU, and WASM in the links below.
- Learn wgpu: https://sotrh.github.io/learn-wgpu/
- WebGPU Fundamentals: https://webgpufundamentals.org/
- Official WebAssembly Website: https://webassembly.org/
- glTF: This is an open standard for defining 3D assets that is maintained by The Khronos Group. I chose glTF as the asset format for the renderer because it is highly flexible and supports a number of 3D rendering concepts such as geometry, textures, physical based rendering (PBR), animations, and more. You can read more about glTF at the link below.
- glTF Specification: https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html
Closing Thoughts
So that concludes a basic overview of the project. I’ll be uploading new articles as I make progress so stick around for more on this.