**3D Engine (2020)** # What Is It? I wrote a DirectX 11/OpenGL 4 engine in C++ as a learning project. It ran on Windows and could render, edit and serialise simple scenes comprised of terrain plus many static meshes. ![A sample scene rendered with shadow mapping and normal mapping. (Click for fullscreen)](images/3dengine_screenshot_1.png width="512px") # Rendering Features There was support for dynamic lights (directional and point) with Blinn-Phong shading and more complex features like shadow mapping and normal mapping. I also implemented a simple batching system that rendered similar combinations of meshes and materials together to minimise GPU state transitions. To support multiple graphics APIs, I created a generic low level graphics API with implementations in DirectX 11 and OpenGL 4.3. The game's rendering code was written on top of this generic API which allowed it to be target API agnostic. Unfortunately, the shaders had to be written in both HLSL and GLSL to work with both target APIs, but this could have been improved with a build-time translation system that would transform HLSL to GLSL or vice versa. Full list of graphics features: * Dynamic directional and point lights. * Blinn-Phong shading. * Shadow mapping. * Normal mapping. * Skybox rendering. * Support for multiple materials. * Signed distance field 2D text rendering. * Batching system. * Back-ends in D3D11 and OpenGL 4.3. * Generating a terrain mesh from a heightmap. ![Another scene. (Click for fullscreen)](images/3dengine_screenshot_2.png width="512px") # Other Engine Features * Offline data pipeline that optimised source meshes with meshoptimizer and transformed them into a custom binary format for fast loading. It also produced binary shader files that contained both GLSL and compiled HLSL. * Basic scene editor complete with a command console powered by Dear ImGui that could serialise and deserialise scenes. * Support for hot-reloading C++ code. * Custom allocator for temporary memory. * No runtime OS memory allocations. * OBJ and TGA loaders written from scratch. * Math library written from scratch. * Used the Win32 API to interface with the OS. ![The editor. (Click for fullscreen)](images/3dengine_editor.png width="512px") ![Performance visualisation. (Click for fullscreen)](images/3dengine_perf.png width="512px")