Home

Awesome

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.

<div> <a href="https://github.com/GPUOpen-Effects/GeometryFX/releases/latest/"><img src="http://gpuopen-effects.github.io/media/latest-release-button.svg" alt="Latest release" title="Latest release"></a> </div>

Prerequisites

Getting started

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:

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:

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