REI is a cross-platform rendering framework. It functions as a comprehensive graphics API and is adaptable to various platforms, including PC, consoles, and mobile. It simplifies porting, especially for games developed on custom or proprietary engines. REI can serve as a cross-platform API as well as a helper library for platform-specific API.
- Windows 10+ using DirectX 12 and Vulkan
- Android using Vulkan
- Steam Deck using Vulkan
- Xbox One*
- Xbox Series X/S*
- Playstation 4*
- Playstation 5*
- Nintendo Switch*
*Only available for accredited developers via licensing
- Windows 10+ is required
- Install drivers compatible with Vulkan 1.3 if necessary
- Install Visual Studio 2022 and Windows SDK.
- REI requires Vulkan SDK (https://vulkan.lunarg.com/sdk/home).
- REI uses vcpkg for dependency management (https://vcpkg.io/en/)
- Ensure vcpkg is integrated with MSBuild / Visual Studio - run if necessary
vcpkg integrate install
- Install the DirectX shader compiler using vcpkg
vcpkg install directx-dxc:x86-windows directx-dxc:x64-windows
- Install SDL2 using vcpkg
vcpkg install sdl2:x86-windows sdl2:x64-windows
- Build solution which is located at
\<path to repo\>\sources\REI_Platforms\windows\VSProjects\REI.sln
Here are some samples where REI was used.
This sample shows the classic ‘Hello World’ triangle.
This sample shows basic geometry rendering, with a rotating camera.
This sample shows a fontstash example (https://github.com/memononen/fontstash) with REI as a rendering backend.
This sample shows GLTF model loading and display.
This sample shows how to use REI with ImGUI (https://github.com/ocornut/imgui).
This sample shows a NanoVG example (https://github.com/memononen/nanovg) with REI as a rendering backend.
- REI uses HLSL shaders for integrations and samples.
- Currently there isn't a dedicated shader compiler solution integrated with REI; all shaders for samples are compiled with the help of custom build steps in Visual Studio Projects. Please refer to REI_Integration.vcxproj, sample_triangle.vcxproj, sample_gltf.vcxproj for examples.
REI_PLATFORM_<platform_name>=1
was declared in the vcxproj/props files of a specific platform.REI_PLATFORM_WINDOWS
is used for Windows.- To enable PIX capturing for windows first you need to define
REI_ENABLE_PIX=1
in RendererD3D12.h or project file. - You also need to install WinPixEventRuntime using NuGet. To do this, perform these steps:
- Right-click on the solution in Solution Explorer.
- Click "Manage NuGet Packages for Solution".
- Select the "Browse" tab.
- Type "WinPixEventRuntime" into the search box.
- Select the package.
- Select all related projects (or just all) participating in the build with pix3.h.
- Click "Install".
- If
packages.config
is not added to all selected projects you can manually reinstall it using "Manage NuGet Packages" when you right-click a specific project. Or you can click to Tools -> NuGet Package Manager -> Package Manager Console. Then run:update-package -reinstall
- The descriptorIndex field in REI_DescriptorData represents the actual position in the descriptor table. This index is determined by the REI_DescriptorBinding order in the pBindings array of the REI_DescriptorTableLayout structure and the descriptorCount field of the REI_DescriptorBinding structure.
- RendererVk.h contains
USE_RENDER_DOC
define which adds VK_LAYER_RENDERDOC_Capture layer to instance. - RendererVk.h contains
USE_DEBUG_UTILS_EXTENSION
define which adds VK_EXT_debug_utils extension to instance. - RendererVk.h contains
REI_VK_ALLOW_BARRIER_INSIDE_RENDERPASS
when enabled, a warning will be displayed, otherwiseASSERT(false)
will be triggered when the user uses REI_cmdResourceBarrier inside a renderpass. If enabled, it closes the open render pass when a resource barrier is requested and opens another render pass. - For D3D12 REI has 35 vertex semantic definitions. These include common semantics like POSITION, TEXCOORD, NORMAL, etc. and 16 USERDEFINED semantics. For your inputs, you can use any semantic you want regardless of its naming, if you correctly specify it in the shader: REI_SEMANTIC_POSITION0 must be specified as a POSITION0 in the shader. REI_SEMANTIC_USERDEFINED11 must be specified as a USERDEFINED11 in the shader. You can use defines to have custom names for semantics (see
defines.hlsli
).
REI utilizes the following Open-Source libraries and tools:
- REI
- The Forge
- tinyrenderers
- Vulkan Memory Allocator
- D3D12 Memory Allocator
- SPIRV-Reflect
- renderdoc
- Dear ImGui
- Fontstash
- nanovg
- cgltf
- Nothings single file libs
- DirectX Shader Compiler
- SDL2
- vcpkg
- smhasher bits of MurmurHash3 and MurmurHash2