• Stars
    star
    224
  • Rank 177,792 (Top 4 %)
  • Language
    C++
  • License
    MIT License
  • Created almost 9 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

DirectX 11 library that provides convenient access to compute-based triangle filtering (CTF)

AMD GeometryFX

AMD GeometryFX

The GeometryFX library provides convenient access to compute-based triangle filtering (CTF), which improves triangle throughput by filtering out triangles that do not contribute to the final image using a compute-preprocess.

Latest release

Prerequisites

  • AMD Radeon™ GCN-based GPU (HD 7000 series or newer)
    • Or other DirectX® 11 compatible discrete GPU with Shader Model 5 support
  • 64-bit Windows® 7 (SP1 with the Platform Update), Windows® 8.1, or Windows® 10
  • Visual Studio® 2015, or Visual Studio® 2017

Getting started

  • Visual Studio solutions for VS2015 and VS2017 can be found in the amd_geometryfx_sample\build directory.
  • There are also solutions for just the core library in the amd_geometryfx\build directory.

How GeometryFX Works

GeometryFX improves the rasterizer efficiency by culling triangles that do not contribute to the output in a pre-pass. This allows the full chip to be used to process geometry, and ensures that the rasterizer only processes triangles that are visible.

A good use case for the GeometryFX library is depth-only rendering of opaque geometry – for example, in shadow maps:

  • Depth-only rendering leaves most compute units idle, which can be used by GeometryFX.
  • Opaque geometry has no ordering requirements, so GeometryFX can cull triangles in arbitrary order and regroup/split draw calls.
  • All geometry can be rendered using the same vertex shader, which allows the GeometryFX library to merge draw calls for maximum efficiency

At its core, GeometryFX works by generating an intermediate index buffer which consists of visible triangles only. Intermediate buffers are reused as much as possible to minimize memory usage. GeometryFX also buffers up draw calls to execute the filtering on one batch while the previous batch is being rendered, allowing the filtering to overlap with the actual draw call.

The library makes heavy use of multi-draw indirect. This is a DirectX 11 driver extension exposed through the AMD GPU Services (AGS) library. It allows multiple draw calls to be prepared on the GPU and executed with a single API call. For more information on AGS, including samples, visit the AGS SDK repository on GitHub.

The Filters

GeometryFX comes with several built-in filters:

  • Backface culling: This is generally the most efficient filter, which removes back-facing triangles. In order to avoid clipping, the culling is performed in homogeneous coordinates.
  • Small primitive filtering: Triangles which are guaranteed to not hit a sample are removed. This filter tests the bounding box of the triangle against the sample grid, and requires the triangle to be projected.
  • Frustum culling: Cull triangles against the view frustum. While most games perform per-object culling, this filter runs per-triangle.
  • Cluster culling: Filter complete clusters of triangles before going into per-triangle filtering.

The filters are executed in a compute shader which writes the new index buffer and the draw calls for each batch.

Integration

Applications which want to integrate GeometryFX as-is are expected to allocate all static geometry through GeometryFX. The API exposes a function to obtain the storage location, which can be used for normal rendering of the geometry. Notice that GeometryFX will aggressively pool all data to allow as many draw calls as possible to be served from the same buffer.

At run-time, the application has to provide the view/projection matrix to GeometryFX and the list of objects that have to be rendered. Once everything has been submitted, GeometryFX will execute the filtering and rendering.

Learn More

Premake

The Visual Studio solutions and projects in this repo were generated with Premake. If you need to regenerate the Visual Studio files, double-click on gpuopen_geometryfx_update_vs_files.bat in the premake directory.

For Visual Studio 2015 and 2017, this version of Premake adds the WindowsTargetPlatformVersion element to the project file to specify which version of the Windows SDK will be used. To change WindowsTargetPlatformVersion for Visual Studio 2015 and 2017, change the value for _AMD_WIN_SDK_VERSION in premake\amd_premake_util.lua and regenerate the Visual Studio files.

Third-Party Software

  • DXUT is distributed under the terms of the MIT License. See framework\d3d11\dxut\MIT.txt.
  • Premake is distributed under the terms of the BSD License. See premake\LICENSE.txt.
  • The Open Asset Import Library (assimp) is distributed under the terms of the BSD License. See third_party\assimp\LICENSE.

DXUT and assimp are only used by the sample, not the core library. Only first-party software (specifically ags_lib, amd_geometryfx, and amd_lib) is needed to build the GeometryFX library.

Attribution

  • AMD, the AMD Arrow logo, Radeon, and combinations thereof are either registered trademarks or trademarks of Advanced Micro Devices, Inc. in the United States and/or other countries.
  • Microsoft, DirectX, Visual Studio, and Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries.

More Repositories

1

FidelityFX-FSR

FidelityFX Super Resolution
C
2,037
star
2

FidelityFX-FSR2

FidelityFX Super Resolution 2
C
1,924
star
3

TressFX

DirectX 12 and Vulkan libraries that provide convenient access to realistically rendered and simulated hair and fur
C++
771
star
4

FEMFX

C++
467
star
5

FidelityFX

A set of AMD provided GPU effects with provided source and sample implementations
365
star
6

FidelityFX-SSSR

Stochastic Screen Space Reflections (SSSR)
C
278
star
7

FidelityFX-CLI

FidelityFX CLI
C
205
star
8

FidelityFX-CAS

Contrast Adaptive Sharpening (CAS)
C
201
star
9

FidelityFX-SPD

Single Pass Downsampler (SPD)
Objective-C
183
star
10

ShadowFX

DirectX 11 and 12 library that provides a scalable and GCN-optimized solution for deferred shadow filtering
C++
165
star
11

FidelityFX-CACAO

Combined Adaptive Compute Ambient Occlusion (CACAO)
C++
143
star
12

FidelityFX-Denoiser

FidelityFX Denoiser
C
141
star
13

FidelityFX-ParallelSort

FidelityFX Parallel Sort
C
105
star
14

FidelityFX-FSR-Unity-URP

FidelityFX FSR 1.0 for the Unity URP
104
star
15

FidelityFX-FSR2-Unity-URP

FidelityFX FSR 2 for the Unity URP
C++
98
star
16

DepthOfFieldFX

DirectX 11 library that provides a GCN-optimized Compute Shader implementation of Depth of Field
C++
87
star
17

FidelityFX-LPM

Luma Preserving Mapper (LPM)
C
87
star
18

Hybrid-Shadows

A sample demonstrating hybrid ray tracing and rasterisation for shadow rendering and use of the FidelityFX Denoiser.
C++
59
star
19

FidelityFX-VariableShading

FidelityFX Variable Shading
C
52
star
20

Hybrid-Stochastic-Reflections

A sample demonstrating hybrid ray tracing and rasterisation for reflections.
Batchfile
52
star