o
odinpkg.dev
packages / library / vertex

vertex

33ad218library

Vulkan-based renderer.

MIT · updated 1 year ago

vertex

Vertex is a Vulkan-based renderer.

vertex.png

Features

  • Vulkan initialization and setup
  • GPU memory management using VulkanMemoryAllocator (VMA)
  • Shader compilation (vertex and fragment shaders)
  • Multithreaded, native, OBJ model loading.
  • Camera system.
  • Imgui integration
  • File and console-based logging
  • Profiling with Spall

Prerequisites

To build and run this project, you need:

Ensure that both Odin and Vulkan SDK are properly installed and their paths are set in your system's environment variables.

Project Structure

├── src\    # Odin source files
├── scripts\    # Build and compile scripts
│   ├── build.py
│   ├── compile.bat
│   └── compile.sh
├── assets\
│   ├── shaders\    # GLSL shader files
│   ├── models\    # .obj model files
│   └── textures\    # Texture files
├── bin\    # Output directory for compiled binary
└── external\    # External dependencies
    ├── odin-imgui\    # ImGui bindings for Odin (submodule)
    └── odin-vma\    # VulkanMemoryAllocator bindings for Odin (submodule)

Building and Running

  1. Clone the repository with submodules:
git clone --recursive https://github.com/dmcg310/vertex.git

If you have already cloned without --recursive, you can initialize submodules with:

git submodule update --init --recursive
  1. Install the required Python package:
pip install colorama ply
  1. Build ImGui (required at least once):
python3 scripts/build.py --rebuild-imgui --debug

Or

python3 scripts/build.py --rebuild-imgui --release
  1. For subsequent builds, run the build script without the ImGui flag:
python3 scripts/build.py --debug

Or

python3 scripts/build.py --release
  1. Optionally, run the build script with the profile flag to enable profiling:
python3 scripts/build.py --debug --profile

Or

python3 scripts/build.py --release --profile

Note: this will output trace_vertex.spall into bin/. This can be viewed by opening spall-web, then opening the file in the icon at the top left.

This script will initialize submodules, compile the shaders, build the Odin project in the specified mode (debug or release), and run the resulting binary.

References

License

This project is licensed under the MIT License. See the LICENSE file for details.