Modern & multiplatform game engine in C++17

Overview

RaZ logo
RaZ

Modern & multiplatform 3D game engine in C++17


Linux build
Linux
Windows build
Windows
macOS build
macOS
WASM build
WebAssembly
Compilation
Unit tests No CI yet No CI yet N/A
Codacy
Codacy
Coveralls
Coveralls
Codacy Badge Coverage Status

Summary

RaZ comes from, as you may have noticed, my username Razakhel. This was also meant as a pun, since in french RàZ is the acronym for "Remise à zéro", which basically means "reset". I didn't have any particular intent behind this double meaning. Except maybe hoping that using RaZ might reset your mind because of its awesomeness? Oh well.

Written in modern C++ (17), ECS driven, it is primarily developed for learning purposes. It is intended to be as optimized as possible, while trying to stay as modular as it can.

The engine is available under Windows, Linux & macOS; it can also run in a web browser through WebAssembly (using Emscripten).

📖 If you want to get started, head to the wiki. For the documentation, look over here!

💬 A Discord server dedicated to RaZ is also available! Feel free to come by to follow the development, ask any question, or just say hi 👋

Gallery

Crytek Sponza Hylian shield (PBR)
Crytek Sponza Hylian shield

More examples are available here.

Features

Module Features
Audio - Playing/pausing/stopping/repeating sounds
- WAV import
Math - Vectors
- Matrices
- Quaternions
- Angles (degrees/radians)
- Transformations (translation, rotation, scale)
Rendering - OpenGL (3.3 or 4.5)
- Vulkan (in progress)
- Standard (Blinn-Phong) & PBR (Cook-Torrance) material models
- Deferred rendering, using a custom render graph
- Camera (perspective/orthographic)
- Light sources (point & directional)
- Cubemap
- Normal mapping
Physics - Shapes (line, plane, sphere, triangle, quad, AABB, OBB)
- Shape/shape collision checks (in progress)
- Ray/shape intersection checks (in progress)
- Rigid body simulation (in progress)
Misc - ECS (Entity Component System) implementation
- Dynamic bitset
- Uniformized platform-dependant path strings
- Directed graph structure
- Meshes (OBJ import/export, FBX import, OFF import)
- Images (PNG import/export, TGA import, HDR import (in progress))
- Windowing (window, overlay, keyboard/mouse inputs with custom callbacks)
- Compiler, enum, string, type & threading utilities
Comments
  • Roadmap and planned features?

    Roadmap and planned features?

    Hey there @Razakhel ! 🖐️

    Is there a planned roadmap for this framework? Or are there expected timelines when newer features are going to be added? In addition, is there expected to be features like alpha channel support soon? Or is this project considered to be "abandoned" and will no longer be updated or worked on?

    And gratz in advance!

    Question 
    opened by WaterPristine 2
  • Add the possibility to have textbox

    Add the possibility to have textbox

    We can already have textbox using ImGUI but when typing wasd for example, it will also trigger the callbacks attached to the key events W, A, S and D.

    See https://github.com/ocornut/imgui/issues/703 and https://github.com/ocornut/imgui/issues/1219#issuecomment-313683169 if needed :D

    Good luck, I love your work!

    Enhancement Rendering 
    opened by SuperFola 1
  • Reworked window class and modified gitignore

    Reworked window class and modified gitignore

    The window class was reworked in a way that you can now set a custom window close callback. VSync is now working as well on MacOS.

    The .gitignore was also modified to exclude DS_Store when using a MacOS workspace.

    opened by Sausty 0
  • Add multiplication between quaternion

    Add multiplication between quaternion

    Using quaternion for composing non-translation transforms is more efficient than matrix composition.

    This PR adds the necessary functions. They were written by @Razakhel first and fixed by myself.

    Enhancement 
    opened by alexandre-janniaux 0
  • travis: use xvfb-run instead of xvfb

    travis: use xvfb-run instead of xvfb

    xvfb-run allows a program to be run in a new xvfb server without having to take care of the lifecycle of the involved server.

    See there for inspiration and usage: https://github.com/zestedesavoir/zds-site/pull/5122/files#diff-b67911656ef5d18c4ae36cb6741b7965R37

    opened by alexandre-janniaux 0
  • [CI] Investigate graphics unit testing under macOS

    [CI] Investigate graphics unit testing under macOS

    After having tried many different things, launching unit tests which require graphics capabilities (using GLFW in this case) always fail. It is yet unknown if this is due to:

    • A technical issue of macOS VMs/servers without any available workaround (which doesn't seem like it, since there are reports that it can be done, at least could have been some time ago);
    • Something missing concerning the window's initialization: GLFW may need specific settings to be able to start under those conditions;
    • Specific arguments to launch Xvfb and/or the tests executable with.

    See:

    • https://github.com/go-flutter-desktop/go-flutter/issues/186

    Note: Xvfb needs the package xquartz to be installed by brew.

    Separate steps

    - name: Starting Xvfb
      run: |
        export DISPLAY=:99.0;
        ( sudo /usr/X11/bin/Xvfb :99 -ac -screen 0 1280x720x24 +render +iglx )&
    
    - name: Test
      working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
      run: ALSOFT_DRIVERS=null ./tests/RaZ_Tests
    
    Unable to create basic Accelerated OpenGL renderer.
    Unable to create basic Accelerated OpenGL renderer.
    Core Image is now using the software OpenGL renderer. This will be slow.
    GLFW error 65545: NSGL: Failed to find a suitable pixel format
    libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Error: Failed to create GLFW Window
    /Users/runner/work/_temp/62d6113c-982d-45c8-abf4-0294b9601198.sh: line 1:  2157 Abort trap: 6           ALSOFT_DRIVERS=null ./tests/RaZ_Tests
    Error: Process completed with exit code 134.
    

    See:

    • https://github.com/vispy/vispy/blob/master/.travis.yml#L127

    Single command

    - name: Test
      working-directory: ${{ runner.workspace }}/build-${{ matrix.compiler.c }}
      run: /usr/X11/bin/Xvfb :99 & export DISPLAY=:99 & ALSOFT_DRIVERS=null ./tests/RaZ_Tests
    
    Unable to create basic Accelerated OpenGL renderer.
    Unable to create basic Accelerated OpenGL renderer.
    Core Image is now using the software OpenGL renderer. This will be slow.
    GLFW error 65545: NSGL: Failed to find a suitable pixel format
    _XSERVTransmkdir: ERROR: euid != 0,directory /tmp/.X11-unix will not be created.
    _XSERVTransSocketUNIXCreateListener: mkdir(/tmp/.X11-unix) failed, errno = 2
    _XSERVTransMakeAllCOTSServerListeners: failed to create listener for local
    (EE) 
    Fatal server error:
    (EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE) 
    libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Error: Failed to create GLFW Window
    /Users/runner/work/_temp/1e2bfa6e-3279-423e-aa75-96161a9cb859.sh: line 1:  2149 Abort trap: 6           ALSOFT_DRIVERS=null ./tests/RaZ_Tests
    Error: Process completed with exit code 134.
    

    See:

    • https://superuser.com/questions/962490/xvfb-run-on-mac-osx
    Help wanted Idea 
    opened by Razakhel 0
  • [Atmosphere] Implement an atmosphere simulation

    [Atmosphere] Implement an atmosphere simulation

    Many resources are available, which need to be tested further:

    • Scratchapixel's explanation: https://www.scratchapixel.com/lessons/procedural-generation-virtual-worlds/simulating-sky
    • Frostbite's papier on physically-based sky, atmosphere & clouds: https://sebh.github.io/publications/egsr2020.pdf
      • Related presentation: https://www.ea.com/frostbite/news/physically-based-sky-atmosphere-and-cloud-rendering
    • GPU Gem about atmospheric scattering: https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering
    Enhancement Rendering 
    opened by Razakhel 1
  • [Cook-Torrance] Investigate the symmetric Fresnel calculation

    [Cook-Torrance] Investigate the symmetric Fresnel calculation

    It has been pointed out that Cook-Torrance's most common explanations don't include the fact that the Fresnel component is actually symmetric.

    See:

    • Earl Hammon's GDC talk, particularly from slide 99 to 108, although many slides prior to these are worth looking at.
    • This good short explanation post: https://computergraphics.stackexchange.com/a/2289/9321.
    Enhancement Rendering 
    opened by Razakhel 2
  • [Cook-Torrance] Investigate UE4's Fresnel Shlick optimization

    [Cook-Torrance] Investigate UE4's Fresnel Shlick optimization

    Instead of the common Fresnel calculation, Brian Karis suggests using a spherical gaussian approximation, which he deems more efficient with unnoticeable differences.

    As such, the current Fresnel calculation:

    Standard formula

    vec3 fresnel = baseReflectivity + (1.0 - baseReflectivity) * pow(1.0 - cosTheta, 5.0);
    

    would become:

    Optimization formula

    vec3 fresnel = baseReflectivity + (1.0 - baseReflectivity) * pow(2.0, (-5.55473 * cosTheta - 6.98316) * cosTheta);
    

    In RaZ's case, this actually fixes black artifacts when the light's position is strictly equivalent to the camera's (which should not happen in real life cases):

    Fresnel artifacts Fresnel optimization

    This optimization should probably be investigated, as the artifacts may come from a small blunder in the implementation.

    Enhancement Rendering 
    opened by Razakhel 0
Owner
Romain Milbert
Computer graphics enthusiast. Mainly interested in rendering (both offline & real-time), physics simulations and augmented reality.
Romain Milbert
A multiplatform C++ library for common and basic system functionalities.

axl.cm A multiplatform C++ library for common and basic system functionalities. Platforms Linux Windows C++ standard minimum: C++98 target: C++11 maxi

Axel 2 Apr 4, 2022
This is the official source code of FreeCAD, a free and opensource multiplatform 3D parametric modeler

This is the official source code of FreeCAD, a free and opensource multiplatform 3D parametric modeler

FreeCAD 12.6k Nov 26, 2022
C++ Multiplatform Modular Toolkit Template

C++ Multiplatform Modular Toolkit Template Nativium Philosophy: Write Once And Compile Anywhere About Write a single code in C++ and compile for any p

Nativium 26 Nov 13, 2022
Golang bindings of Sciter: the Embeddable HTML/CSS/script engine for modern UI development

Go bindings for Sciter Check this page for other language bindings (Delphi / D / Go / .NET / Python / Rust). Attention The ownership of project is tra

Terra Informatica Software, Inc 2.5k Nov 26, 2022
Love 6's Regular Expression Engine. Support Concat/Select/Closure Basic function. Hope u can enjoy this tiny engine :)

Regex_Engine Love 6's Blog Website: https://love6.blog.csdn.net/ Love 6's Regular Expression Engine Hope u can love my tiny regex engine :) maybe a fe

Love6 2 May 24, 2022
Sword Engine is a fork of Psych Engine that plans on adding more features and quality of life improvements.

⚠️ WARNING: This README is currently incomplete, This warning will be removed once it's complete. Friday Night Funkin' - Sword Engine Sword Engine is

swordcube 7 Jul 9, 2022
Two Tribes Engine; the engine which we used to create Toki Tori 2+ and RIVE with

Two Tribes Engine We, Two Tribes, have used this engine for over a decade. It started with early development on the Nintendo DS and ultimately resulte

Two Tribes 122 Nov 28, 2022
OpenGL Template Engine - a C++ OpenGL graphics engine which aimed to be a simple startup template for 3D OpenGL projects.

OpenGL Template Engine is a C++ OpenGL graphics engine which aimed to be a simple startup template for 3D OpenGL projects. This is the template I personally use for my own projects and provides me with the general OpenGL 3D render setup with model import and UI.

Marcus Nesse Madland 2 May 16, 2022
My first Real-Time 3D Game Engine learning project written in C++.

EyeEngine-Cpp FOA, sry for my poor English. What is Eye Engine? Eye Engine is my first Real-Time 3D Game Engine learning project. There are two editio

F-seeeye 5 Apr 6, 2022
A simple, funky, horrible fluid simulator, made possible by OLC's Pixel Game Engine

flOwie A simple, funky, horrible fluid simulator, made possible by OLC's Pixel Game Engine! Not meant for usefulness. The big O is in the name because

null 1 Jan 21, 2022
PyMO AVG Game Engine implemention in C.

__________ __ _______ / ____/ __ \__ __/ |/ / __ \ / / / /_/ / / / / /|_/ / / / / / /___/ ____/ /_/ / / / / /_/ / \____/_/ \__, /_

弦语蝶梦 85 Nov 26, 2022
A simple 3D game engine for GameCube, Wii, 3DS, Windows, and Linux.

octave A Simple 3D Game Engine for GameCube, Wii, 3DS, Windows, and Linux Windows Setup Download and Install: Visual Studio Community 2017 (with C++ s

Martin Holtkamp 9 Nov 8, 2022
HEngine - 2D/3D Game Engine written in C++20

HEngine HEngine: Hbh Game Engine Now only support platform Windows OpenGL 4.5 TODO: D3D11 D3D12 Vulkan 命名规范 命名法 统一采用Pascal命名法(文件夹、类名等),第三方库除外 CMakeLis

null 84 Nov 23, 2022
Game Boy and Game Boy Color Emulator

SkyBoy A simple game boy emulator written to keep my skills sharp. The majority of the code was written in a 7 day sprint. It supports most common Gam

Sky 286 Nov 25, 2022
Pretty Printer for Modern C++

Highlights Single header file Requires C++17 MIT License Quick Start Simply include pprint.hpp and you're good to go. #include <pprint.hpp> To start p

Pranav 880 Nov 23, 2022
Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more

EnTT is a header-only, tiny and easy to use library for game programming and much more written in modern C++. Among others, it's used in Minecraft by

Michele Caini 7.4k Nov 29, 2022
Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum

_ _ __ _____ | \ | | / _| / ____|_ _ | \| | __ _ _ __ ___ ___ ___ | |_ | | _| |

Daniil Goncharov 1.5k Dec 4, 2022
Random for modern C++ with convenient API

Random for modern C++ with convenient API Design goals Supported compilers Integration Five-minute tutorial Number range Common type number range Char

Ilya Polishchuk 732 Nov 26, 2022