• Stars
    star
    126
  • Rank 284,543 (Top 6 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 5 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

3D game engine using C++20 and Vulkan (WIP)

Little Engine

A simple 3D game engine using C++20 and Vulkan.

Build Status

Demo video (running le-example)

little-engine.example.mp4

Features

  • PBR materials
  • HDR lighting
  • GLTF mesh importer
  • Skinned meshes and animations
  • Fonts and text
  • Dynamic rendering (Vulkan)
  • In-game UI
  • Dear ImGui
  • AABB collisions
  • Shadow mapping
  • Audio

Requirements

Runtime

  • OS with desktop environment and Vulkan loader (libvulkan1.so / vulkan1.dll)
    • Windows 10
    • Linux: X, Wayland (untested)
    • Mac OSX: untested, will require MoltenVk
  • GPU supporting Vulkan 1.3+, its driver, and loader

Development

  • CMake 3.23+
  • C++20 compiler and stdlib
  • OS with desktop environment and Vulkan loader (libvulkan1.so / vulkan1.dll)
    • Windows 10
    • Linux: X, Wayland (untested)
    • Mac OSX: untested, will require MoltenVk
  • GPU supporting Vulkan 1.3+, its driver, and loader
  • glslc for compiling glsl shaders to SPIR-V
  • (Optional) Vulkan SDK for validation layers (contains glslc)

Usage

LittleEngine (le::little-engine) is a library intended to be built from source and linked statically, it currently does not support any installation / packaging. Link to it via CMake: target_link_libraries(foo PRIVATE le::little-engine).

LittleEngine Scene (le::le-scene) is an optional wrapper that provides Entity, Component, Scene, Runtime, and other convenience facilities.

Default shaders are provided as GLSL sources in shaders/. (These can be compiled to SPIR-V into your data directory using LittleEngine's tools.)

See example for a basic example that renders an animated skinned mesh and some text, and responds to input. The demo video above showcases this very example.

Building

  • Clone this repository somewhere.
  • Use CMake and a generator of your choice to configure an out-of-source build (build and out are ignored in git).
  • If using CMake 3.20+ / Visual Studio in CMake mode / CMake Tools with VSCode, CMakePresets.json can be utilized (and/or extended via CMakeUserPresets.json) for convenience.
    • Use cmake --preset <name> to configure and cmake --build --preset <name> to build on the command line.
    • Visual Studio CMake and VS Code CMake Tools should pick up the presets by themselves.
  • For other scenarios, use CMake GUI or the command line to configure and generate a build.
    • Command line: cmake -S . -B out && cmake --build out.
    • If using an IDE generator, use CMake GUI to configure and generate a build, then open the project/solution in the IDE and build/debug as usual.

Tools

LittleEngine provides some basic tools separate from the engine for building data. There are two main aspects to building data:

Shaders

The engine expects shaders to be in SPIR-V binary format. Custom shaders can be used as long as the shader layouts are compatible, and custom descriptor sets are updated every frame, if any. The engine uses a single global pipeline layout and buffered descriptor sets per camera and per render object.

Meshes

The engine uses custom formats for materials, animations, skeletons, and meshes. GLTF support is built-in, and meshes from such assets can be imported using le::importer. Contributions for importing other formats are welcome.

Note: if your game / app only uses programmatically generated geometry, this step is not required as you won't be loading any mesh data. Images can be loaded as textures directly, the JSON that's generated by the importer is optional.

glsl2spirv

This tool uses glslc by default to compile GLSL shaders to SPIR-V. It takes the source and desitnation directories as optional arguments, and reproduces the source file tree at the destination, with each compiled shader being suffixed with .spv. This suffix is optional in Uris in-game, the shader assets will automatically add them if not present.

If shaders are frequently modified, it is recommended to have a custom target in CMake that invokes glsl2spirv, to ensure a build run always uses up-to-date shaders.

le-importer

This tool imports GLTF meshes into LittleEngine meshes, geometries, materials, textures, animations, and skeletons.

External Dependencies

Misc

Original repository

LICENCE

More Repositories

1

LittleEngine

2D C++17 game engine using PhysicsFS and SFML
C++
18
star
2

locc

C++20 utility to count lines of code
C++
12
star
3

clap

Lightweight, type-safe command line arguments parser using C++20
C++
12
star
4

ktl

Collection of ktl header libraries - small C++20 wrapper utilities
C++
12
star
5

bave

BAsic Vulkan Engine for desktop and Android
C++
12
star
6

djson

Dumb simple JSON parsing library
C++
11
star
7

levk

LittleEngineVk v2 (revamped)
C++
11
star
8

rpi4-install-vulkan

Consolidated shell script to install the Raspberry Pi Mesa Vulkan driver for aarch64
Shell
11
star
9

cpp-template

C++20 CMake Project Template (Executable)
CMake
10
star
10

dino

C++20 Library for dynamically loading shared libraries and functions.
C++
8
star
11

gltf2cpp

A lightweight and modern GLTF parser written in C++20
C++
8
star
12

LittleEngine3D

Wanderings in 3D
C++
6
star
13

gvdi

Minimalist C++20 Dear ImGui implementation over GLFW / Vulkan
C++
6
star
14

MicroEngine

Garbage Collectors Contest Team 3
C++
5
star
15

cronch

Celesta game jam using vulkify and tardigrade
C++
4
star
16

tardigrade

Tiny Game Engine Framework
C++
3
star
17

decf

Dumb simple Entity-Component framework in C++17
C++
2
star
18

bgf

bave game framework
C++
2
star
19

fixed_vector

KT single header C++17 library for std::vector that uses a fixed size stack allocated buffer for storage.
C++
2
star
20

toylang

Exploring Crafting Interpreters in C++20
C++
2
star
21

cmake-utils

Utility functions used across multiple CMake projects.
CMake
2
star
22

dibs

Dear ImGui BootStrap using GLFW, Vulkan, and C++20
C++
2
star
23

string_trie

KT header only library: class template string_trie<T = char> for auto-competion of strings
C++
2
star
24

dyvk

Wrapper library around Vulkan-HPP for using it and the Vulkan loader dynamically.
C++
1
star
25

dens

Archetype-based entity-component framework using C++20
C++
1
star
26

LEDemo

Demo Game on 2D C++17 engine using PhysicsFS and SFML
C++
1
star
27

Perlin-Noise-TileMap

Generates an (m x n) tilemap with a specified texture (tileset) using SFML and Perlin noise. No transition tiles.
C++
1
star
28

CPP17

C++17 skeleton project featuring GitHub CI integration using CMake 3.15+, g++ 8, clang 8 and ninja 1.8+
Shell
1
star
29

rice-rush

Small game for casual game jam
C++
1
star
30

dtest

Tiny C++17 test harness library
C++
1
star
31

Particle-System-Demo

C++
1
star