Skip to content
nldkPublic

About

A scene editor for NRE, my Vulkan renderer.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

NSC

A small 3D scene editor built on the NRE Vulkan renderer, with a Dear ImGui interface. You place models from assets/ in a scene, then move, rotate and scale them with ImGuizmo gizmos. Scenes are saved as JSON .nsc files.

How this was made

I started NSC and wrote the basics myself. Most of the UI, finishing scene saving, the file dialogs and this README were done with AI (Claude Code).

Features

  • Create scene screen at startup and on File > New: choose the assets folder for a new scene (type a path or pick one with ...), or open a saved scene, which brings its own assets folder.
  • Models window: lists every .glb, .gltf and .obj file in the scene's assets folder. Click one to add an instance of it to the scene.
  • Instances window: select an instance to put a gizmo on it, switch between Move / Rotate / Scale and World / Local, and delete instances with the x button.
  • File menu: New, Open..., Save (Ctrl+S) and Save As..., using the system's own file dialogs (through xdg-desktop-portal on Linux).
  • The scene is saved when you close the window: to its own file, or to scene.nsc in its assets folder if it was never saved. Nothing is saved if you close on the Create scene screen.

Controls

Input Action
W A S D Move the camera
Space / L Shift Move up / down
L Ctrl (hold) Move faster
Tab Turn mouse-look on or off (locks the cursor)
Esc Release the cursor
Ctrl+S Save the scene

Requirements

CMake and a compiler are not enough on their own. You need:

  • CMake 4.3 or newer
  • GCC 15 or newer: NSC is C++26, and NRE uses #embed
  • git, plus internet access on the first configure (dependencies are downloaded then)
  • Vulkan 1.3+ headers and loader, and a Vulkan driver for your GPU
  • glslc (from shaderc or the Vulkan SDK) to compile the shaders
  • GLFW 3.4+, installed as a shared library
  • pkg-config, dbus-1, wayland-client and wayland-scanner (for the file dialogs on Linux)

On Arch Linux:

sudo pacman -S cmake gcc git pkgconf vulkan-headers vulkan-icd-loader shaderc glfw dbus wayland

You also need your GPU's Vulkan driver, such as vulkan-radeon, vulkan-intel or nvidia-utils.

To build without wayland-client and wayland-scanner, configure with -DNFD_WAYLAND=OFF.

These are fetched automatically by CMake and need no installing: NRE (and its own dependencies: vk-bootstrap, VulkanMemoryAllocator, glm, fastgltf, tinyobjloader, stb), Dear ImGui, ImGuizmo, nlohmann/json and nativefiledialog-extended.

Building

cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
./build/NSC

A Debug build turns on the Vulkan validation layers in the renderer.

The path of this repo's assets/ folder is compiled in as the Create scene screen's starting folder; any other folder can be chosen there.

Project layout

Path What it holds
main.cpp Startup, the main loop and shutdown
Scene.cpp / Scene.h The scene: models, instances, gizmos, UI, saving and loading
free_camera.cpp / .h The WASD + mouse-look camera
imgui_layer.cpp / .h Dear ImGui on top of NRE's window and Vulkan device
file_dialog.cpp / .h Native open and save dialogs
shaders/ GLSL shaders, compiled to SPIR-V at build time
assets/ Models and textures the editor can place

About

A scene editor for NRE, my Vulkan renderer.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages