• Stars
    star
    201
  • Rank 194,491 (Top 4 %)
  • Language
    C
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 3 years ago

Reviews

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

Repository Details

Contrast Adaptive Sharpening (CAS)

FidelityFX CAS (Contrast Adaptive Sharpening) v1.0

Copyright (c) 2020 Advanced Micro Devices, Inc. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Contrast Adaptive Sharpening (CAS)

Contrast Adaptive Sharpening (CAS) is a low overhead adaptive sharpening algorithm with optional up-sampling. The technique is developed by Timothy Lottes (creator of FXAA) and was created to provide natural sharpness without artifacts. This directory contains the source code for CAS as well as samples demonstrating the technique (with source). The directory structure is as follows:

  • sample contains the source code for the above 2 CAS samples
  • media is a submodule which contains the art assets for the above CAS samples
  • ffx-cas contains the headers that implement the CAS algorithm

You can find the binaries for CAS in the releases section on GitHub.

Build Instructions

The CAS samples are written in C++ and require CMake and Visual Studio to be built. To build the samples, follow the below steps:

  • Run sample\build\GenerateSolutions.bat which creates the sample\build\DX12 and sample\build\VK folders
  • Go into sample\build\DX12 or sample\build\VK and open the CAS_Sample_DX12\VK.sln files
  • Build the project and run it (you should see a 3D helmet).

Running Instructions

When running the samples, you can use the below options to test different configurations of CAS:

  • You can make the demo full screen via Alt+Enter. You can set the render resolution which decides how much CAS will have to upscale the image when CAS is enabled (without enabling, it’s a naïve upscale). The GUI will also let you choose different CAS modes (sharpen only or up-sample) with packed and unpacked versions.
  • You can use the q, w and e keys to set different CAS modes. q sets it to no CAS, w sets it to up-sampling, and e sets it to sharpen only.
  • The code implementing CAS can be found in FFX_CAS\cas-samples\src

You can find the documentation for the CAS algorithm and how to implement it using the FFX CAS headers at ffx-cas\ffx_cas.h.

Command Line Tool

There is also a command line tool to allow you to test the effects of FidelityFX CAS on standalone image files such as screenshots from your game, allowing you to evaluate it before integration. Please see the FidelityFX-CLI project for more details.

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

GeometryFX

DirectX 11 library that provides convenient access to compute-based triangle filtering (CTF)
C++
224
star
8

FidelityFX-CLI

FidelityFX CLI
C
205
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