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

Overview

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.
You might also like...
Convenient generic print() for C
Convenient generic print() for C

generic-print Convenient generic print() for C inspired by Python/JavaScript and other high-level languages. Still using printf("%i\n", result) for de

Random for modern C++ with convenient API

Random for modern C++ with convenient API Design goals Supported compilers Integration Five-minute tutorial Number range Common type number range Char

Small and convenient C2 tool for Windows targets
Small and convenient C2 tool for Windows targets

Micro Backdoor for Windows Micro Backdoor is C2 tool for Windows targets with easy customizable code base and small footprint. Micro Backdoor consists

Memory Process File System (MemProcFS) is an easy and convenient way of viewing physical memory as files in a virtual file system
Memory Process File System (MemProcFS) is an easy and convenient way of viewing physical memory as files in a virtual file system

The Memory Process File System (MemProcFS) is an easy and convenient way of viewing physical memory as files in a virtual file system.

Just a repository convenient for reviewing and retrieval practice.

The-art-of-multiprocessor-programming Purpose Just a repository convenient for reviewing and retrieval practice. The architecture of this repository(H

Convenient, high-performance RGB color and position control for console output
Convenient, high-performance RGB color and position control for console output

Oof (omnipotent output friend) It's common for C++ programs to write output to the console. But consoles are far more capable than what they are usual

xsnip - a minimal and convenient screenshot utility for X11

xsnip - a minimal and convenient screenshot utility for X11 Most screenshot utilities compatible with X are clumsy, use bloated toolkits, and often do

A slightly safer io access library

SaferIO About SaferIO is an easy to use slightly more safe IO access library. Features Access IO ports, MSRs, physical memory, and PCI configuration s

This is a simple filter that will block any attempt to access streams beginning with

Triggering the notification only requires that you visit a particular path on an NTFS volume.

Comments
  • Crashes after finding the default resolution won't fit on screen

    Crashes after finding the default resolution won't fit on screen

    I've tried the sample it just crashes on my system. The cause is, that DXUTChangeDevice is called twice internally, which somehow crashes the sample. I haven't digged further into that.

    However, DXUTChangeDevice is called twice because the default resolution of 1024x1024 set in GeometryFX_Sample.cpp, line 487 and line 492 doesn't fit on a 1080p resolution with the windows Taskbar and Window-Titlebar. Reducing the height bypasses the issue.

    Sadly, the sample then just crashes anyways because I have no AMD-Card in my system, but that is an issue I have been expecting.

    opened by ataulien 9
  • Poor performance in the sample

    Poor performance in the sample

    Enabling filtering nearly doubles frame time on the sample. I'm not sure whether this is normal or not considering the mesh used, but maybe it would be a good idea to have a "stress test" sample to showcase the performance gain.

    opened by jesta88 4
  • reserved identifier violation

    reserved identifier violation

    I would like to point out that an identifier like "__AMD_GEOMETRYFX_FILTERING_H__" does not fit to the expected naming convention of the C++ language standard. Would you like to adjust your selection for unique names?

    opened by elfring 4
  • Can this library handle Alpha Testing?

    Can this library handle Alpha Testing?

    I thought about using this library, but I'm not entirely sure how it culls it's geometry. So I was wandering if it can handle Alpha testing well enough for scenes with large amounts of cutouts.

    opened by moonshineTheleocat 1
Releases(v1.2.0)
  • v1.2.0(Jun 3, 2016)

    Release Notes

    This release adds cluster culling, which processes whole clusters of triangles and culls them before going into the per-primitive culling pipeline.

    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
    • Microsoft Visual C++® 2013 Redistributable to run the binary (GeometryFX_Sample_v1.2.0_binary.zip)
      • See redist for installer, if needed
    • Visual Studio® 2012, Visual Studio® 2013, or Visual Studio® 2015 to build from source
      • Visual Studio is not needed if you just want to run the binary (GeometryFX_Sample_v1.2.0_binary.zip)
    Source code(tar.gz)
    Source code(zip)
    GeometryFX_Sample_v1.2.0_binary.zip(27.86 MB)
  • v1.1.0(Mar 4, 2016)

    geometryfx_thumbnail

    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.

    Release Notes

    Initial release on GitHub.

    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
    • Microsoft Visual C++® 2012 Redistributable to run the binary (GeometryFX_v1.1.0_binary.zip)
      • See redist for installer, if needed
    • Visual Studio® 2012, Visual Studio® 2013, or Visual Studio® 2015 to build from source
      • Visual Studio is not needed if you just want to run the binary (GeometryFX_v1.1.0_binary.zip)
    Source code(tar.gz)
    Source code(zip)
    GeometryFX_v1.1.0_binary.zip(27.90 MB)
Owner
GPUOpen Effects
Real-time visual effects from the GPUOpen initiative
GPUOpen Effects
GPU 3D signed distance field generator, written with DirectX 11 compute shader

GPU SDF Generator GPU 3D signed distance field generator, written with DirectX 11 compute shader Building git clone --recursive https://github.com/Air

Z Guan 30 Dec 13, 2022
Problem set of the final contest from CTF COMPFEST 13

CTF COMPFEST 13 - Final This repository contains the problem set of final contest from CTF COMPFEST 13. Table of Contents Problem Title Author Categor

CTF COMPFEST 8 Oct 11, 2022
Project to create a teensy based gamecube controller with hall effect sensors, snapback filtering, and notch calibration

PhobGCC Gamecube controller motherboard using a teensy as the microcontroller. Aim is to make an accessible and consistent controller. Has the option

null 95 Dec 31, 2022
Invariant-ekf - C++ library to implement invariant extended Kalman filtering for aided inertial navigation.

inekf This repository contains a C++ library that implements an invariant extended Kalman filter (InEKF) for 3D aided inertial navigation. This filter

Ross Hartley 273 Dec 24, 2022
Application firewall PoC with filtering performed in the kernel, for Linux.

Voi Application firewall with filtering performed in the kernel, for Linux. Status Currently just scaffolding code No where near ready for a productio

Marc 7 Sep 15, 2022
A python library to run metal compute kernels on MacOS

metalcompute for Python A python library to run metal compute kernels on MacOS Usage Example execution from M1-based Mac running MacOS 12.0: > ./build

Andrew Baldwin 21 Nov 7, 2022
Wgeo, or "wi-fi geolocator", is a cross-platform C/C++ library for wifi-based device geolocation, utilising public wireless access point location databases

wgeo Wgeo, or "wi-fi geolocator", is a cross-platform C/C++ library for wifi-based device geolocation, utilising public wireless access point location

Xavier Maruff 2 Dec 23, 2022
JavaScript runtime for Fastly Compute@Edge

Fastly Compute@Edge JS Runtime The JS Compute Runtime for Fastly's Compute@Edge platform provides the environment JavaScript is executed in when using

Fastly 122 Dec 20, 2022
PoC of Swift for Compute@Edge

FastlyEdgeExample An example project to deploy Swift code to Fastly's Compute@Edge Requirements SwiftWasm toolchain fastly CLI How to deploy $ fastly

Yuta Saito 11 May 21, 2022
FastPath_MP: An FPGA-based multi-path architecture for direct access from FPGA to NVMe SSD

FastPath_MP Description This repository stores the source code of FastPath_MP, an FPGA-based multi-path architecture for direct access from FPGA to NV

Beehive lab 21 Sep 12, 2022