当前位置: 首页 > 软件库 > 手机/移动开发 > >

The-Forge

授权协议 Apache-2.0 License
开发语言 Java
所属分类 手机/移动开发
软件类型 开源软件
地区 不详
投 递 者 毋弘光
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

The Forge is a cross-platform rendering framework supporting

  • PC
    • Windows 10 / 7
      • with DirectX 12 / Vulkan 1.1
      • with DirectX Ray Tracing API
      • DirectX 11 Fallback Layer for Windows 7 support
    • Linux Ubuntu 18.04 LTS with Vulkan 1.1 and RTX Ray Tracing API
  • Android Pie or higher with
    • Vulkan 1.1
    • OpenGL ES 2.0 fallback for large scale business application frameworks
  • macOS / iOS / iPad OS with Metal 2.2 and M1 support
  • Quest 2 using Vulkan 1.1
  • XBOX One / XBOX One X / XBOX Series S/X *
  • PS4 / PS4 Pro *
  • PS5 *
  • Switch using Vulkan 1.1 *

*(only available for accredited developers on request)

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

  • Descriptor management. A description is on this Wikipage
  • 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:

  • Resource Loader as shown in 10_PixelProjectedReflections, capable to load textures, buffers and geometry data asynchronously
  • Lua Scripting System - currently used in 06_Playground to load models and textures and animate the camera and in several other unit tests to cycle through the options they offer during automatic testing.
  • Animation System based on Ozz Animation System
  • Consistent Math Library based on an extended version of Vectormath with NEON intrinsics for mobile platforms
  • Extended version of EASTL
  • Consistent Memory Managament:
  • Input system with Gestures for Touch devices based on an extended version of gainput
  • Fast Entity Component System based on our internally developed ECS
  • Cross-platform FileSystem C API, supporting disk-based files, memory streams, and files in zip archives
  • UI system based on imGui with a dedicated unit test extended for touch input devices
  • Shader Translator using a superset of HLSL as the shader language, called The Forge Shading Language. There is a Wiki page on The Forge Shading Language
  • 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.

Join the Discord channel at https://discord.gg/hJS54bz

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

The Forge Interactive Inc. is a Khronos member

Build Status

  • Windows
  • macOS

News

Release 1.49 - September 09, 2021 - Quest 2 Support | Apple M1 support

  • Quest 2 Support - after working now for the last 4 years on various Quest projects, we decided to add Quest 2 support to our framework.
  • Quest 2 running 01_Transformations

    Quest 2 running 09_ShadowPlayground

  • At this moment the following unit tests do not work:
    • 07_Tessellation: Tesselation is not supported when using Multiview. Unit test has been removed from Quest solution file.
    • 10_ScreenSpaceReflections: Lots of artifacts.
    • 14_WaveIntrinsics: Wave intrinsics are not supported.
  • Apple M1 support - we are testing now on a M1 iMac and a M1 iPad Pro. Unfortunately we have crashes in one unit test and all the more complex examples and middleware.
  • iMac with M1 chip running at 3840x2160 resolution

    iPad with M1 chip running with 1024x1366 resolution

    It is astonishing how well the iPad with M1 chip perform.Due to -what we consider driver bugs- M1 hardware crashes in

    • Aura
    • 16_raytracing
    • Visibility Buffer
    • Ephemeris
  • UI / Fonts / Lua interface refactor
    • Moved Virtual Joystick to IInput.h / InputSystem.cpp
    • Pulled current Lua implementation out of AppUI and gave it its own interface (IScripting.h)
    • Pulled Fontstash implementation out of AppUI and gave it its own interface (IFont.h)
    • IFont and IScripting are now initialized on the OS Layer, with user customization functions available on the App Layer
    • Fonts and Lua can now be disabled via preprocessor defines and UI will still function (using default 'ProggyClean' font)
  • Zip unit test refactor to support encryption and writes into archive
  • For one of our customer projects we need password encryption, so we replaced our old zip library with

    minizip ng

  • Extended iOS Gesture / Android gesture support
  • For the same project we added more gesture support for mobile platforms.
  • Partial C99 rewrite of OS/Interfaces headers and implementation files
  • Our on-going effort to make TF easier to use is to rewrite parts in C99, so that teams can work with it more efficiently, the compile time goes down as well as the memory footprint is smaller.
  • OpenGL ES 2 - Unit test 17 is now working as well.
  • GitHub fixes:
    • Pull Request "Fix typo" #199
    • Pull Request "Fix iOS Xcode OpenGL ES Error breakpoint crash" #202
    • Pull Request "Reduce GL ES buffer allocation frequency" #204
    • Pull Request "Apple silicon m1 fixes" #208

Release 1.48 - May 20th, 2021 - Aura | New FSL Shader Language Translator | Run-time API Switching | Variable Rate Shading | MSAA | OpenGL ES 2 Update | PVS Studio

This is our biggest update since we started this repository more than three years ago. This update is one of those "what we have learned from the last couple of projects that are using TF" updates and a few more things.

  • Aura - Dynamic Global Illumination - we developed this system in the 2010 / 2011 time frame. It is hard to believe it is 10 years ago now :-) ... it shipped in Agents of Mayhem at some point and was implemented and used in other games. We are just putting the "base" version without any game specific modifications in our commercial Middleware repository on GitHub. The games that used this system made specific modifications to the code base to align with their art asset and art style.In today's standards this system still fulfills the requirement of a stable rasterizer based Global Illumination system. It runs efficiently on the original XBOX One, that was the original target platform, but might require art asset modifications in a game level.It works with an unlimited number of light sources with minimal memory footprint. You can also cache the reflective shadow maps for directional, point and spotlights the same way you currently cache shadow maps. At some point we did a demo running on a second generation integrated Intel GPU with 256 lights that emitted direct and indirect light and had shadow maps in 2011 at GDC? :-)It is best to integrate that system in a custom game engine that can cache shadow maps in an intelligent way.

Aura - Windows DirectX 12 Geforce 980TI 1080p Driver 466.47

Aura - Windows Vulkan Geforce 980TI 1080p Driver 466.47

Aura - Ubuntu Vulkan Geforce RTX 2080 1080p

Aura - PS4

Aura - XBOX One original

  • Forge Shader Language (FSL) translator - after struggeling with writing a shader translator now for 1 1/2 years, we restarted from scratch. This time we developed everything in Python, because it is cross-platform. We also picked a really "low-tech keep it simple" approach. The idea is that a small game team can actually maintain the code base and write shaders efficiently. We wanted a shader translator that translates a FSL shader to the native shader language of each of the platforms. This way whatever shader compiler is used on that platform can take over the actual job of compiling the native code.The reason why we are doing this lies mostly in the unreliability of DXC and SPIR-V in general and also their lack of reliability if it comes to cross-platform translation.

    There is a Wiki entry that holds a FSL language primer and general information how this works here:

The Forge Shading Language

  • Run-Time API Switching - we had some sort of run-time API switching in an early version of The Forge. At the time we were not expecting this to be very useful because most game teams do not switch APIs on the fly. In the meantime we found a usage case on Android, where we have to reach a large number of devices. So we came up with a better solution that is more consistent with the overall architecture and works on at least PC and Android platforms.On Windows PC one can switch between DX12, Vulkan and DX11 if all are supported. On Android one can switch between Vulkan and OpenGL ES 2.0. The later allows us to target a much larger group of devices for business application frameworks. We could extend this architecture to other platforms like consoles easily.This new API switching required us to change the rendering interfaces. So it is a breaking change to existing implementations but we think it is not much effort to upgrade and the resulting code is easier to read and maintain and overall improves the code base by being more consistent.

  • Device Reset - This was implemented together with API switching. Windows forces game developers to respond to a crashing device driver by resetting the device. We implemented the functionality already in the last update here on GitHub. This update integrates it better into the OS base layer.We also verified that the life cycle management for Windows in each application based on the IApp interface works now for device change, device reset and for API switching so that we can cover all cases of losing and recovering the device.

    The functions for API switching and device reload and reset are:

void onRequestReload();
void onDeviceLost();
void onAPISwitch();
  • Variable Rate Shading (VRS) - we implemented VRS in a new unit test 35_VariableRateShading. It is only supported by DirectX 12 on Windows and XBOX Series S / X.In this demo, we demonstrate two main ways of setting the shading rate:

    • Per-tile Shading Rate:Generating a shading rate lookup texture on-the-fly. Used for drawing the color palette which makes up the background. The rate decreases the further the pixels are located from the center. We can see artifacts becoming visible at aggressive rates, such as 4X4. There is also a slider in the UI to modify the center of the circle.

  • Per-draw Shading Rate:The cubes are drawn by a different shading rate. They are following the Per-draw rate, which can be changed via the dropdown menu in the UI.By using a combiner that overrides the screen rates, we ensure that cubes are drawn by an independent rate.

The cubes are using per-draw shading rate while the background is using per-tile shading rate.

  • Notes:

    • There is a debug view showing the shading rates and the tiles' size.
    • Per-tile method may not be available on certain GPUs even if they support the Per-draw method.
    • The tile size is enforced by the GPU and is readable, as shown in the example.
    • The shading rates available can vary based on the active GPU.
  • Multi-Sample Anti-Aliasing (MSAA) - we added a dynamic way of picking MSAA to unit test 9 and the Visibility Buffer example on all platforms.

PC

PS4

PS5

  • Android & OpenGL ES 2 - the OpenGL ES 2 layer for Android is now more stable and tested and closer to production code. As mentioned above on an Android phone one can switch between Vulkan and OpenGL ES 2 dyanmically if both are supported.Now Android & OpenGL ES 2 support additionally unit test 17 - Entity Component System Test.In general we are testing many Android phones at the moment on the low and high end of the spectrum following the two Android projects we are currently working on, which are on both ends of the spectrum.

  • PVS Studio - we did another manual pass on the code base with PVS Studio -a static code analyzer- to increase code quality.

Release 1.47 - December 18th, 2020 - OpenGL ES 2.0 Android support | Device Reset Support | DRED / Breadcrumb support | Lua driven functional tests | DX11 refactor | YUV support through Vulkan

As the year winds slowly down, we finally found time to do another release. First of all, Happy Holidays and a happy new Year!

Most of us will take off over the Holiday season and spent time with their families. We should be back online in the middle of January 2021.

  • OpenGL ES 2.0: TF will run on probably several hundred million of mobile devices in the future. It will be the rendering layer of business application frameworks. For this usage case, we added OpenGL ES 2.0 support only for Android. The OpenGL ES 2.0 layer only supports unit tests 1, 5, 12 and 31 at the moment.
  • Device change / reset: we finally implemented all the code that can deal with device changes, device resets or device removed scenarios on all platforms. The underlying design was always there but it took us 3+ years to finally add the functionality :-)When you go into any of the *OSBase.* files you can find a snippet of code that looks like this:
if (pApp->mSettings.mResetGraphics) 
	{
		pApp->Unload();
		pApp->Load();
		pApp->mSettings.mResetGraphics = false;
	}
  • DRED / Breadcrumb support: to be able to better tell what the reason behind a removed device is, we implemented DRED support on PC with DirectX 12 and XBOX. We integrated this into the first functional test 01_Transformations. Here is a screenshot. Look for the "Simulate crash" button:

Breadcrumb are user defined markers used to pinpoint which command has caused GPU to stall.In the Breadcrumb unit test, two markers get injected into the command list.Pressing the crash button would result in a GPU hang.In this situation, the first marker would be written before the draw command, but the second one would stall for the draw command to finish.Due to the infinite loop in the shader, the second marker won't be written, and we can reason that the draw command has caused the GPU to hang.We log the markers' information to verify this.Check out this link for more info: D3D12 Device Removed Extended Data (DRED)

  • More Lua Scripting support for all functional tests:
    • For the scripted testing of the Unit Tests, this layer provides automated function registration of the UI elements to Lua State.
    • Any UI elements added to the GUI will add a function or a pair of function(Getter/Setter) to the Lua state for using them in any script.Lua function name resolution will work like this:
    • UI Widget "label" name will be included in the function name as follows,
      • For Widget events: label name + "Event Name". e.g., Lua Function name for label - "Press", and event - OnEdited : "PressOnEdited"
      • For Widget modifiers such as ints / floats: "Set" and "Get" function pair will be added as a prefix to label name e.g., "X" variable will have "SetX" and "GetX" pair of functions.
  • After writing the scripts, you can let the layer know about the scripts using AddTestScripts() function call and run them on any frame by RunTestScript() defined in UIApp class. There are examples of these test scripts in most of the UTs showing how you can also add these scripts to UI and test them on runtime.

Here is how the current Lua support in the functional tests might look like:

  • DX11 refactor: we re-wrote the DX11 run-time a few times. We ended up with the most straighforward version. This version only recently shipped in Hades along with the Vulkan run-time on PC.

  • YUV support: we have now YUV support for all our Vulkan API platforms PC, Linux, Android and Switch. There is a new functional test for YUV. It runs on all these platforms:

  • Audio: we removed the audio functional test. It was the only test that was released unfinished and didn't run on all our platforms. Our customers show love for FMOD ... would make more sense to show an integration of that.

  • GitHub issues fixed:

    • #188 - typo - lowercase L in first DepthStencilClearFlags constant "ClEAR_DEPTH"
    • #186 - Ubuntu: Examples fail to build
    • #182 - Flickering on master when vsync is off
    • #176 - [08_GlftViewer] Application crash on missing resource

Numerous other fixes ...

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

PC Windows Requirements:

  1. Windows 10

  2. Drivers

  • AMD / NVIDIA / Intel - latest drivers
  1. Visual Studio 2017 with Windows SDK / DirectX (you need to get it via the Visual Studio Intaller)
  • Base version:

    • The minimum Windows 10 version is 1803.
    • The minimum SDK version is 1803 (10.0.17134.12).
  • To use Raytracing:

    • The minimum Windows 10 version is 1809.
    • The minimum SDK version is 1809 (10.0.17763.0).

https://developer.microsoft.com/en-us/windows/downloads/sdk-archive

  1. The Forge supports now as the min spec for the Vulkan SDK 1.1.82.0 and as the max spec 1.1.114

  2. The Forge is currently tested on

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

macOS Requirements:

  1. macOS min spec. 10.13.6

  2. Xcode 11.0 (11A419c)

  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)
  • iMac with M1

At this moment we do not have access to an iMac with M1 chipset (we ordered one), 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 14.1

  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)
  • iPhone Xs Max (Model MT5D2LL/A)

iPad OS Requirements:

  1. iPadOS 13.1 beta 3 (17A5837a)

  2. XCode: see macOS

We are currently testing on:

  • iPad (Model A1893)
  • iPad Pro with M1

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 1.1.108: 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. Visual Studio 2019 (Visual Studio 2017 works too but has a bug in the build module)

  3. Android API level 23 or higher

At the moment, the Android run-time does not support the following unit tests due to -what we consider- driver bugs or lack of support:

  • 09_LightShadowPlayground
  • 09a_HybridRayTracing
  • 11_MultiGPU
  • 16_RayTracing
  • 16a_SphereTracing
  • 18_VirtualTexture
  • 32_Window
  • 35_VariableRateShading
  • Visibility Buffer
  • Aura
  • Ephemeris
  1. We are currently testing on

Setup Android Environment

  1. Using Visual Studio Installer install "Mobile Development with C++".We don't need NDK that comes with this packages so that can be unchecked.

  2. Download latest NDK. -- https://developer.android.com/ndk/downloads

  3. Add NDK path in Visual Studio (Tools->Options->Android).

Building Shaderc library:Open Command Prompt at directory

(ndk_root)\sources\third_party\shaderc

And use this command,

..\..\..\ndk-build NDK_PROJECT_PATH=. APP_BUILD_SCRIPT=Android.mk APP_STL:=c++_static APP_ABI=arm64-v8a libshaderc_combined APP_PLATFORM=android-28 -j16

Note: If building process gives python "import" errors, try setting this environment path variable, NDK_HOST_PYTHON = (Python_dir)\python.exe

Steps if You want to creat a new Project(--there are quite a few steps but we got you covered :) )

  1. Create A new Native-Activity Application for apk or Satitc Library if you want to build a library.

  • copy all the includes from pch.h to android_native_app_glue.c and add #include <malloc.h>
  • Delete pch.h and main.cpp
  • unselect the Use precompiled header files option from project property.
  1. Since we need to add UserMacros
  • CustomSysroot -> $(VS_NdkRoot)\sysroot
  • TRIPLE : Refer the table below for values

For respective architecture we insert the corresponding triple value in the macro(we only support ARM and ARM64)

  • ARM arm-linux-androideabi
  • ARM64 aarch64-linux-android

You can either add property sheets given by us which are included in Android_VisualStudio2017 folder, to your project's current target by selecting Add existing property sheet.or create your own and just add those two Macros.

  1. add path to include directories and uncheck inherit from parents
$(CustomSysroot)\usr\include
$(CustomSysroot)\usr\include\$(TRIPLE)
$(VS_Ndkroot)\sources\android\native_app_glue

5)add path to library

$(SolutionDir)$(Platform)\$(Configuration)\ (this is where we have all our libs. set it accordingly)
$(VS_Ndkroot)\sources\third_party\shaderc\libs\c++_static\$(TargetArchAbi)

6)add path to executable directory and uncheck inherit from parent

$(VS_NdkRoot)\toolchains\llvm\prebuilt\windows-x86_64\bin

Notes:

Add -lm to you project Linker Command Line options for if you get any undefined math operations error

If you get error related to "cannot use 'throw' with exceptions disabled"

  • Enable exceptions in C++ Project settings

If you get error related to multiple instances of ioctladd BIONIC_IOCTL_NO_SIGNEDNESS_OVERLOAD in preprocessor definitions

If you get errors related to neon support not enabled-Enable Advance SIMD to Yes-Set floating point ABI to softfp

Quest 2 Requirements:

  1. Uses Visual studio 2017 with "Mobile Development with C++" -> see Android Setup above
  2. Follow steps in OS/Android/Visual Studio 2017 setup.txt for full android environment
  3. Download OVR mobile sdk from oculus website. https://developer.oculus.com/downloads/package/oculus-mobile-sdk/
  4. Tested with ovr-mobile-sdk version 1.46
  5. Place unzipped sdk in The-Forge/Common_3/ThirdParty/OpenSource/ovr_sdk_mobile_1.46.0
  6. Download vulkan validation libs for android from https://github.com/KhronosGroup/Vulkan-ValidationLayers/releasesa) Place unzipped sdk in The-Forge/Common_3/ThirdParty/OpenSource/Vulkan-ValidationLayer-1.2.182.0b) Folder should contain the following: Vulkan-ValidationLayer-1.2.182.0/arm64-v8a/libVkLayer_khronos_validation.so
  7. Run examples from Examples_3/Unit_Tests/Quest_VisualStudio2017

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 commandchmod +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.

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.

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.

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.

Using ExecuteIndirect with GPU updates for the indirect argument buffers

Using ExecuteIndirect with CPU updates for the indirect argument buffers

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.

6. Material Playground

This unit test shows a range of game related materials:

Hair:Many years ago in 2012 / 2013, we helped AMD and Crystal Dynamics with the development of TressFX for Tomb Raider. We also wrote an article about the implementation in GPU Pro 5 and gave a few joint presentations on conferences like FMX. At the end of last year we revisited TressFX. We took the current code in the GitHub repository, changed it a bit and ported it to The Forge. It now runs on PC with DirectX 12 / Vulkan, macOS and iOS with Metal 2 and on the XBOX One. We also created a few new hair assets so that we can showcase it. Here is a screenshot of our programmer art:

Metal:

Wood:

7. Hardware Tessellation

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

8. glTF Model Viewer

A cross-platform glTF model viewer that optimizes the vertex and index layout for the underlying platform and picks the right texture format for the underlying platform. We integrated Arseny Kapoulkine @zeuxcg excellent meshoptimizer and use the same PBR as used in the Material Playground unit test.This modelviewer can also utilize Binomials Basis Universal Texture Support as an option to load textures. Support was added to the Image class as a "new image format". So you can pick basis like you can pick DDS or KTX. For iOS / Android we go directly to ASTC because Basis doesn't support ASTC at the moment.

glTF model viewer running on iPad with 2048x1536 resolution

glTF model viewer running on Samsung Galaxy S10 with Vulkan with 1995x945 resolution

glTF model viewer running on Ubuntu AMD RX 480 with Vulkan with 1920x1080 resolution

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.

  • Exponential Shadow Map - this is based on Marco Salvi's @marcosalvi papers. This technique filters out the edge of the shadow map by approximating the shadow test using exponential function that involves three subjects: the depth value rendered by the light source, the actual depth value that is being tested against, and the constant value defined by the user to control the softness of the shadow
  • Adaptive Shadow Map with Parallax Correction Cache - this is based on the article "Parallax-Corrected Cached Shadow Maps" by Pavlo Turchyn in GPU Zen 2. It adaptively chooses which light source view to be used when rendering a shadow map based on a hiearchical grid structure. The grid structure is constantly updated depending on the user's point of view and it uses caching system that only renders uncovered part of the scene. The algorithm greatly reduce shadow aliasing that is normally found in traditional shadow map due to insufficient resolution. Pavlo Turchyn's paper from GPU Pro 2 added an additional improvement by implementing multi resolution filtering, a technique that approximates larger size PCF kernel using multiple mipmaps to achieve cheap soft shadow. He also describes how he integrated a Parallax Correction Cache to Adaptive Shadow Map, an algorithm that approximates moving sun's shadow on static scene without rendering tiles of shadow map every frame. The algorithm is generally used in an open world game to approximate the simulation of day & night’s shadow cycle more realistically without too much CPU/GPU cost.
  • Signed Distance Field Soft Shadow - this is based on Daniel Wright's Siggraph 2015 @EpicShaders presentation. To achieve real time SDF shadow, we store the distance to the nearest surface for every unique Meshes to a 3D volume texture atlas. The Mesh SDF is generated offline using triangle ray tracing, and half precision float 3D volume texture atlas is accurate enough to represent 3D meshes with SDF. The current implementation only supports rigid meshes and uniform transformations (non-uniform scale is not supported). An approximate cone intersection can be achieved by measuring the closest distance of a passed ray to an occluder which gives us a cheap soft shadow when using SDF.

To achieve high-performance, the playground runs on our signature rendering architecture called Triangle Visibility Buffer. The step that generates the SDF data also uses this architecture.

Click on the following screenshot to see a movie:

The following PC screenshots are taken on Windows 10 with a AMD RX550 GPU (driver 19.7.1) with a resolution of 1920x1080.

Exponential Shadow Maps:

Adaptive Shadow Map with Parallax Correction Cache

Signed Distance Field Soft Shadow:

Signed Distance Field Soft Shadows - Debug Visualization

The following shots show Signed Distance Field Soft Shadows running on iMac with a AMD RADEON Pro 580

The following shots show Signed Distance Field Soft Shadows running on XBOX One:

Readme for Signed Distance Field Soft Shadow Maps:

To generate the SDF Mesh data you should select “Signed Distance Field” as the selected shadow type in the Light and Shadow Playground. There is a button called “Generate Missing SDF” and once its clicked, it shows a progress bar that represents the remaining SDF mesh objects utilized for SDF data generation. This process is multithreaded, so the user can still move around the scene while waiting for the SDF process to be finished. This is a long process and it could consume up to 8+ hours depending on your CPU specs. To check how many SDF objects there are presently in the scene, you can mark the checkbox "Visualize SDF Geometry On The Scene".

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 :-)

10. Screen-Space Reflections

This test offers two choices: you can pick either Pixel Projected Reflections or AMD's FX Stochastic Screen Space Reflection. We just made AMD's FX code cross-platform. It runs now on Windows, Linux, macOS, Switch, PS and XBOX.

Here are the screenshots of AMD's FX Stochastic Screen Space Reflections:

Windows final scene:

Without denoising:

With denoising:

PS4:

macOS:

In case you pick Pixel-Projected Reflections, the application features an implementation of the papers Optimized pixel-projected reflections for planar reflectors and IMPLEMENTATION OF OPTIMIZED PIXEL-PROJECTED REFLECTIONS FOR PLANAR REFLECTORS

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.

12. File System Test

This unit test showcases a cross-platform FileSystem C API, supporting disk-based files, memory streams, and files in zip archives. The API can be viewed in IFileSystem.h, and all of the example code has been updated to use the new API.

  • The API is based around Paths, where each Path represents an absolute, canonical path string on a particular file system. You can query information about the files at Paths, open files as FileStreams, and copy files between different Paths.
  • The concept of FileSystemRoots has been replaced by ResourceDirectorys. ResourceDirectorys are predefined directories where resources are expected to exist, and there are convenience functions to open files in resource directories. If your resources don’t exist within the default directory for a particular resource type, you can call fsSetPathForResourceDirectory to relocate the resource directory; see the unit tests for sample code on how to do this.

13. imGUI integration unit test

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

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.

16. Path Tracer - Ray Tracing Unit Test

The new 16_Raytracing unit test shows a simple cross-platform path tracer. On iOS this path tracer requires A11 or higher. It is meant to be used in tools in the future and doesn't run in real-time.To support the new path tracer, the Metal raytracing backend has been overhauled to use a sort-and-dispatch based approach, enabling efficient support for multiple hit groups and miss shaders. The most significant limitation for raytracing on Metal is that only tail recursion is supported, which can be worked around using larger per-ray payloads and splitting up shaders into sub-shaders after each TraceRay call; see the Metal shaders used for 16_Raytracing for an example on how this can be done.

macOS 1920x1080 AMD Pro Vega 64

iOS iPhone X 812x375

Windows 10 1080p NVIDIA RTX 2080 with DXR Driver version 441.12

Windows 10 1080p NVIDIA RTX 2080 with RTX Driver version 441.12

Linux 1080p NVIDIA RTX 2060 with RTX Driver version 435

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

17. Entity Component System Test

This unit test shows how to use the high-performance entity component system in The Forge. This unit test is based on a ECS system that we developed internally for tools.

18. Sparse Virtual Textures

The Forge has now support for Sparse Virtual Textures on Windows and Linux with DirectX 12 / Vulkan. Sparse texture (also known as "virtual texture", “tiled texture”, or “mega-texture”) is a technique to load huge size (such as 16k x 16k or more) textures in GPU memory.It breaks an original texture down into small square or rectangular tiles to load only visible part of them.

The unit test 18_Virtual_Texture is using 7 sparse textures:

  • Mercury: 8192 x 4096
  • Venus: 8192 x 4096
  • Earth: 8192 x 4096
  • Moon: 16384 x 8192
  • Mars: 8192 x 4096
  • Jupiter: 4096 x 2048
  • Saturn: 4096 x 4096

There is a unit test that shows a solar system where you can approach planets with Sparse Virtual Textures attached and the resolution of the texture will increase when you approach.

Linux 1080p NVIDIA RTX 2060 with RTX Driver version 435

Windows 10 1080p NVIDIA 1080 DirectX 12

Windows 10 1080p NVIDIA 1080 Vulkan

21. Ozz Playback Animation

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

22. Ozz Playback Blending

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

23. Ozz Joint Attachment

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

24. Ozz Partial Blending

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

25. Ozz Additive Blending

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

26. 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.

27. Ozz Multi Threading

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

28. Ozz Skinning

This unit test shows how to use skinning with Ozz

29. Ozz Inverse Kinematic

This unit test shows how to use a Aim and a Two bone IK solvers

Aim IK

Two Bone IK

32. Windows Management

This test demonstrates windows management on Windows, Linux and macOS.

  • The window layout, position, and size are now driven by the client dimensions, meaning thatthe values that the client demands are the exact values the client area will be represented with, regardless of the window style. This allows for much greater flexibilityand consistency, especially when working with a fullscreen window.
  • Multi-monitor support has also been improved significantly, offering smooth consistent transitions between client displays and guaranteeing correct window behavior and data retention. Media layer functionality has been expanded, allowing the client to control mouse positioning, mouse visibility, and mouse visual representation.
  • It is now possible to create independent mouse cursors to further customize the application.

Here are the screenshots:

Windows:

macOS:

Linux:

33. YUV Support

YUV support: we have now YUV support for all our Vulkan API platforms PC, Linux, Android and Switch. There is a new functional test for YUV. It runs on all these platforms:

35. Variable Shading Rate

  • Per tile Shading RateGenerating a shading rate lookup texture on-the-fly. Used for drawing the color palette which makes up the background. The rate decreases the further the pixels are located from the center. We can see artifacts becoming visible at aggressive rates, such as 4X4. There is also a slider in the UI to modify the center of the circle.

  • Per-draw Shading Rate:The cubes are drawn by a different shading rate. They are following the Per-draw rate, which can be changed via the dropdown menu in the UI.By using a combiner that overrides the screen rates, we ensure that cubes are drawn by an independent rate.

The cubes are using per-draw shading rate while the background is using per-tile shading rate.

  • Notes:
    • There is a debug view showing the shading rates and the tiles' size.
    • Per-tile method may not be available on certain GPUs even if they support the Per-draw method.
    • The tile size is enforced by the GPU and is readable, as shown in the example.
    • The shading rates available can vary based on the active GPU.

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.

Tools

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

MTuner

MTunerMTuner was integrated into the Windows 10 runtime of The Forge following a request for more in-depth memory profiling capabilities by one of the developers we support. It has been adapted to work closely with our framework and its existing memory tracking capabilities to provide a complete picture of a given application’s memory usage.

To use The Forge’s MTuner functionality, simply drag and drop the .MTuner file generated alongside your application’s executable into the MTuner host app, and you can immediately begin analyzing your program’s memory usage. The intuitive interface and exhaustive supply of allocation info contained in a single capture file makes it easy to identify usage patterns and hotspots, as well as tracking memory leaks down to the file and line number. The full documentation of MTuner can be found [here](link: https://milostosic.github.io/MTuner/).

Currently, this feature is only available on Windows 10, but support for additional platforms provided by The Forge is forthcoming.Here is a screenshot of an example capture done on our first Unit Test, 01_Transformations:

Ray Tracing Benchmark

Based on request we are providing a Ray Tracing Benchmark in 16_RayTracing. It allows you to compare the performance of three platforms:

  • Windows with DirectX 12 DXR
  • Windows with Vulkan RTX
  • Linux with Vulkan RTX

We will extend this benchmark to the non-public platforms we support to compare the PC performance with console performance.The benchmark comes with batch files for all three platforms. Each run generates a HTML output file from the profiler that is integrated in TF. The default number of iterations is 64 but you can adjust that. There is a Readme file in the 16_RayTracing folder that describes the options.

Windows DirectX 12 DXR, GeForce RTX 2070 Super, 3840x1600, NVIDIA Driver 441.99

Windows Vulkan RTX, GeForce RTX 2070 Super, 3840x1600, NVIDIA Driver 441.99

Microprofiler

We integrated the Micro Profiler into our code base by replacing the proprietary UI with imGUI and simplified the usage. Now it is much more tightly and consistently integrated in our code base.

Here are screenshots of the Microprofiler running the Visibility Buffer on PC:

Here are screenshots of the Microprofiler running a unit test on iOS:

Check out the Wikipage for an explanation on how to use it.

Shader Translator

We provide a shader translator, that translates one shader language -a superset of HLSL called Forge Shader Language (FLS) - to the target shader language of all our target platforms. That includes the console and mobile platforms as well.It is written in Python. We expect this shader translator to be an easier to maintain solution for smaller game teams because it allows to add additional data to the shader source file with less effort. Such data could be for example a bucket classification or different shaders for different capability levels of the underlying platform, descriptor memory requirements or resource memory requirements in general, material info or just information to easier pre-compile pipelines.The actual shader compilation will be done by the native compiler of the target platform.

How to use the Shader Translator

Releases / Maintenance

The Forge Interactive Inc. 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 or we contributed to:

Supergiant Games Hades

Supergiant's Hades we are working with Supergiant since 2014. One of the on-going challenges was that their run-time was written in C#. At the beginning of last year, we suggested to help them in building a new cross-platform game engine in C/C++ from scratch with The Forge. The project started in April 2019 and the first version of this new engine launched in May this year. Hades was then released for Microsoft Windows, macOS, and Nintendo Switch on September 17, 2020. The game can run on all platforms supported by The Forge.

Here is a screenshot of Hades running on Switch:

Here is an article by Forbes about Hades being at the top of the Nintendo Switch Charts.Hades is also a technology showcase for Intel's integrated GPUs on macOS and Windows. The target group of the game seems to often own those GPUs.

Bethesda's Creation Engine

Bethesda based their rendering layer for their next-gen engine on The Forge. We helped integrate and optimize it.

Here is more info about this game engine:

Todd Howard Teases Bethesda's New Game Engine Behind The Elder Scrolls 6 And Starfield

Bethesda's overhauling its engine for Starfield and The Elder Scrolls 6

StarVR One SDK

The Forge is used to build the StarVR One SDK:

Torque 3D

The Forge will be used as the rendering framework in 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.

Writing Guidelines

For contributions to The Forge we apply the following writing guidelines:

  • We limit all code to C++ 11 by setting the Clang and other compiler flags
  • We follow the [Orthodox C++ guidelines] (https://gist.github.com/bkaradzic/2e39896bc7d8c34e042b) minus C++ 14 support (see above)
  • Please note that we are going to move towards C99 usage more and more because this language makes it easier to develop high-performance applications in a team. With the increased call numbers of modern APIs and the always performance-detoriating C++ features, C++ is becoming more and more a productivity and run-time performance challenge. C is also a better starting point to port to other languages like RUST. In case any of those languages become common in development.

User Group Meetings

There will be a user group meeting during GDC. In case you want to organize a user group meeting in your country / town at any other point in time, we would like to support this. We could send an engineer for a talk.

Support for Education

In case your School / College / University uses The Forge for education, we would like to support this as well. We could send an engineer or help create material. So far the following schools use The Forge for teaching:

Breda University of Applied Sciences

        Contact:
        Jeremiah van Oosten 
        Monseigneur Hopmansstraat 1
        4817 JT Breda

Ontario Tech University

        Contact:
        Andrew Hogue
        Ontario Tech University
        SIRC 4th floor
        2000 Simcoe St N
        Oshawa, ON, L1H 7K4

Open-Source Libraries

The Forge utilizes the following Open-Source libraries:

  • 问题及步骤描述: 根据Electron官网步骤进行打包时: npx @electron-forge/cli import 命令提示: √ Checking your system It looks like you are missing some dependencies you need to get Electron running. Make sure you have git inst

  • 项目场景: 近期在研究人脸算法,需要用到dlib库,已经在window环境中正常跑通代码,准备把程序部署到服务器上,却卡在了安装dlib库上,耗费了大半天时间,特地记录一下纪念耗费掉的时间。 问题描述: anaconda已经正常安装,按照常规操作进行pip安装: pip install dlib 报错信息如下: … – Using CMake version: 3.20.5 – Compilin

  • conda install -c conda-forge jupyter_contrib_nbextensions Collecting package metadata (current_repodata.json): done Solving environment: done > WARNING: A newer version of conda exists. < current vers

  • 现象 安装electron-forge和electron-forge init 项目均中出现 deprecate s3@4.4.0 › graceful-fs@~3.0.5 please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js deprecate zip-folde

  • 写在前面 折腾了一晚上,终于搞定了用conda-forge安装Apple优化之后的TensorFlow啦!真的太不容易了…一开始我是不想折腾的,后来才发现直接用bash安装的Python虚拟环境使用起来有很多不方便的地方,而且就算很多软件包可以通过源码编译的方式安装到虚拟环境,但是还是有那么几个不配合的软件包安装不了…就比如sklearn,人家官网上明确说了: For Apple Silicon

 相关资料
  • The-pit-of-the-Android-Studio 老卢独家整理Android Studio的填坑指南 以下是本文档的主要内容: �� 1️⃣ Android Studio版本号、Gradle版本、Build Tools 三者的对照关系表; Cmake版本对照表; Kotlin有关的Gradle插件版本对照表; Support包版本对照表; AndroidX和Support库版本对照表;

  • 问题内容: I am using . I have a which updates my two other tables. I have read the Stack over flow this link enter link description here , but it does not full fill my needs. Below is my Below error is sh

  • 描述 (Description) 基础网格系统通过页面最多可扩展到12列。 网格系统用于通过一系列容纳内容的行和列来创建页面布局。 网格选项 下表简要介绍了Foundation网格系统如何在多个设备中工作。 小型设备电话(<640px) 中型设备平板电脑(> = 640px) 大型设备笔记本电脑和台式机(> = 1200px) Grid behavior Horizontal at all tim

  • The Mole是一款自动化的SQL注入漏洞利用工具。只需提供一个URL和一个可用的关键字,它就能够检测注入点并利用。The Mole可以使用union注入技术和基于逻辑查询的注入技术。

  • 开发者都或多或少接触过 linux 接触过命令行,当然肯定也都被命令行狠狠地“fuck”过。我很多时候都是微不足道的原因导致了命令行出错,例如将 python 输入成 ptyhon,例如将 ls -alh 输入成 ls a-lh而导致出错,这个时候我会想说:“fuck”。 起源 开发 thefuck 的这位同仁,恐怕也经常会有这种不和谐的情况。因此开发了这个软件 thefuck。 thefuck

  • The Modal 是个 jQuery 对话框插件,类似 Facebook 和 VK 照片 modals。 功能 不需要额外的标记 用户可以使用它 w/o 标记来打开空 modal 和填充数据 可选 ESC 关闭(默认启用) 在线演示