Moonlight Interactive

/home

/devs

/tils

/about

Starting the Project

The hardest part of any project is knowing where and how to start. Sometimes it’s not very important when you’re just in the prototyping phase, but for this project I want to build a good, simple, performant foundation.

There is no name for this project. I have no idea about functionality or potential UI/UX (potentially nodes with a nice UI to keep it user-friendly). But I know it will be done in 3D, have some sort of raytracer / real-time renderer built in, and follow some game development techniques. I want it to be interactive, cross-platform, and easy to adapt to different UI frameworks on desktop like SwiftUI — or potentially web and WASM. I think about WASM in the back of my mind, but most likely this software will be desktop-based with some sort of remote multi-user editing and version control features. Still, I want to start small and simple.

Requirements #

So, taking all the above into consideration, here is a list of requirements:

  • Desktop high-performance 3D platform
  • Real-time rendering and simulation
  • Cross-platform
  • Remote multi-user editing
  • Version control
  • Node-based (potentially)

Stack #

To be able to achieve these, based on my personal experience and knowledge, I will start developing it using the tech stack below.

Language - C++ #

The core of the main application will be written in C++. Why? OK, I know there are a lot of opinions regarding the current state of C++, and people are trying to use Rust, Swift, Jai, Odin, etc. But…

C++ is still an industry standard when it comes to performance and graphics programming. Tons of frameworks and libraries out there are written in C or C++, which might help the development. Also, in the future, if the project is successful, it will be easier to hire a team. Plus, because I am a self-taught developer, I only know Java, Swift, and C++. And I enjoy C++ so far.

Graphics & Window #

As it is a graphics application, the only real option for window management is GLFW.

When it comes to graphics APIs — unfortunately, it’s a complete mess. All existing graphics APIs are not truly cross-platform, and some require a considerable amount of work upfront to get going. We have:

  • Vulkan – Almost cross-platform, has a wrapper (MoltenVK) to run on Mac
  • Metal – Mac-only, very nice API with excellent debugging tools built into Xcode
  • Direct3D – Windows-only; I know nothing about it
  • OpenGL – Fully cross-platform with good support, but deprecated
  • WebGPU – Browser-based, has C++ headers for cross-platform desktop development, still under development and not feature-complete compared to others

So, not much of a choice really! I need to start fast, be flexible, and stay cross-platform. For the prototype, I will go with OpenGL, as it has lots of information online, is still widely available and supported, and provides very good performance. But I have to make it modular — so in the future I’ll probably switch to Vulkan. I need to keep my graphics backend separate in my codebase.

So let’s settle on GLFW + OpenGL.

UI #

Unfortunately, the UI ecosystem for C++ is very poor. Most VFX companies are using Qt or PyQt, but after trying SwiftUI, I hate every UI framework out there — including web!

Example of SwiftUI
Example of SwiftUI, Apple’s cross-platform UI framework

The guys at JangaFX created a custom UI using Odin, and it looks very nice. From what I can tell, it is an immediate-mode UI system custom-written. And I think in the future, I just might have to do the same — but in C++.

EmberGen application UI
Screenshot of EmberGen UI developed by JangaFX using Odin.

For now, I don’t really need a UI, so I’ll stick with Dear ImGui as a debugging UI to keep me going.

Summary #

So I think this is all I really need to make a cool real-time 3D application for architects and designers:

  • C++
  • OpenGL + GLFW
  • Dear ImGui