Skip to content

The Forge Cross-Platform Rendering Framework PC, Linux, Ray Tracing, macOS / iOS, Android, XBOX, PS4

License

Notifications You must be signed in to change notification settings

y18a/The-Forge

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

295 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Forge Logo

The Forge is a cross-platform rendering framework supporting

  • PC
    • Windows 10
      • with DirectX 12 / Vulkan 1.1
      • with DirectX Ray Tracing API
      • DirectX 11 Fallback Layer for Windows 7 support (not extensively tested)
    • Linux Ubuntu 18.04 LTS with Vulkan 1.1
  • Android Pie with Vulkan 1.1
  • macOS with Metal 2
  • iOS with Metal 2
  • XBOX One / XBOX One X (only available for accredited developers on request)
  • PS4 (only available for accredited developers on request)

Particularly, the graphics layer of The Forge supports cross-platform

  • Descriptor management
  • Multi-threaded and asynchronous resource loading
  • Shader reflection
  • Multi-threaded command buffer generation

The Forge can be used to provide the rendering layer for custom next-gen game engines. It is also meant to provide building blocks to write your own game engine. It is like a "lego" set that allows you to use pieces to build a game engine quickly. The "lego" High-Level Features supported on all platforms are at the moment:

  • Asynchronous Resource loading with a resource loader task system as shown in 10_PixelProjectedReflections
  • Lua Scripting System - currently used in 06_Playground to load models and textures and animate the camera
  • Animation System based on Ozz Animation System
  • Consistent Math Library based on an extended version of Vectormath
  • Extended version of TinySTL
  • For loading art assets we have a modified and integrated version of Assimp
  • Consistent Memory Managament: on GPU following Vulkan Memory Allocator
  • Input system with Gestures for Touch devices based on an extended version of gainput
  • Very fast Entity Component System based on ENTT
  • UI system based on imGui with a dedicated unit test extended for touch input devices
  • Various implementations of high-end Graphics Effects as shown in the unit tests below

Please find a link and credits for all open-source packages used at the end of this readme.

Twitter Join the channel at https://twitter.com/TheForge_FX?lang=en

Build Status

  • Windows Build status
  • macOS Build Status

News

Release 1.28 - May 24th, 2019 - SWB Level Editor | Micro Profiler Re-Write | Log and File System improvements | better macOS/iOS support

We added a new section below the Examples to show screenshots and an explanation of some of the Tools that we integrated. We will fill this up over the next few releases.

  • We were helping James Webb with his level editor for 'Star Wars Galaxies' called SWB that now uses The Forge

Here is a screenshot

SWB Level Editor

SWB is an editor for the 2003 game 'Star Wars Galaxies' that can edit terrains, scenes, particles and import/export models via FBX. The editor uses an engine called 'atlas' that will be made open source in the future. It focuses on making efficient use of the new graphics APIs (with help from The-Forge!), ease-of-use and terrain rendering.

  • Memory tracking:
    • Fluid memory tracker cross-platform for Windows, macOS and Linux
    • We used MTuner to remove many memory leaks and improve memory usage. MTuner might be integrated in the future.
  • Micro Profiler: our initial implementation of Microprofiler needed to be re-done from scratch. This time we wanted to do the integration right and also implemented the dedicated UI.

Microprofiler in Visibility Buffer

Microprofiler in Visibility Buffer

To enable/disable profiling, go to file ProfileEnableMacro.h line 9 and set it to 0(disabled) or 1(enabled). It's supported on the following platforms:

  • Windows
  • Linux
  • macOS (GPU profiling is disabled)
  • iOS (GPU profiling is disabled)
  • Android(WIP will be enabled later on)

We can find MicroProfile integrated in the follwing examples (more will follow):

  • Unit Test 02_Compute
  • VisibilityBuffer

How to use it: MicroProfile has different display modes. The most useful one when running inside the application is Timers. We can change the display mode going to Mode and right clicking the one we want.

If we are on Timer, we will be able to right click on the labels. This will enable a graph at the bottom left.

If we wanted to just see some of the groups inside the profile display, go to Groups and select the ones you want.

The other options are self explanatory.

If the user wants to dump the profile to a file, we just need to go to dump, and right click on the amount of frames we want. This generates a html file in the executable folder. Open it with your prefered web browser to have a look.

Dumping is useful, because we will be able to see the profile frame by frame, without it being updated every frame. This will be useful when displaying in Detailed mode.

There is also a Help menu item.

  • Log system improvements:
    • Support for multiple log files
    • Easy to use log macros
    • Scoped logging
    • Multithreaded support
    • New log format: date, time, thread, file, line, log level and message
    • No need to declare global LogManager, it will be created on demand
  • Filesystem improvements: this is fed back from one of our game engine integrations of The Forge
    • file time functions now use time_t
    • added FileWatcher class for Windows/Linux/macOS
    • added CombinePaths function
  • macOS / iOS Metal:
    • added Barriers with memoryBarrierWithScope for Buffers,Textures and Render targets
    • added GPU sync with MTLFence as fallback (for cross encoder synchranization and BlitEncoder where memoryBarrier isn't available). Removed force fence on render targets change because it is no longer necessary. There might be a small performance improvements coming from this
    • support of Microprofiler see above
    • refactor of windows support code: replaced MTKView for iOS and macOS with a custom NSview and NSWindow implementation. We have more explicit control now over the window.
  • Issues fixed:
    • #112 - cmdBindDescriptors performance issue (DX12)
    • #110 - RenderDoc compatibility with SM6+

Release 1.27 - April 25th, 2019 - Spring House Cleaning Release :-)

  • DirectX
    • Improved our support for DXGI_FORMAT_BC6H_SF16, DXGI_FORMAT_BC7_UNORM
    • DirectX12 removed CPU wait on GPU only fences.
  • Windows - header include cleanup, resolved conflict with CALLTYPE enum in objidl.h
  • macOS / iOS - utilize packed_* data types more in shaders
  • Replaced some usages of GPURingBuffer with API Buffers, for reduced dependencies
  • Unit tests fixes
    • Fixed sky frag shaders in all unit tests
    • Fixed unit test debug vk crash from validation layer with AMD gpu (Vulkan SDK 1.1.101)
  • UI fixes + improvements
    • Added an example of how to use the texture previewer widget in the ui unit test (13_UserInterface)
    • App can now control the UI descriptor binder update freq
  • Improved ThreadedTask system and added helper texture loading code that uses the new async loading system in 06_MaterialPlayground and Visibility Buffer
  • Fixed issue #100 "About FBX resource import?"

See the release notes from previous releases in the Release section.

PC Windows Requirements:

  1. Windows 10

  2. Drivers

  • AMD / NVIDIA - latest drivers
  • Intel - need to install the latest driver (currently Version: 25.20.100.6326, October 9th, 2018) Intel® Graphics Driver for Windows® 10. As mentioned before this driver still doesn't have full DirectX 12 and Vulkan support.
  1. Visual Studio 2017 with Windows SDK / DirectX version 17763.132 (you need to get it via the Visual Studio Intaller) https://developer.microsoft.com/en-us/windows/downloads/sdk-archive

  2. Vulkan 1.1.101.0

  3. The Forge is currently tested on

  • AMD 5x, VEGA GPUs (various)
  • NVIDIA GeForce 9x, 10x. 20x GPUs (various)
  • Intel Skull Canyon

macOS Requirements:

  1. macOS Mojave 10.14.4 beta (18E174f)

  2. Xcode 10.2 beta (10P82s)

  3. The Forge is currently tested on the following macOS devices:

  • iMac with AMD RADEON 560 (Part No. MNDY2xx/A)
  • iMac with AMD RADEON 580 (Part No. MNED2xx/A)
  • MacBook Pro 13 inch (MacBookPro13,2)
  • Macbook Pro 13 inch (MacbookPro14,2)

In the moment we do not have access to an iMac Pro or Mac Pro. We can test those either with Team Viewer access or by getting them into the office and integrating them into our build system. We will not test any Hackintosh configuration.

iOS Requirements:

  1. iOS 12.2 beta (16E5181f)

  2. XCode: see macOS

To run the unit tests, The Forge requires an iOS device with an A9 or higher CPU (see GPU Processors or see iOS_Family in this table iOS_GPUFamily3_v3). This is required to support the hardware tessellation unit test and the ExecuteIndirect unit test (requires indirect buffer support). The Visibility Buffer doesn't run on current iOS devices because the texture argument buffer on those devices is limited to 31 (see Metal Feature Set Table and look for the entry "Maximum number of entries in the texture argument table, per graphics or compute function") , while on macOS it is 128, which we need for the bindless texture array.

We are currently testing on

  • iPhone 7 (Model A1778)
  • iPad (Model A1893)
  • iPhone Xs Max (Model MT5D2LL/A)

PC Linux Requirements:

  1. Ubuntu 18.04 LTS Kernel Version: 4.15.0-20-generic

  2. GPU Drivers:

  1. Workspace file is provided for codelite 12.0.6

  2. Vulkan SDK Version: download the native Ubuntu Linux package for all the elements of the Vulkan SDK LunarG Vulkan SDK Packages for Ubuntu 16.04 and 18.04

  3. The Forge is currently tested on Ubuntu with the following GPUs:

  • AMD RADEON RX 480
  • AMD RADEON VEGA 56
  • NVIDIA GeForce 2070 RTX

Android Requirements:

  1. Android Phone with Android Pie (9.x) for Vulkan 1.1 support

  2. Android Studio with API level 28 and follow the instructions

  3. We are currently testing on

In the moment we only support the first two unit tests. We are waiting for devkits with more stable drivers before we bring over the other unit tests. The Essential phone uses an Adreno 540 GPU. Please check out Vulkan Gpuinfo.org for the supported feature list of this GPU with Android 9.0.

Install

  • For PC Windows run PRE_BUILD.bat. It will download and unzip the art assets and install the shader builder extension for Visual Studio 2017.

  • For Linux and Mac run PRE_BUILD.command. If its the first time checking out the forge make sure the PRE_BUILD.command has the correct executable flag by running the following command chmod +x PRE_BUILD.command

    It will only download and unzip required Art Assets (No plugins/extensions install).

Unit Tests

There are the following unit tests in The Forge:

1. Transformation

This unit test just shows a simple solar system. It is our "3D game Hello World" setup for cross-platform rendering.

Image of the Transformations Unit test

2. Compute

This unit test shows a Julia 4D fractal running in a compute shader. In the future this test will use several compute queues at once.

Image of the Compute Shader Unit test

3. Multi-Threaded Rendering

This unit test shows how to generate a large number of command buffers on all platforms supported by The Forge. This unit test is based on a demo by Intel called Stardust.

Image of the Multi-Threaded command buffer generation example

4. ExecuteIndirect

This unit test shows the difference in speed between Instanced Rendering, using ExecuteIndirect with CPU update of the indirect argument buffers and using ExecuteIndirect with GPU update of the indirect argument buffers. This unit test is based on the Asteroids example by Intel.

Image of the ExecuteIndirect Unit test Using ExecuteIndirect with GPU updates for the indirect argument buffers

Image of the ExecuteIndirect Unit test Using ExecuteIndirect with CPU updates for the indirect argument buffers

Image of the ExecuteIndirect Unit test Using Instanced Rendering

5. Font Rendering

This unit test shows the current state of our font rendering library that is based on several open-source libraries.

Image of the Font Rendering Unit test

6. Material Playground

This unit test shows a range of game related materials:

Hair:

Hair on PC

Metal:

Material Playground Metal on PC

Wood:

Material Playground Wood on PC

7. Hardware Tessellation

This unit test showcases the rendering of grass with the help of hardware tessellation.

Image of the Hardware Tessellation Unit test

8. Procedural

In the spirit of the shadertoy examples this unit test shows a procedurally generated planet.

Image of the Procedural Unit test

9. Light and Shadow Playground

This unit test shows various shadow and lighting techniques that can be chosen from a drop down menu. There will be more in the future.

iMac with AMD RADEON 580 (Part No. MNED2xxA) with resolution of 5120x2880: Light & Shadow Playground

iPhone 7 iOS 12.1.4 (16D57) with a resolution of 1334x750: Light & Shadow Playground

Linux Ubuntu 18.04.1 LTS Vulkan 1.1.92 RADEON 480 Driver 18.30 with a resolution of 1920x1080: Light & Shadow Playground

9a. Hybrid Ray-Traced Shadows

This unit test was build by Kostas Anagnostou @KostasAAA to show how to ray trace shadows without using a ray tracing API like DXR / RTX. It should run on all GPUs (not just NVIDIA RTX GPUs) and the expectation is that it should run comparable with a DXR / RTX based version even on a NVIDIA RTX GPU. That means the users of your game do not have to buy a NVIDIA RTX GPU to enjoy HRT shadows :-) Hybrid Ray Traced Shadows

10. Pixel-Projected Reflections

This unit test shows reflections that are ray traced. It is an implementation of the papers Optimized pixel-projected reflections for planar reflectors and IMPLEMENTATION OF OPTIMIZED PIXEL-PROJECTED REFLECTIONS FOR PLANAR REFLECTORS

Image of the Pixel-Projected Reflections Unit test

11. Multi-GPU (Driver support only on PC Windows)

This unit test shows a typical VR Multi-GPU configuration. One eye is rendered by one GPU and the other eye by the other one.

Image of the Multi-GPU Unit test

12. The Forge switching between Vulkan and DirectX 12 during Run-time (Windows PC-only)

This unit test shows how to switch between the Vulkan and DirectX 12 graphics API during run-time.

Image of the The Forge Switching Unit test

13. imGUI integration unit test

This unit test shows how the integration of imGui with a wide range of functionality.

Image of the imGui Integration in The Forge

14. Order-Independent Transparency unit test

This unit test compares various Order-Indpendent Transparency Methods. In the moment it shows:

15. Wave Intrinsics unit test

This unit test shows how to use the new wave intrinsics. Supporting Windows with DirectX 12 / Vulkan, Linux with Vulkan and macOS / iOS.

Image of the Wave Intrinsics unit test in The Forge

16. Ray Tracing Unit Test

Ray Tracing API unit test, showing how the cross-platfrom Ray Tracing Interface running on Windows, Ubuntu with Vulkan RTX, macOS and iOS

PC Windows 10 RS5, DirectX12, GeForce RTX 2070, Driver version 418.81 1080p: Ray Tracing on PC With DXR

PC Ubuntu Vulkan RTX, GeForce RTX 2070, Driver Version 418.56 1080p Ray Tracing on PC Ubuntu with Vulkan RTX

Mac Mini with Intel Core i5 3GHz cpu with integrated graphics Intel UHD Graphics 630 (Part No. MRTT2RU/A) with resolution 3440x1440: Ray Tracing on macOS

iPad 6th Generation iOS 12.1.3 (16D39) with a resolution of 2048x1536 Ray Tracing on iOS

16a. Sphere Tracing

This unit test was originally posted on ShaderToy by Inigo Quilez and Sopyer. It shows how a scene is ray marched with shadows, reflections and AO

Image of the Sphere Tracing  unit test in The Forge

17. ENTT - Entity Component System Test

This unit test shows how to use a high-performance entity component system in The Forge.

Image of the Entity Component System unit test in The Forge

18. Ozz Playback Animation

This unit test shows how to playback a clip on a rig.

Image of Playback Animation in The Forge

19. Ozz Playback Blending

This unit test shows how to blend multiple clips and play them back on a rig.

Image of Playback Blending in The Forge

20. Ozz Joint Attachment

This unit test shows how to attach an object to a rig which is being posed by an animation.

Image of Ozz Joint Attachment in The Forge

21. Ozz Partial Blending

This unit test shows how to blend clips having each only effect a certain portion of joints.

Image of Ozz Partial Blending in The Forge

22. Ozz Additive Blending

This unit test shows how to introduce an additive clip onto another clip and play the result on a rig.

Image of Ozz Additive Blending in The Forge

23. Ozz Baked Physics

This unit test shows how to use a scene of a physics interaction that has been baked into an animation and play it back on a rig.

Image of Ozz Baked Physics in The Forge

24. Ozz Multi Threading

This unit test shows how to animate multiple rigs simultaneously while using multi-threading for the animation updates.

Image of Ozz Multi Threading in The Forge

25. Ozz Skinning

This unit test shows how to use skinning with Ozz

Image of the Ozz Skinning unit test

Examples

There is an example implementation of the Triangle Visibility Buffer as covered in various conference talks. Here is a blog entry that details the implementation in The Forge.

Image of the Visibility Buffer

Tools

Below are screenshots and descriptions of some of the tools we integrated.

Microprofiler

We integrated the Micro Profiler into our code base.

Microprofiler in Visibility Buffer

Microprofiler in Visibility Buffer

To enable/disable profiling, go to file ProfileEnableMacro.h line 9 and set it to 0(disabled) or 1(enabled). It's supported on the following platforms:

  • Windows
  • Linux
  • macOS (GPU profiling is disabled)
  • iOS (GPU profiling is disabled)
  • Android(WIP will be enabled later on)

We can find MicroProfile integrated in the follwing examples:

  • Unit Test 02_Compute
  • VisibilityBuffer

MicroProfile provides us an easy to use UI and visualization our frame.

How to use it: MicroProfile has different display modes. The most useful one when running inside the application is Timers. We can change the display mode going to Mode and right clicking the one we want.

If we are on Timer, we will be able to right click on the labels. This will enable a graph at the bottom left.

If we wanted to just see some of the groups inside the profile display, go to Groups and select the ones you want.

The other options are self explanatory.

If the user wants to dump the profile to a file, we just need to go to dump, and right click on the amount of frames we want. This generates a html file in the executable folder. Open it with your prefered web browser to have a look.

Dumping is useful, because we will be able to see the profile frame by frame, without it being updated every frame. This will be useful when displaying in Detailed mode.

For any doubt on the use of the MicroProfile, hover Help.

Releases / Maintenance

Confetti will prepare releases when all the platforms are stable and running and push them to this GitHub repository. Up until a release, development will happen on internal servers. This is to sync up the console, mobile, macOS and PC versions of the source code.

Products

We would appreciate it if you could send us a link in case your product uses The Forge. Here are the ones we received so far:

StarVR One SDK

The Forge is used to build the StarVR One SDK:

StarVR

Torque 3D

The Forge is used as the rendering framework in Torque 3D:

Torque 3D

Star Wars Galaxies Level Editor

SWB is an editor for the 2003 game 'Star Wars Galaxies' that can edit terrains, scenes, particles and import/export models via FBX. The editor uses an engine called 'atlas' that will be made open source in the future. It focuses on making efficient use of the new graphics APIs (with help from The-Forge!), ease-of-use and terrain rendering.

SWB Level Editor

Open-Source Libraries

The Forge utilizes the following Open-Source libraries:

About

The Forge Cross-Platform Rendering Framework PC, Linux, Ray Tracing, macOS / iOS, Android, XBOX, PS4

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 60.3%
  • GLSL 16.5%
  • Metal 10.5%
  • Objective-C++ 4.8%
  • C 3.7%
  • Objective-C 1.4%
  • Other 2.8%