Skip to content

ECS-based 3D rendering engine written in OpenGL 4.3 and C++20

License

Notifications You must be signed in to change notification settings

automaticp/josh3d

Repository files navigation

josh3d

Josh3d (pronounced as "joe shed") is a small 3D rendering engine written in OpenGL 4.3 and C++20.

It's mainly a hobby project and is a constant work in progress so there's no stable version. The scope is limited by my abilities and the free time that I have, but I do try to keep everything clean and even write comments sometimes, so you're welcome to poke around in code if you want. It also serves as the prototyping grounds for trying different techniques, thanks to the extendable and hook-able architecture the engine has.

Here's some pictures because you probably like to look at things:

sponza ls_skyline barometric_fog_2 imgui_vomit

Tree asset by SomeKevin on sketchfab, Forest Skybox by Emil Persson, Sponza by Frank Meinl, Josh by me.

Currently Implemented Features:

Rendering:

  • Deferred renderer with Blinn-Phong shading;
  • Directional and point lights with shadow mapping;
  • Normal maps;
  • Soft gaussian bloom;
  • Barometric and uniform fog;
  • Gamma Correction and HDR with adaptive exposure.

Engine:

  • ECS based engine design written to accomodate minimal shader switching and minimize "late-bound" decision making;
  • Support for adding custom rendering and postprocessing passes to the engine. Nothing is "nailed-down", everything can be extended or replaced by a user-provided solution;
  • ImGui hooks for configuring rendering passes and manipulating registry components.

Road Ahead (TODOs):

(items in each section are listed in order of priority)

Rendering:

  • Cascaded shadow mapping;
  • SSAO;
  • PBR support;
  • Some global illumination solution;
  • More grass, I like grass.

Engine:

  • Support for precompute passes;
  • Frustrum culling;
  • Compute-based particle system;
  • Instancing, indirect draws and tricks to scale up to larger scenes.

Assets and IO:

  • Asynchronous asset loading with caching;
  • High-level asset management system;
  • Serialization (binary ECS dump + custom schema)

Other:

  • Package the project so that it could be used as a dependency through FetchContent or similar.

Requirements & Dependencies

Requires: C++20 Compiler, CMake 3.21, vcpkg

Depends on: glbinding, glfw, glfwpp, glm, assimp, stb, range-v3, entt, dear imgui, doctest

All dependencies are satisfied automatically with vcpkg or FetchContent.

Build & Run

Configure and build from the project root:

VCPKG_ROOT=[path to vcpkg]
CMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake
mkdir build
cmake -S . -B build
cmake --build build

Run the demo and tests from the project root.

Q: Who is Josh?

Josh is a slimy, leopard colored, striped tree that I made in 15 minutes in blender when I needed an asset to test normal maps. I was so proud of myself at the time, that I decided to dedicate this whole repo (and years of my work) to it.

Here's a pic of Josh taking a nap:

josh

Isn't it cute?

About

ECS-based 3D rendering engine written in OpenGL 4.3 and C++20

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published