mrgreywater / TressFX

DirectX 11 library that provides convenient access to realistically rendered and simulated hair and fur

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AMD TressFX

AMD TressFX

The TressFX library implements AMD's TressFX hair/fur rendering and simulation technology for DirectX 11. The TressFX technology uses the GPU to simulate and render high-quality, realistic hair and fur. TressFX makes use of the processing power of high-performance GPUs to do realistic rendering and utilizes DirectCompute to physically simulate each individual strand of hair.

Latest release

Highlights include the following:

  • GCN-optimized rendering and simulation
  • Full source code provided
  • Hair and fur support
  • Animation/skinning support
  • Maya plugin provided for authoring
  • Viewer provided for preview
  • PPLL and "ShortCut" OIT methods

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® 2012, Visual Studio® 2013, or Visual Studio® 2015

Getting started

Start with the TressFX viewer to see example content or to check out the code.

  • Visual Studio solutions for VS2012, VS2013, and VS2015 can be found in the amd_tressfx_viewer\build directory.
  • There are also solutions for just the core library in the amd_tressfx\build directory.
  • Additional documentation is available in the amd_tressfx\doc and amd_tressfx_viewer\doc directories.
  • Pre-exported example models ready for use in the viewer can be found in the amd_tressfx_viewer\media directory.
    • Look for DEFAULT_TFXPROJFILENAME near the top of main.cpp to start up with a different model.
    • Or you can load a different model after start-up with the "(O)pen project" button.

For authoring new content, documentation for the Maya exporter is available in the amd_tressfx_tools\MayaPlugin\doc directory.

ShortCut

ShortCut is our new Order Independent Transparency (OIT) option. It is inspired by the method presented by Eidos-Montréal and Hybrid Transparency. Whereas our original method focused on the front k = 8 layers of hair, ShortCut is good for cases when you can get away with k = 2 or 3, and you’re more concerned about memory usage.

It does require some forethought on how to build your models, however, as it comes with different performance characteristics, and a quality trade-off. But between the simpler memory bounds and the potential for higher performance, we expect it to be a popular choice.

The four main steps are outlined below:

  1. Render hair geometry, using a sequence of InterlockedMin calls to update the list of k nearest fragments while computing an overall alpha.
  2. Screen space pass that puts the kth nearest depth in the depth buffer for early z culling in the next step.
  3. Render hair geometry again. Shade the fragment and write or blend the color (depending on variant). [earlydepthstencil] focuses shading cost on the front k.
  4. Screen space pass that does the final blending.

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_tressfx_update_vs_files.bat in the premake directory.

This version of Premake has been modified from the stock version to use the property sheet technique for the Windows SDK from this Visual C++ Team blog post. The technique was originally described for using the Windows 8.0 SDK with Visual Studio 2010, but it applies more generally to using newer versions of the Windows SDK with older versions of Visual Studio.

The default SDK for a particular version of Visual Studio (for 2012 or higher) is installed as part of Visual Studio installation. This default (Windows 8.0 SDK for Visual Studio 2012 and Windows 8.1 SDK for Visual Studio 2013) will be used if newer SDKs do not exist on the user's machine. However, the projects generated with this version of Premake will use the next higher SDK (Windows 8.1 SDK for Visual Studio 2012 and Windows 10 SDK with Visual Studio 2013), if the newer SDKs exist on the user's machine.

For Visual Studio 2015, 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, 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.
  • ContentExporter is distributed under the terms of the MIT License. See amd_tressfx_tools\ContentExporter\src\LICENSE
  • Premake is distributed under the terms of the BSD License. See premake\LICENSE.txt.

DXUT and ContentExporter are only needed for the viewer, not the core library. Only first-party software (specifically amd_tressfx, and amd_lib) is needed to build the TressFX 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.

About

DirectX 11 library that provides convenient access to realistically rendered and simulated hair and fur

License:MIT License


Languages

Language:C++ 95.0%Language:HLSL 3.8%Language:C 0.4%Language:Assembly 0.3%Language:Lua 0.2%Language:Python 0.1%Language:Batchfile 0.1%Language:SourcePawn 0.1%