├── .gitignore ├── .gitlab-ci.yml ├── .gitmodules ├── LICENSE.txt ├── README.md ├── ffx-cas ├── ffx_a.h └── ffx_cas.h └── sample ├── CMakeLists.txt ├── build ├── .gitignore └── GenerateSolutions.bat ├── common.cmake ├── media ├── BoomBox │ ├── README.md │ └── glTF │ │ ├── BoomBox.bin │ │ ├── BoomBox.gltf │ │ ├── BoomBox_baseColor.png │ │ ├── BoomBox_emissive.png │ │ ├── BoomBox_normal.png │ │ └── BoomBox_occlusionRoughnessMetallic.png ├── DamagedHelmet │ ├── README.md │ ├── glTF │ │ ├── DamagedHelmet.bin │ │ ├── DamagedHelmet.gltf │ │ ├── Default_AO.jpg │ │ ├── Default_albedo.jpg │ │ ├── Default_emissive.jpg │ │ ├── Default_metalRoughness.jpg │ │ └── Default_normal.jpg │ └── screenshot │ │ └── screenshot.png ├── MetalRoughSpheres │ ├── README.md │ ├── glTF │ │ ├── MetalRoughSpheres.gltf │ │ ├── MetalRoughSpheres0.bin │ │ ├── Spheres_BaseColor.png │ │ └── Spheres_MetalRough.png │ └── screenshot │ │ └── screenshot.png ├── NOTICES.txt ├── SciFiHelmet │ ├── README.md │ ├── glTF │ │ ├── SciFiHelmet.bin │ │ ├── SciFiHelmet.gltf │ │ ├── SciFiHelmet_AmbientOcclusion.png │ │ ├── SciFiHelmet_BaseColor.png │ │ ├── SciFiHelmet_MetallicRoughness.png │ │ └── SciFiHelmet_Normal.png │ └── screenshot │ │ └── screenshot.jpg ├── Sponza │ ├── README.md │ ├── glTF │ │ ├── 10381718147657362067.jpg │ │ ├── 10388182081421875623.jpg │ │ ├── 11474523244911310074.jpg │ │ ├── 11490520546946913238.jpg │ │ ├── 11872827283454512094.jpg │ │ ├── 11968150294050148237.jpg │ │ ├── 1219024358953944284.jpg │ │ ├── 12501374198249454378.jpg │ │ ├── 13196865903111448057.jpg │ │ ├── 13824894030729245199.jpg │ │ ├── 13982482287905699490.jpg │ │ ├── 14118779221266351425.jpg │ │ ├── 14170708867020035030.jpg │ │ ├── 14267839433702832875.jpg │ │ ├── 14650633544276105767.jpg │ │ ├── 15295713303328085182.jpg │ │ ├── 15722799267630235092.jpg │ │ ├── 16275776544635328252.png │ │ ├── 16299174074766089871.jpg │ │ ├── 16885566240357350108.jpg │ │ ├── 17556969131407844942.jpg │ │ ├── 17876391417123941155.jpg │ │ ├── 2051777328469649772.jpg │ │ ├── 2185409758123873465.jpg │ │ ├── 2299742237651021498.jpg │ │ ├── 2374361008830720677.jpg │ │ ├── 2411100444841994089.jpg │ │ ├── 2775690330959970771.jpg │ │ ├── 2969916736137545357.jpg │ │ ├── 332936164838540657.jpg │ │ ├── 3371964815757888145.jpg │ │ ├── 3455394979645218238.jpg │ │ ├── 3628158980083700836.jpg │ │ ├── 3827035219084910048.jpg │ │ ├── 4477655471536070370.jpg │ │ ├── 4601176305987539675.jpg │ │ ├── 466164707995436622.jpg │ │ ├── 4675343432951571524.jpg │ │ ├── 4871783166746854860.jpg │ │ ├── 4910669866631290573.jpg │ │ ├── 4975155472559461469.jpg │ │ ├── 5061699253647017043.png │ │ ├── 5792855332885324923.jpg │ │ ├── 5823059166183034438.jpg │ │ ├── 6047387724914829168.jpg │ │ ├── 6151467286084645207.jpg │ │ ├── 6593109234861095314.jpg │ │ ├── 6667038893015345571.jpg │ │ ├── 6772804448157695701.jpg │ │ ├── 7056944414013900257.jpg │ │ ├── 715093869573992647.jpg │ │ ├── 7268504077753552595.jpg │ │ ├── 7441062115984513793.jpg │ │ ├── 755318871556304029.jpg │ │ ├── 759203620573749278.jpg │ │ ├── 7645212358685992005.jpg │ │ ├── 7815564343179553343.jpg │ │ ├── 8006627369776289000.png │ │ ├── 8051790464816141987.jpg │ │ ├── 8114461559286000061.jpg │ │ ├── 8481240838833932244.jpg │ │ ├── 8503262930880235456.jpg │ │ ├── 8747919177698443163.jpg │ │ ├── 8750083169368950601.jpg │ │ ├── 8773302468495022225.jpg │ │ ├── 8783994986360286082.jpg │ │ ├── 9288698199695299068.jpg │ │ ├── 9916269861720640319.jpg │ │ ├── Sponza.bin │ │ ├── Sponza.gltf │ │ └── white.png │ └── screenshot │ │ ├── large.jpg │ │ └── screenshot.jpg ├── buster_drone │ ├── Assets │ │ └── Models │ │ │ └── Public │ │ │ └── BusterDrone │ │ │ └── Materials │ │ │ ├── body_AO.jpg │ │ │ ├── body_albedo2048.png │ │ │ ├── body_emissive.jpg │ │ │ ├── body_metalgloss2048_converted_metalRoughness.jpg │ │ │ ├── body_normal.jpg │ │ │ ├── concrete_044_metalGloss_converted_metalRoughness.jpg │ │ │ ├── concrete_044_normal1024.jpg │ │ │ ├── concrete_diffuseOpacity.png │ │ │ ├── leg_AO.jpg │ │ │ ├── leg_albedo.jpg │ │ │ ├── leg_metalgloss_converted_metalRoughness.jpg │ │ │ └── leg_normal1024.jpg │ ├── LICENSE.md │ ├── busterDrone.bin │ └── busterDrone.gltf ├── envmaps │ └── papermill │ │ ├── README.md │ │ ├── diffuse.dds │ │ └── specular.dds ├── readme.md └── screenshot.png └── src ├── DX12 ├── CAS_CS.cpp ├── CAS_CS.h ├── CAS_RenderPS.hlsl ├── CAS_Renderer.cpp ├── CAS_Renderer.h ├── CAS_Sample.cpp ├── CAS_Sample.h ├── CAS_Shader.hlsl ├── CMakeLists.txt ├── dpiawarescaling.manifest ├── stdafx.cpp └── stdafx.h └── VK ├── CAS_CS.cpp ├── CAS_CS.h ├── CAS_RenderPS.glsl ├── CAS_Renderer.cpp ├── CAS_Renderer.h ├── CAS_Sample.cpp ├── CAS_Sample.h ├── CAS_Shader.glsl ├── CMakeLists.txt ├── dpiawarescaling.manifest ├── stdafx.cpp └── stdafx.h /.gitignore: -------------------------------------------------------------------------------- 1 | FFX_CAS/cas-samples/bin/ 2 | 3 | FFX_CAS/cas-samples/build/DX12/ 4 | 5 | FFX_CAS/cas-samples/build/VK/ 6 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | SampleName: CAS_Sample 3 | GIT_SUBMODULE_STRATEGY: normal 4 | 5 | stages: 6 | - build 7 | - deploy 8 | 9 | build_dx12: 10 | tags: 11 | - windows 12 | - amd64 13 | stage: build 14 | artifacts: 15 | paths: 16 | - sample/bin/ 17 | script: 18 | - 'cmake -S sample -B sample/build/DX12 -G "Visual Studio 15 2017" -A x64 -DGFX_API=DX12' 19 | - 'cmake --build sample/build/DX12 --config Release' 20 | 21 | build_vk: 22 | tags: 23 | - windows 24 | - amd64 25 | stage: build 26 | artifacts: 27 | paths: 28 | - sample/bin/ 29 | script: 30 | - 'cmake -S sample -B sample/build/VK -G "Visual Studio 15 2017" -A x64 -DGFX_API=VK' 31 | - 'cmake --build sample/build/VK --config Release' 32 | 33 | package_sample: 34 | tags: 35 | - windows 36 | - amd64 37 | stage: deploy 38 | dependencies: 39 | - build_dx12 40 | - build_vk 41 | script: 42 | - echo "Packaging build" 43 | - copy %VULKAN_SDK%\Bin\glslc.exe .\sample\bin 44 | - echo cd .\sample\bin\ > %SampleName%_VK.bat 45 | - echo start %SampleName%_VK.exe >> %SampleName%_VK.bat 46 | - echo cd .\sample\bin\ > %SampleName%_DX12.bat 47 | - echo start %SampleName%_DX12.exe >> %SampleName%_DX12.bat 48 | artifacts: 49 | name: "%SampleName%-%CI_COMMIT_TAG%-%CI_COMMIT_REF_NAME%-%CI_COMMIT_SHORT_SHA%" 50 | paths: 51 | - "NOTICES.txt" 52 | - "sample/bin/" 53 | - "sample/media/" 54 | - "docs/" 55 | - "readme.md" 56 | - "%SampleName%_VK.bat" 57 | - "%SampleName%_DX12.bat" 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "sample/libs/cauldron"] 2 | path = sample/libs/cauldron 3 | url = ../../GPUOpen-LibrariesAndSDKs/Cauldron.git 4 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Advanced Micro Devices, Inc. All rights reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FidelityFX CAS (Contrast Adaptive Sharpening) v1.0 2 | 3 | Copyright (c) 2020 Advanced Micro Devices, Inc. All rights reserved. 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | THE SOFTWARE. 19 | 20 | ## Contrast Adaptive Sharpening (CAS) 21 | 22 | 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: 23 | 24 | - [sample](sample) contains the source code for the above 2 CAS samples 25 | - media is a submodule which contains the art assets for the above CAS samples 26 | - [ffx-cas](ffx-cas) contains the headers that implement the CAS algorithm 27 | 28 | You can find the binaries for CAS in the [releases](https://github.com/GPUOpen-Effects/FidelityFX-CAS/releases) section on GitHub. 29 | 30 | ## Build Instructions 31 | 32 | The CAS samples are written in C++ and require CMake and Visual Studio to be built. To build the samples, follow the below steps: 33 | 34 | - Run [sample\build\GenerateSolutions.bat](sample/build/GenerateSolutions.bat) which creates the `sample\build\DX12` and `sample\build\VK` folders 35 | - Go into `sample\build\DX12` or `sample\build\VK` and open the `CAS_Sample_DX12\VK.sln` files 36 | - Build the project and run it (you should see a 3D helmet). 37 | 38 | ## Running Instructions 39 | 40 | When running the samples, you can use the below options to test different configurations of CAS: 41 | 42 | - 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. 43 | - 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. 44 | - The code implementing CAS can be found in FFX_CAS\cas-samples\src 45 | 46 | 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](ffx-cas/ffx_cas.h). 47 | 48 | ## Command Line Tool 49 | 50 | 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](https://github.com/GPUOpen-Effects/FidelityFX-CLI) project for more details. 51 | -------------------------------------------------------------------------------- /sample/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # CAS Sample 2 | # 3 | # Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. 4 | # Permission is hereby granted, free of charge, to any person obtaining a copy 5 | # of this software and associated documentation files (the "Software"), to deal 6 | # in the Software without restriction, including without limitation the rights 7 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | # copies of the Software, and to permit persons to whom the Software is 9 | # furnished to do so, subject to the following conditions: 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | # THE SOFTWARE. 19 | 20 | cmake_minimum_required(VERSION 3.4) 21 | set(CMAKE_GENERATOR_PLATFORM x64) 22 | 23 | project (CAS_Sample_${GFX_API}) 24 | 25 | # ouput exe to bin directory 26 | SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/bin) 27 | foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} ) 28 | string( TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIG ) 29 | set( CMAKE_RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIG} ${CMAKE_HOME_DIRECTORY}/bin ) 30 | endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES ) 31 | 32 | # reference libs used by both backends 33 | add_subdirectory(libs/cauldron) 34 | 35 | set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME}) 36 | 37 | if(GFX_API STREQUAL DX12) 38 | add_subdirectory(src/DX12) 39 | elseif(GFX_API STREQUAL VK) 40 | find_package(Vulkan REQUIRED) 41 | add_subdirectory(src/VK) 42 | else() 43 | message(STATUS "----------------------------------------------------------------------------------------") 44 | message(STATUS "") 45 | message(STATUS "** Almost there!!") 46 | message(STATUS "") 47 | message(STATUS " This framework supports DX12 or VULKAN, you need to invoke cmake in one of these ways:") 48 | message(STATUS "") 49 | message(STATUS " Examples:") 50 | message(STATUS " cmake -DGFX_API=DX12") 51 | message(STATUS " cmake -DGFX_API=VK") 52 | message(STATUS "") 53 | message(STATUS "----------------------------------------------------------------------------------------") 54 | message(FATAL_ERROR "") 55 | endif() -------------------------------------------------------------------------------- /sample/build/.gitignore: -------------------------------------------------------------------------------- 1 | DX12/ 2 | VK/ -------------------------------------------------------------------------------- /sample/build/GenerateSolutions.bat: -------------------------------------------------------------------------------- 1 | echo off 2 | 3 | REM CAS Sample 4 | REM 5 | REM Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. 6 | REM Permission is hereby granted, free of charge, to any person obtaining a copy 7 | REM of this software and associated documentation files (the "Software"), to deal 8 | REM in the Software without restriction, including without limitation the rights 9 | REM to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | REM copies of the Software, and to permit persons to whom the Software is 11 | REM furnished to do so, subject to the following conditions: 12 | REM The above copyright notice and this permission notice shall be included in 13 | REM all copies or substantial portions of the Software. 14 | REM THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | REM IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | REM FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | REM AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | REM LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | REM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | REM THE SOFTWARE. 21 | 22 | mkdir DX12 23 | cd DX12 24 | cmake ..\.. -DGFX_API=DX12 25 | cd .. 26 | 27 | mkdir VK 28 | cd VK 29 | cmake ..\.. -DGFX_API=VK 30 | cd .. -------------------------------------------------------------------------------- /sample/common.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # enables multithreading compilation 3 | # 4 | 5 | add_compile_options(/MP) 6 | 7 | # 8 | # includes cauldron's helper cmakes 9 | # 10 | include(${CMAKE_CURRENT_SOURCE_DIR}/../../libs/cauldron/common.cmake) 11 | 12 | # 13 | # Add manifest so the app uses the right DPI settings 14 | # 15 | function(addManifest PROJECT_NAME) 16 | IF (MSVC) 17 | IF (CMAKE_MAJOR_VERSION LESS 3) 18 | MESSAGE(WARNING "CMake version 3.0 or newer is required use build variable TARGET_FILE") 19 | ELSE() 20 | ADD_CUSTOM_COMMAND( 21 | TARGET ${PROJECT_NAME} 22 | POST_BUILD 23 | COMMAND "mt.exe" -manifest \"${CMAKE_CURRENT_SOURCE_DIR}\\dpiawarescaling.manifest\" -inputresource:\"$\"\;\#1 -outputresource:\"$\"\;\#1 24 | COMMENT "Adding display aware manifest..." 25 | ) 26 | ENDIF() 27 | ENDIF(MSVC) 28 | endfunction() -------------------------------------------------------------------------------- /sample/media/BoomBox/README.md: -------------------------------------------------------------------------------- 1 | # Boom Box 2 | 3 | ## License Information 4 | 5 | [![CC0](http://i.creativecommons.org/p/zero/1.0/88x31.png)](http://creativecommons.org/publicdomain/zero/1.0/) 6 | To the extent possible under law, Microsoft has waived all copyright and related or neighboring rights to this asset. 7 | -------------------------------------------------------------------------------- /sample/media/BoomBox/glTF/BoomBox.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/BoomBox/glTF/BoomBox.bin -------------------------------------------------------------------------------- /sample/media/BoomBox/glTF/BoomBox.gltf: -------------------------------------------------------------------------------- 1 | { 2 | "accessors": [ 3 | { 4 | "bufferView": 0, 5 | "byteOffset": 0, 6 | "componentType": 5126, 7 | "count": 3575, 8 | "type": "VEC2", 9 | "max": [ 10 | 0.9999003, 11 | -0.0221377648 12 | ], 13 | "min": [ 14 | 0.0006585993, 15 | -0.996773958 16 | ] 17 | }, 18 | { 19 | "bufferView": 1, 20 | "byteOffset": 0, 21 | "componentType": 5126, 22 | "count": 3575, 23 | "type": "VEC3", 24 | "max": [ 25 | 1.0, 26 | 1.0, 27 | 0.9999782 28 | ], 29 | "min": [ 30 | -1.0, 31 | -1.0, 32 | -0.9980823 33 | ] 34 | }, 35 | { 36 | "bufferView": 2, 37 | "byteOffset": 0, 38 | "componentType": 5126, 39 | "count": 3575, 40 | "type": "VEC4", 41 | "max": [ 42 | 1.0, 43 | 0.9999976, 44 | 1.0, 45 | 1.0 46 | ], 47 | "min": [ 48 | -0.9991289, 49 | -0.999907851, 50 | -1.0, 51 | 1.0 52 | ] 53 | }, 54 | { 55 | "bufferView": 3, 56 | "byteOffset": 0, 57 | "componentType": 5126, 58 | "count": 3575, 59 | "type": "VEC3", 60 | "max": [ 61 | 0.009921154, 62 | 0.00977163, 63 | 0.0100762453 64 | ], 65 | "min": [ 66 | -0.009921154, 67 | -0.00977163, 68 | -0.0100762453 69 | ] 70 | }, 71 | { 72 | "bufferView": 4, 73 | "byteOffset": 0, 74 | "componentType": 5123, 75 | "count": 18108, 76 | "type": "SCALAR", 77 | "max": [ 78 | 3574 79 | ], 80 | "min": [ 81 | 0 82 | ] 83 | } 84 | ], 85 | "asset": { 86 | "generator": "glTF Tools for Unity", 87 | "version": "2.0" 88 | }, 89 | "bufferViews": [ 90 | { 91 | "buffer": 0, 92 | "byteOffset": 0, 93 | "byteLength": 28600 94 | }, 95 | { 96 | "buffer": 0, 97 | "byteOffset": 28600, 98 | "byteLength": 42900 99 | }, 100 | { 101 | "buffer": 0, 102 | "byteOffset": 71500, 103 | "byteLength": 57200 104 | }, 105 | { 106 | "buffer": 0, 107 | "byteOffset": 128700, 108 | "byteLength": 42900 109 | }, 110 | { 111 | "buffer": 0, 112 | "byteOffset": 171600, 113 | "byteLength": 36216 114 | } 115 | ], 116 | "buffers": [ 117 | { 118 | "uri": "BoomBox.bin", 119 | "byteLength": 207816 120 | } 121 | ], 122 | "images": [ 123 | { 124 | "uri": "BoomBox_baseColor.png" 125 | }, 126 | { 127 | "uri": "BoomBox_occlusionRoughnessMetallic.png" 128 | }, 129 | { 130 | "uri": "BoomBox_normal.png" 131 | }, 132 | { 133 | "uri": "BoomBox_emissive.png" 134 | } 135 | ], 136 | "meshes": [ 137 | { 138 | "primitives": [ 139 | { 140 | "attributes": { 141 | "TEXCOORD_0": 0, 142 | "NORMAL": 1, 143 | "TANGENT": 2, 144 | "POSITION": 3 145 | }, 146 | "indices": 4, 147 | "material": 0, 148 | "mode": 4 149 | } 150 | ], 151 | "name": "BoomBox" 152 | } 153 | ], 154 | "materials": [ 155 | { 156 | "pbrMetallicRoughness": { 157 | "baseColorTexture": { 158 | "index": 0 159 | }, 160 | "metallicRoughnessTexture": { 161 | "index": 1 162 | } 163 | }, 164 | "normalTexture": { 165 | "index": 2 166 | }, 167 | "occlusionTexture": { 168 | "index": 1 169 | }, 170 | "emissiveFactor": [ 171 | 1.0, 172 | 1.0, 173 | 1.0 174 | ], 175 | "emissiveTexture": { 176 | "index": 3 177 | }, 178 | "name": "BoomBox_Mat" 179 | } 180 | ], 181 | "nodes": [ 182 | { 183 | "children": [], 184 | "mesh": 0, 185 | "scale": [ 186 | 80.0, 187 | 80.0, 188 | 80.0 189 | ], 190 | "translation": [ 191 | 0.0, 192 | 0.163, 193 | 0.053 194 | ], 195 | "rotation" : [ 196 | 0.0, 197 | 1, 198 | 0.0, 199 | 0.0 200 | ], 201 | "name": "BoomBox" 202 | } 203 | ], 204 | "samplers": [ 205 | {} 206 | ], 207 | "scene": 0, 208 | "scenes": [ 209 | { 210 | "nodes": [ 211 | 0 212 | ] 213 | } 214 | ], 215 | "textures": [ 216 | { 217 | "sampler": 0, 218 | "source": 0 219 | }, 220 | { 221 | "sampler": 0, 222 | "source": 1 223 | }, 224 | { 225 | "sampler": 0, 226 | "source": 2 227 | }, 228 | { 229 | "sampler": 0, 230 | "source": 3 231 | } 232 | ] 233 | } -------------------------------------------------------------------------------- /sample/media/BoomBox/glTF/BoomBox_baseColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/BoomBox/glTF/BoomBox_baseColor.png -------------------------------------------------------------------------------- /sample/media/BoomBox/glTF/BoomBox_emissive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/BoomBox/glTF/BoomBox_emissive.png -------------------------------------------------------------------------------- /sample/media/BoomBox/glTF/BoomBox_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/BoomBox/glTF/BoomBox_normal.png -------------------------------------------------------------------------------- /sample/media/BoomBox/glTF/BoomBox_occlusionRoughnessMetallic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/BoomBox/glTF/BoomBox_occlusionRoughnessMetallic.png -------------------------------------------------------------------------------- /sample/media/DamagedHelmet/README.md: -------------------------------------------------------------------------------- 1 | # Damaged Helmet 2 | 3 | ## Screenshot 4 | 5 | ![screenshot](screenshot/screenshot.png) 6 | 7 | ## License Information 8 | 9 | Battle Damaged Sci-fi Helmet - PBR by [theblueturtle_](https://sketchfab.com/theblueturtle_), published under a Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) 10 | 11 | https://sketchfab.com/models/b81008d513954189a063ff901f7abfe4 12 | 13 | ## Modifications 14 | 15 | The original model was built on an early draft of glTF 2.0 that did not become final. This new model has been imported and re-exported from Blender to bring it into alignment with the final release glTF 2.0 specification. 16 | -------------------------------------------------------------------------------- /sample/media/DamagedHelmet/glTF/DamagedHelmet.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/DamagedHelmet/glTF/DamagedHelmet.bin -------------------------------------------------------------------------------- /sample/media/DamagedHelmet/glTF/DamagedHelmet.gltf: -------------------------------------------------------------------------------- 1 | { 2 | "accessors" : [ 3 | { 4 | "bufferView" : 0, 5 | "componentType" : 5123, 6 | "count" : 46356, 7 | "max" : [ 8 | 14358 9 | ], 10 | "min" : [ 11 | 0 12 | ], 13 | "type" : "SCALAR" 14 | }, 15 | { 16 | "bufferView" : 1, 17 | "componentType" : 5126, 18 | "count" : 14359, 19 | "max" : [ 20 | 0.9449769854545593, 21 | 1.0, 22 | 0.9009739756584167 23 | ], 24 | "min" : [ 25 | -0.9449769854545593, 26 | -1.0, 27 | -0.9009950160980225 28 | ], 29 | "type" : "VEC3" 30 | }, 31 | { 32 | "bufferView" : 2, 33 | "componentType" : 5126, 34 | "count" : 14359, 35 | "max" : [ 36 | 1.0, 37 | 1.0, 38 | 1.0 39 | ], 40 | "min" : [ 41 | -1.0, 42 | -1.0, 43 | -1.0 44 | ], 45 | "type" : "VEC3" 46 | }, 47 | { 48 | "bufferView" : 3, 49 | "componentType" : 5126, 50 | "count" : 14359, 51 | "max" : [ 52 | 0.9999759793281555, 53 | 1.998665988445282 54 | ], 55 | "min" : [ 56 | 0.002448640065267682, 57 | 1.0005531199858524 58 | ], 59 | "type" : "VEC2" 60 | } 61 | ], 62 | "asset" : { 63 | "generator" : "Khronos Blender glTF 2.0 exporter", 64 | "version" : "2.0" 65 | }, 66 | "bufferViews" : [ 67 | { 68 | "buffer" : 0, 69 | "byteLength" : 92712, 70 | "byteOffset" : 0, 71 | "target" : 34963 72 | }, 73 | { 74 | "buffer" : 0, 75 | "byteLength" : 172308, 76 | "byteOffset" : 92712, 77 | "target" : 34962 78 | }, 79 | { 80 | "buffer" : 0, 81 | "byteLength" : 172308, 82 | "byteOffset" : 265020, 83 | "target" : 34962 84 | }, 85 | { 86 | "buffer" : 0, 87 | "byteLength" : 114872, 88 | "byteOffset" : 437328, 89 | "target" : 34962 90 | } 91 | ], 92 | "buffers" : [ 93 | { 94 | "byteLength" : 552200, 95 | "uri" : "DamagedHelmet.bin" 96 | } 97 | ], 98 | "images" : [ 99 | { 100 | "uri" : "Default_albedo.jpg" 101 | }, 102 | { 103 | "uri" : "Default_normal.jpg" 104 | }, 105 | { 106 | "uri" : "Default_metalRoughness.jpg" 107 | }, 108 | { 109 | "uri" : "Default_emissive.jpg" 110 | }, 111 | { 112 | "uri" : "Default_AO.jpg" 113 | } 114 | ], 115 | "materials" : [ 116 | { 117 | "emissiveFactor" : [ 118 | 1.0, 119 | 1.0, 120 | 1.0 121 | ], 122 | "emissiveTexture" : { 123 | "index" : 3 124 | }, 125 | "name" : "glTF Material", 126 | "normalTexture" : { 127 | "index" : 1 128 | }, 129 | "occlusionTexture" : { 130 | "index" : 4 131 | }, 132 | "pbrMetallicRoughness" : { 133 | "baseColorTexture" : { 134 | "index" : 0 135 | }, 136 | "metallicRoughnessTexture" : { 137 | "index" : 2 138 | } 139 | } 140 | } 141 | ], 142 | "meshes" : [ 143 | { 144 | "name" : "mesh_helmet_LP_13930damagedHelmet", 145 | "primitives" : [ 146 | { 147 | "attributes" : { 148 | "NORMAL" : 2, 149 | "POSITION" : 1, 150 | "TEXCOORD_0" : 3 151 | }, 152 | "indices" : 0, 153 | "material" : 0 154 | } 155 | ] 156 | } 157 | ], 158 | "nodes" : [ 159 | { 160 | "mesh" : 0, 161 | "name" : "node_damagedHelmet_-6514", 162 | "rotation" : [ 163 | 0.0, 164 | 0.7071068286895752, 165 | -0.7071068286895752, 166 | 0.0 167 | ] 168 | } 169 | ], 170 | "samplers" : [ 171 | {} 172 | ], 173 | "scene" : 0, 174 | "scenes" : [ 175 | { 176 | "name" : "Scene", 177 | "nodes" : [ 178 | 0 179 | ] 180 | } 181 | ], 182 | "textures" : [ 183 | { 184 | "sampler" : 0, 185 | "source" : 0 186 | }, 187 | { 188 | "sampler" : 0, 189 | "source" : 1 190 | }, 191 | { 192 | "sampler" : 0, 193 | "source" : 2 194 | }, 195 | { 196 | "sampler" : 0, 197 | "source" : 3 198 | }, 199 | { 200 | "sampler" : 0, 201 | "source" : 4 202 | } 203 | ] 204 | } 205 | -------------------------------------------------------------------------------- /sample/media/DamagedHelmet/glTF/Default_AO.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/DamagedHelmet/glTF/Default_AO.jpg -------------------------------------------------------------------------------- /sample/media/DamagedHelmet/glTF/Default_albedo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/DamagedHelmet/glTF/Default_albedo.jpg -------------------------------------------------------------------------------- /sample/media/DamagedHelmet/glTF/Default_emissive.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/DamagedHelmet/glTF/Default_emissive.jpg -------------------------------------------------------------------------------- /sample/media/DamagedHelmet/glTF/Default_metalRoughness.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/DamagedHelmet/glTF/Default_metalRoughness.jpg -------------------------------------------------------------------------------- /sample/media/DamagedHelmet/glTF/Default_normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/DamagedHelmet/glTF/Default_normal.jpg -------------------------------------------------------------------------------- /sample/media/DamagedHelmet/screenshot/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/DamagedHelmet/screenshot/screenshot.png -------------------------------------------------------------------------------- /sample/media/MetalRoughSpheres/README.md: -------------------------------------------------------------------------------- 1 | # Metal-Rough Spheres 2 | 3 | ## Screenshot 4 | 5 | ![screenshot](screenshot/screenshot.png) 6 | 7 | ## License Information 8 | 9 | Copyright 2017 Analytical Graphics, Inc. 10 | CC-BY 4.0 https://creativecommons.org/licenses/by/4.0/ 11 | Model and textures by Ed Mackey. 12 | -------------------------------------------------------------------------------- /sample/media/MetalRoughSpheres/glTF/MetalRoughSpheres.gltf: -------------------------------------------------------------------------------- 1 | { 2 | "asset": { 3 | "copyright": "Copyright 2017 Analytical Graphics, Inc, CC-BY 4.0 https://creativecommons.org/licenses/by/4.0/ - Model and textures by Ed Mackey.", 4 | "generator": "COLLADA2GLTF with hand-edits", 5 | "version": "2.0" 6 | }, 7 | "scene": 0, 8 | "scenes": [ 9 | { 10 | "nodes": [ 11 | 0 12 | ] 13 | } 14 | ], 15 | "nodes": [ 16 | { 17 | "children": [ 18 | 5, 19 | 4, 20 | 3, 21 | 2, 22 | 1 23 | ], 24 | "matrix": [ 25 | -0.4, 0.0, 0.0, 0.0, 26 | 0.0, 0.0, 0.4, 0.0, 27 | 0.0, 0.4, 0.0, 0.0, 28 | 0.0, 0.0, 0.0, 1.0 29 | ] 30 | }, 31 | { 32 | "mesh": 0 33 | }, 34 | { 35 | "mesh": 1 36 | }, 37 | { 38 | "mesh": 2 39 | }, 40 | { 41 | "mesh": 3 42 | }, 43 | { 44 | "mesh": 4 45 | } 46 | ], 47 | "meshes": [ 48 | { 49 | "primitives": [ 50 | { 51 | "attributes": { 52 | "NORMAL": 1, 53 | "POSITION": 2, 54 | "TEXCOORD_0": 3 55 | }, 56 | "indices": 0, 57 | "mode": 4, 58 | "material": 0 59 | } 60 | ], 61 | "name": "Spheres.004" 62 | }, 63 | { 64 | "primitives": [ 65 | { 66 | "attributes": { 67 | "NORMAL": 5, 68 | "POSITION": 6, 69 | "TEXCOORD_0": 7 70 | }, 71 | "indices": 4, 72 | "mode": 4, 73 | "material": 0 74 | } 75 | ], 76 | "name": "Spheres.003" 77 | }, 78 | { 79 | "primitives": [ 80 | { 81 | "attributes": { 82 | "NORMAL": 9, 83 | "POSITION": 10, 84 | "TEXCOORD_0": 11 85 | }, 86 | "indices": 8, 87 | "mode": 4, 88 | "material": 0 89 | } 90 | ], 91 | "name": "Spheres.002" 92 | }, 93 | { 94 | "primitives": [ 95 | { 96 | "attributes": { 97 | "NORMAL": 13, 98 | "POSITION": 14, 99 | "TEXCOORD_0": 15 100 | }, 101 | "indices": 12, 102 | "mode": 4, 103 | "material": 0 104 | } 105 | ], 106 | "name": "Spheres.001" 107 | }, 108 | { 109 | "primitives": [ 110 | { 111 | "attributes": { 112 | "NORMAL": 17, 113 | "POSITION": 18, 114 | "TEXCOORD_0": 19 115 | }, 116 | "indices": 16, 117 | "mode": 4, 118 | "material": 0 119 | } 120 | ], 121 | "name": "Spheres" 122 | } 123 | ], 124 | "accessors": [ 125 | { 126 | "bufferView": 0, 127 | "byteOffset": 2642016, 128 | "componentType": 5123, 129 | "count": 184320, 130 | "max": [ 131 | 31331 132 | ], 133 | "min": [ 134 | 0 135 | ], 136 | "type": "SCALAR" 137 | }, 138 | { 139 | "bufferView": 1, 140 | "byteOffset": 5389968, 141 | "componentType": 5126, 142 | "count": 31332, 143 | "max": [ 144 | 0.9999999403953552, 145 | 1.0, 146 | 1.0 147 | ], 148 | "min": [ 149 | -0.9999999403953552, 150 | -1.0, 151 | -1.0 152 | ], 153 | "type": "VEC3" 154 | }, 155 | { 156 | "bufferView": 1, 157 | "byteOffset": 5765952, 158 | "componentType": 5126, 159 | "count": 31332, 160 | "max": [ 161 | -8.0, 162 | 9.0, 163 | 10.0 164 | ], 165 | "min": [ 166 | -10.0, 167 | -1.0, 168 | -7.0 169 | ], 170 | "type": "VEC3" 171 | }, 172 | { 173 | "bufferView": 2, 174 | "byteOffset": 1796656, 175 | "componentType": 5126, 176 | "count": 31332, 177 | "max": [ 178 | 0.1278132051229477, 179 | 0.7597609758377075 180 | ], 181 | "min": [ 182 | 0.03436123952269554, 183 | 0.013921022415161133 184 | ], 185 | "type": "VEC2" 186 | }, 187 | { 188 | "bufferView": 0, 189 | "byteOffset": 0, 190 | "componentType": 5123, 191 | "count": 368640, 192 | "max": [ 193 | 62663 194 | ], 195 | "min": [ 196 | 0 197 | ], 198 | "type": "SCALAR" 199 | }, 200 | { 201 | "bufferView": 1, 202 | "byteOffset": 0, 203 | "componentType": 5126, 204 | "count": 62664, 205 | "max": [ 206 | 0.9999999403953552, 207 | 1.0, 208 | 1.0 209 | ], 210 | "min": [ 211 | -0.9999999403953552, 212 | -1.0, 213 | -1.0 214 | ], 215 | "type": "VEC3" 216 | }, 217 | { 218 | "bufferView": 1, 219 | "byteOffset": 751968, 220 | "componentType": 5126, 221 | "count": 62664, 222 | "max": [ 223 | -2.0, 224 | 9.0, 225 | 10.0 226 | ], 227 | "min": [ 228 | -7.0, 229 | -1.0, 230 | -7.0 231 | ], 232 | "type": "VEC3" 233 | }, 234 | { 235 | "bufferView": 2, 236 | "byteOffset": 0, 237 | "componentType": 5126, 238 | "count": 62664, 239 | "max": [ 240 | 0.4161497056484223, 241 | 0.7597609758377075 242 | ], 243 | "min": [ 244 | 0.15740810334682465, 245 | 0.012456059455871582 246 | ], 247 | "type": "VEC2" 248 | }, 249 | { 250 | "bufferView": 0, 251 | "byteOffset": 1904736, 252 | "componentType": 5123, 253 | "count": 368640, 254 | "max": [ 255 | 62663 256 | ], 257 | "min": [ 258 | 0 259 | ], 260 | "type": "SCALAR" 261 | }, 262 | { 263 | "bufferView": 1, 264 | "byteOffset": 3886032, 265 | "componentType": 5126, 266 | "count": 62664, 267 | "max": [ 268 | 0.9999999403953552, 269 | 1.0, 270 | 1.0 271 | ], 272 | "min": [ 273 | -0.9999999403953552, 274 | -1.0, 275 | -1.0 276 | ], 277 | "type": "VEC3" 278 | }, 279 | { 280 | "bufferView": 1, 281 | "byteOffset": 4638000, 282 | "componentType": 5126, 283 | "count": 62664, 284 | "max": [ 285 | 4.0, 286 | 9.0, 287 | 10.0 288 | ], 289 | "min": [ 290 | -1.0, 291 | -1.0, 292 | -7.0 293 | ], 294 | "type": "VEC3" 295 | }, 296 | { 297 | "bufferView": 2, 298 | "byteOffset": 1295344, 299 | "componentType": 5126, 300 | "count": 62664, 301 | "max": [ 302 | 0.7028239369392395, 303 | 0.7636672854423523 304 | ], 305 | "min": [ 306 | 0.4482637047767639, 307 | 0.015471160411834717 308 | ], 309 | "type": "VEC2" 310 | }, 311 | { 312 | "bufferView": 0, 313 | "byteOffset": 1167456, 314 | "componentType": 5123, 315 | "count": 368640, 316 | "max": [ 317 | 62663 318 | ], 319 | "min": [ 320 | 0 321 | ], 322 | "type": "SCALAR" 323 | }, 324 | { 325 | "bufferView": 1, 326 | "byteOffset": 2382096, 327 | "componentType": 5126, 328 | "count": 62664, 329 | "max": [ 330 | 0.9999999403953552, 331 | 1.0, 332 | 1.0 333 | ], 334 | "min": [ 335 | -0.9999999403953552, 336 | -1.0, 337 | -1.0 338 | ], 339 | "type": "VEC3" 340 | }, 341 | { 342 | "bufferView": 1, 343 | "byteOffset": 3134064, 344 | "componentType": 5126, 345 | "count": 62664, 346 | "max": [ 347 | 10.0, 348 | 9.0, 349 | 10.0 350 | ], 351 | "min": [ 352 | 5.0, 353 | -1.0, 354 | -7.0 355 | ], 356 | "type": "VEC3" 357 | }, 358 | { 359 | "bufferView": 2, 360 | "byteOffset": 794032, 361 | "componentType": 5126, 362 | "count": 62664, 363 | "max": [ 364 | 0.9852716326713562, 365 | 0.7671433687210083 366 | ], 367 | "min": [ 368 | 0.7233805060386658, 369 | 0.016381680965423585 370 | ], 371 | "type": "VEC2" 372 | }, 373 | { 374 | "bufferView": 0, 375 | "byteOffset": 737280, 376 | "componentType": 5123, 377 | "count": 215088, 378 | "max": [ 379 | 36589 380 | ], 381 | "min": [ 382 | 0 383 | ], 384 | "type": "SCALAR" 385 | }, 386 | { 387 | "bufferView": 1, 388 | "byteOffset": 1503936, 389 | "componentType": 5126, 390 | "count": 36590, 391 | "max": [ 392 | 0.9999999403953552, 393 | 1.0, 394 | 1.0 395 | ], 396 | "min": [ 397 | -0.9999999403953552, 398 | -1.0, 399 | -1.0 400 | ], 401 | "type": "VEC3" 402 | }, 403 | { 404 | "bufferView": 1, 405 | "byteOffset": 1943016, 406 | "componentType": 5126, 407 | "count": 36590, 408 | "max": [ 409 | 11.874730110168456, 410 | 9.0, 411 | 10.969940185546877 412 | ], 413 | "min": [ 414 | -12.186589241027832, 415 | -1.0, 416 | -12.35944938659668 417 | ], 418 | "type": "VEC3" 419 | }, 420 | { 421 | "bufferView": 2, 422 | "byteOffset": 501312, 423 | "componentType": 5126, 424 | "count": 36590, 425 | "max": [ 426 | 0.9869875311851502, 427 | 0.9988328814506532 428 | ], 429 | "min": [ 430 | 0.0013856289442628625, 431 | 0.016568005084991456 432 | ], 433 | "type": "VEC2" 434 | } 435 | ], 436 | "materials": [ 437 | { 438 | "pbrMetallicRoughness": { 439 | "baseColorTexture": { 440 | "index": 0 441 | }, 442 | "metallicRoughnessTexture": { 443 | "index": 1 444 | } 445 | }, 446 | "emissiveFactor": [ 447 | 0.0, 448 | 0.0, 449 | 0.0 450 | ] 451 | } 452 | ], 453 | "textures": [ 454 | { 455 | "sampler": 0, 456 | "source": 0 457 | }, 458 | { 459 | "sampler": 0, 460 | "source": 1 461 | } 462 | ], 463 | "images": [ 464 | { 465 | "uri": "Spheres_BaseColor.png" 466 | }, 467 | { 468 | "uri": "Spheres_MetalRough.png" 469 | } 470 | ], 471 | "samplers": [ 472 | { 473 | "magFilter": 9729, 474 | "minFilter": 9986, 475 | "wrapS": 33071, 476 | "wrapT": 33071 477 | } 478 | ], 479 | "bufferViews": [ 480 | { 481 | "buffer": 0, 482 | "byteOffset": 8189248, 483 | "byteLength": 3010656, 484 | "target": 34963 485 | }, 486 | { 487 | "buffer": 0, 488 | "byteOffset": 0, 489 | "byteLength": 6141936, 490 | "byteStride": 12, 491 | "target": 34962 492 | }, 493 | { 494 | "buffer": 0, 495 | "byteOffset": 6141936, 496 | "byteLength": 2047312, 497 | "byteStride": 8, 498 | "target": 34962 499 | } 500 | ], 501 | "buffers": [ 502 | { 503 | "byteLength": 11199904, 504 | "uri": "MetalRoughSpheres0.bin" 505 | } 506 | ] 507 | } 508 | -------------------------------------------------------------------------------- /sample/media/MetalRoughSpheres/glTF/MetalRoughSpheres0.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/MetalRoughSpheres/glTF/MetalRoughSpheres0.bin -------------------------------------------------------------------------------- /sample/media/MetalRoughSpheres/glTF/Spheres_BaseColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/MetalRoughSpheres/glTF/Spheres_BaseColor.png -------------------------------------------------------------------------------- /sample/media/MetalRoughSpheres/glTF/Spheres_MetalRough.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/MetalRoughSpheres/glTF/Spheres_MetalRough.png -------------------------------------------------------------------------------- /sample/media/MetalRoughSpheres/screenshot/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/MetalRoughSpheres/screenshot/screenshot.png -------------------------------------------------------------------------------- /sample/media/NOTICES.txt: -------------------------------------------------------------------------------- 1 | Notices and licenses file 2 | _________________________ 3 | 4 | Dependencies on www.hdrlabs.com (CC Attribution Share Alike 3.0) 5 | # PaperMill Ruins E 6 | ## License Information 7 | Free set "Papermill Ruins E" by Blochi from www.hdrlabs.com SiBL archive 8 | Licensed under Creative Commons Attribution Share Alike 3.0 license 9 | 10 | 11 | khronosgroup-gltf-sample-models v-u (CC BY 4.0) 12 | ## License Information 13 | Copyright 2017 Analytical Graphics, Inc. 14 | CC-BY 4.0 https://creativecommons.org/licenses/by/4.0/ 15 | Model and textures by Ed Mackey. 16 | 17 | 18 | khronosgroup-gltf-sample-models v-u (CC BY 4.0) 19 | ## License Information 20 | ["Sci Fi Helmet" by Michael Pavlovic](http://quixel.se/usermanual/quixelsuite/doku.php?id=ddo_samples) 21 | 22 | [Attribution 4.0 International (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/) 23 | 24 | Converted by Norbert Nopper for glTF testing. 25 | 26 | 27 | khronosgroup-gltf-sample-models v-u (CC0 1.0) 28 | ## License Information 29 | [![CC0](http://i.creativecommons.org/p/zero/1.0/88x31.png)](http://creativecommons.org/publicdomain/zero/1.0/) 30 | To the extent possible under law, Microsoft has waived all copyright and related or neighboring rights to this asset. 31 | 32 | 33 | khronosgroup-gltf-sample-models v-u (Creative Commons Attribution-ShareAlike 3.0 Unported) 34 | ## License Information 35 | 36 | Battle Damaged Sci-fi Helmet - PBR by [theblueturtle_](https://sketchfab.com/theblueturtle_), published under a Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0) 37 | https://sketchfab.com/models/b81008d513954189a063ff901f7abfe4 38 | 39 | 40 | khronosgroup-gltf-sample-models v-u (PD) 41 | ## Licensing notes 42 | 43 | Taken from copyright.txt in SponzaPBR\_Textures.rar 44 | ``` 45 | PBR textures for the Sponza model. 46 | For more informations: www.alexandre-pestana.com 47 | 48 | Original copyright: 49 | 50 | July 14, 2011 Morgan McGuire modified the model from Crytek's OBJ 51 | export to correct some small errors. He computed bump maps from the 52 | normal maps using normal2bump.cpp (since 54 | MTL files expect height bumps, not normals), put the "mask" textures 55 | into the alpha channel of the associated diffuse texture, cleaned up 56 | noise in the masks, created the missing gi_flag.tga texture, and 57 | removed the long untextured banner floating in the middle of the 58 | atrium that appears in the file but in none of the published images of 59 | the model. The banner is in banner.obj. 60 | 61 | http://www.crytek.com/cryengine/cryengine3/downloads 62 | 63 | Sponza Model 64 | August 19, 2010 65 | The Atrium Sponza Palace, Dubrovnik, is an elegant and improved model created by Frank Meinl. The original Sponza model was created by Marko Dabrovic in early 2002. Over the years, the Sponza Atrium scene has become one of the most popular 3D scenes for testing global illumination and radiosity due to it's specific architectural structure which is particularly complex for global illumination light. 66 | 67 | However, nowadays it is considered as a simple model, thus it was decided to crate a new model with highly improved appearance and scene complexity. It is donated to the public for radiosity and is represented in several different formats (3ds, Obj) for use with various commercial 3D applications and renderers. 68 | 69 | Screenshot from the I3D paper 70 | http://crytek.com/sites/default/files/20100301_lpv.pdf 71 | 72 | 73 | lavadragon-busterdrone v-u (CC BY 4.0) 74 | Buster Drone by LaVADraGoN, published under a [Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)](https://creativecommons.org/licenses/by-nc/4.0/) license -------------------------------------------------------------------------------- /sample/media/SciFiHelmet/README.md: -------------------------------------------------------------------------------- 1 | # Sci Fi Helmet 2 | ## Screenshot 3 | 4 | ![screenshot](screenshot/screenshot.jpg) 5 | 6 | 7 | ## License Information 8 | 9 | ["Sci Fi Helmet" by Michael Pavlovic](http://quixel.se/usermanual/quixelsuite/doku.php?id=ddo_samples) 10 | 11 | [Attribution 4.0 International (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/) 12 | 13 | Converted by Norbert Nopper for glTF testing. 14 | -------------------------------------------------------------------------------- /sample/media/SciFiHelmet/glTF/SciFiHelmet.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/SciFiHelmet/glTF/SciFiHelmet.bin -------------------------------------------------------------------------------- /sample/media/SciFiHelmet/glTF/SciFiHelmet.gltf: -------------------------------------------------------------------------------- 1 | { 2 | "accessors" : [ 3 | { 4 | "bufferView" : 0, 5 | "byteOffset" : 0, 6 | "componentType" : 5125, 7 | "count" : 70074, 8 | "max" : [ 9 | 70073 10 | ], 11 | "min" : [ 12 | 0 13 | ], 14 | "type" : "SCALAR" 15 | }, 16 | { 17 | "bufferView" : 1, 18 | "byteOffset" : 0, 19 | "componentType" : 5126, 20 | "count" : 70074, 21 | "max" : [ 22 | 1.1511525, 23 | 1.4587184, 24 | 1.2511277 25 | ], 26 | "min" : [ 27 | -1.1511525, 28 | -1.4587183, 29 | -1.2511287 30 | ], 31 | "type" : "VEC3" 32 | }, 33 | { 34 | "bufferView" : 2, 35 | "byteOffset" : 0, 36 | "componentType" : 5126, 37 | "count" : 70074, 38 | "max" : [ 39 | 0.99993396, 40 | 0.9998779, 41 | 0.9999757 42 | ], 43 | "min" : [ 44 | -0.99993396, 45 | -0.9999633, 46 | -0.9999864 47 | ], 48 | "type" : "VEC3" 49 | }, 50 | { 51 | "bufferView" : 3, 52 | "byteOffset" : 0, 53 | "componentType" : 5126, 54 | "count" : 70074, 55 | "max" : [ 56 | 0.9999959, 57 | 1.000000, 58 | 0.9999942, 59 | 1.000000 60 | ], 61 | "min" : [ 62 | -0.99999845, 63 | -0.99996936, 64 | -0.9999994, 65 | 1.000000 66 | ], 67 | "type" : "VEC4" 68 | }, 69 | { 70 | "bufferView" : 4, 71 | "byteOffset" : 0, 72 | "componentType" : 5126, 73 | "count" : 70074, 74 | "max" : [ 75 | 0.995369, 76 | 0.990894 77 | ], 78 | "min" : [ 79 | 0.003625, 80 | 0.0064439773 81 | ], 82 | "type" : "VEC2" 83 | } 84 | ], 85 | "asset" : { 86 | "generator" : "VKTS glTF 2.0 exporter", 87 | "version" : "2.0" 88 | }, 89 | "bufferViews" : [ 90 | { 91 | "buffer" : 0, 92 | "byteLength" : 280296, 93 | "byteOffset" : 0, 94 | "target" : 34963 95 | }, 96 | { 97 | "buffer" : 0, 98 | "byteLength" : 840888, 99 | "byteOffset" : 280296, 100 | "target" : 34962 101 | }, 102 | { 103 | "buffer" : 0, 104 | "byteLength" : 840888, 105 | "byteOffset" : 1121184, 106 | "target" : 34962 107 | }, 108 | { 109 | "buffer" : 0, 110 | "byteLength" : 1121184, 111 | "byteOffset" : 1962072, 112 | "target" : 34962 113 | }, 114 | { 115 | "buffer" : 0, 116 | "byteLength" : 560592, 117 | "byteOffset" : 3083256, 118 | "target" : 34962 119 | } 120 | ], 121 | "buffers" : [ 122 | { 123 | "byteLength" : 3643848, 124 | "uri" : "SciFiHelmet.bin" 125 | } 126 | ], 127 | "images" : [ 128 | { 129 | "uri" : "SciFiHelmet_BaseColor.png" 130 | }, 131 | { 132 | "uri" : "SciFiHelmet_MetallicRoughness.png" 133 | }, 134 | { 135 | "uri" : "SciFiHelmet_Normal.png" 136 | }, 137 | { 138 | "uri" : "SciFiHelmet_AmbientOcclusion.png" 139 | } 140 | ], 141 | "materials" : [ 142 | { 143 | "name" : "SciFiHelmet", 144 | "normalTexture" : { 145 | "index" : 2 146 | }, 147 | "occlusionTexture" : { 148 | "index" : 3 149 | }, 150 | "pbrMetallicRoughness" : { 151 | "baseColorTexture" : { 152 | "index" : 0 153 | }, 154 | "metallicRoughnessTexture" : { 155 | "index" : 1 156 | } 157 | } 158 | } 159 | ], 160 | "meshes" : [ 161 | { 162 | "name" : "SciFiHelmet", 163 | "primitives" : [ 164 | { 165 | "attributes" : { 166 | "NORMAL" : 2, 167 | "POSITION" : 1, 168 | "TANGENT" : 3, 169 | "TEXCOORD_0" : 4 170 | }, 171 | "indices" : 0, 172 | "material" : 0, 173 | "mode" : 4 174 | } 175 | ] 176 | } 177 | ], 178 | "nodes" : [ 179 | { 180 | "name" : "Camera", 181 | "rotation" : [ 182 | 0.483536, 183 | 0.336872, 184 | -0.208704, 185 | 0.780483 186 | ], 187 | "translation" : [ 188 | 7.481132, 189 | 5.343665, 190 | 6.507640 191 | ] 192 | }, 193 | { 194 | "mesh" : 0, 195 | "name" : "SciFiHelmet" 196 | } 197 | ], 198 | "samplers" : [ 199 | {} 200 | ], 201 | "scene" : 0, 202 | "scenes" : [ 203 | { 204 | "nodes" : [ 205 | 0, 206 | 1 207 | ] 208 | } 209 | ], 210 | "textures" : [ 211 | { 212 | "sampler" : 0, 213 | "source" : 0 214 | }, 215 | { 216 | "sampler" : 0, 217 | "source" : 1 218 | }, 219 | { 220 | "sampler" : 0, 221 | "source" : 2 222 | }, 223 | { 224 | "sampler" : 0, 225 | "source" : 3 226 | } 227 | ] 228 | } 229 | -------------------------------------------------------------------------------- /sample/media/SciFiHelmet/glTF/SciFiHelmet_AmbientOcclusion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/SciFiHelmet/glTF/SciFiHelmet_AmbientOcclusion.png -------------------------------------------------------------------------------- /sample/media/SciFiHelmet/glTF/SciFiHelmet_BaseColor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/SciFiHelmet/glTF/SciFiHelmet_BaseColor.png -------------------------------------------------------------------------------- /sample/media/SciFiHelmet/glTF/SciFiHelmet_MetallicRoughness.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/SciFiHelmet/glTF/SciFiHelmet_MetallicRoughness.png -------------------------------------------------------------------------------- /sample/media/SciFiHelmet/glTF/SciFiHelmet_Normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/SciFiHelmet/glTF/SciFiHelmet_Normal.png -------------------------------------------------------------------------------- /sample/media/SciFiHelmet/screenshot/screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/SciFiHelmet/screenshot/screenshot.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/README.md: -------------------------------------------------------------------------------- 1 | # Sponza 2 | 3 | ## Screenshot 4 | 5 | Lights are shown here, they are not part of the model. 6 | 7 | ![screenshot](screenshot/large.jpg) 8 | 9 | ## Model notes 10 | 11 | Tangents have been computed using MikkTSpace, as the original OBJ model did not have them. 12 | I have manually inspected the normals, and it looks correct to me. 13 | Be aware that W is -1.0 for most of the tangent signs, you will need to handle tangent W for correct results. 14 | 15 | 16 | ## Sources 17 | 18 | ### http://www.crytek.com/cryengine/cryengine3/downloads 19 | - http://www.crytek.com/download/sponza\_obj.rar 20 | - http://www.crytek.com/download/sponza\_textures.rar 21 | 22 | ### http://www.alexandre-pestana.com/pbr-textures-sponza/ 23 | - http://www.alexandre-pestana.com/downloads/SponzaPBR\_Textures.rar 24 | 25 | I needed to resize some of the alpha mask textures to the 1024x1024 resolution used by the new texture pack, 26 | and merge in diffuse with alpha. 27 | I also repacked the separate metallic/roughness textures into the glTF layout (G - roughness, B - metallic). 28 | The images are also re-encoded as PNG instead of TGA. 29 | All the materials also had a constant diffuse factor of about 0.58. I assume it was supposed to be there, so I kept it. 30 | I also ran the vertices and indices through a mesh optimizer. 31 | 32 | ## Licensing notes 33 | 34 | Taken from copyright.txt in SponzaPBR\_Textures.rar 35 | 36 | ``` 37 | PBR textures for the Sponza model. 38 | For more informations: www.alexandre-pestana.com 39 | 40 | 41 | Original copyright: 42 | 43 | July 14, 2011 Morgan McGuire modified the model from Crytek's OBJ 44 | export to correct some small errors. He computed bump maps from the 45 | normal maps using normal2bump.cpp (since 47 | MTL files expect height bumps, not normals), put the "mask" textures 48 | into the alpha channel of the associated diffuse texture, cleaned up 49 | noise in the masks, created the missing gi_flag.tga texture, and 50 | removed the long untextured banner floating in the middle of the 51 | atrium that appears in the file but in none of the published images of 52 | the model. The banner is in banner.obj. 53 | 54 | 55 | 56 | http://www.crytek.com/cryengine/cryengine3/downloads 57 | 58 | 59 | Sponza Model 60 | August 19, 2010 61 | The Atrium Sponza Palace, Dubrovnik, is an elegant and improved model created by Frank Meinl. The original Sponza model was created by Marko Dabrovic in early 2002. Over the years, the Sponza Atrium scene has become one of the most popular 3D scenes for testing global illumination and radiosity due to it's specific architectural structure which is particularly complex for global illumination light. 62 | 63 | However, nowadays it is considered as a simple model, thus it was decided to crate a new model with highly improved appearance and scene complexity. It is donated to the public for radiosity and is represented in several different formats (3ds, Obj) for use with various commercial 3D applications and renderers. 64 | 65 | 66 | Screenshot from the I3D paper 67 | http://crytek.com/sites/default/files/20100301_lpv.pdf 68 | ``` 69 | -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/10381718147657362067.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/10381718147657362067.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/10388182081421875623.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/10388182081421875623.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/11474523244911310074.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/11474523244911310074.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/11490520546946913238.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/11490520546946913238.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/11872827283454512094.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/11872827283454512094.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/11968150294050148237.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/11968150294050148237.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/1219024358953944284.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/1219024358953944284.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/12501374198249454378.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/12501374198249454378.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/13196865903111448057.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/13196865903111448057.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/13824894030729245199.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/13824894030729245199.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/13982482287905699490.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/13982482287905699490.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/14118779221266351425.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/14118779221266351425.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/14170708867020035030.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/14170708867020035030.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/14267839433702832875.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/14267839433702832875.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/14650633544276105767.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/14650633544276105767.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/15295713303328085182.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/15295713303328085182.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/15722799267630235092.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/15722799267630235092.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/16275776544635328252.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/16275776544635328252.png -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/16299174074766089871.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/16299174074766089871.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/16885566240357350108.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/16885566240357350108.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/17556969131407844942.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/17556969131407844942.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/17876391417123941155.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/17876391417123941155.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/2051777328469649772.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/2051777328469649772.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/2185409758123873465.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/2185409758123873465.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/2299742237651021498.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/2299742237651021498.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/2374361008830720677.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/2374361008830720677.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/2411100444841994089.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/2411100444841994089.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/2775690330959970771.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/2775690330959970771.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/2969916736137545357.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/2969916736137545357.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/332936164838540657.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/332936164838540657.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/3371964815757888145.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/3371964815757888145.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/3455394979645218238.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/3455394979645218238.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/3628158980083700836.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/3628158980083700836.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/3827035219084910048.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/3827035219084910048.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/4477655471536070370.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/4477655471536070370.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/4601176305987539675.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/4601176305987539675.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/466164707995436622.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/466164707995436622.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/4675343432951571524.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/4675343432951571524.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/4871783166746854860.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/4871783166746854860.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/4910669866631290573.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/4910669866631290573.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/4975155472559461469.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/4975155472559461469.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/5061699253647017043.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/5061699253647017043.png -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/5792855332885324923.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/5792855332885324923.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/5823059166183034438.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/5823059166183034438.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/6047387724914829168.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/6047387724914829168.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/6151467286084645207.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/6151467286084645207.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/6593109234861095314.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/6593109234861095314.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/6667038893015345571.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/6667038893015345571.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/6772804448157695701.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/6772804448157695701.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/7056944414013900257.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/7056944414013900257.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/715093869573992647.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/715093869573992647.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/7268504077753552595.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/7268504077753552595.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/7441062115984513793.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/7441062115984513793.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/755318871556304029.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/755318871556304029.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/759203620573749278.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/759203620573749278.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/7645212358685992005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/7645212358685992005.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/7815564343179553343.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/7815564343179553343.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/8006627369776289000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/8006627369776289000.png -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/8051790464816141987.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/8051790464816141987.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/8114461559286000061.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/8114461559286000061.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/8481240838833932244.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/8481240838833932244.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/8503262930880235456.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/8503262930880235456.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/8747919177698443163.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/8747919177698443163.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/8750083169368950601.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/8750083169368950601.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/8773302468495022225.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/8773302468495022225.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/8783994986360286082.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/8783994986360286082.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/9288698199695299068.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/9288698199695299068.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/9916269861720640319.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/9916269861720640319.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/Sponza.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/Sponza.bin -------------------------------------------------------------------------------- /sample/media/Sponza/glTF/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/glTF/white.png -------------------------------------------------------------------------------- /sample/media/Sponza/screenshot/large.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/screenshot/large.jpg -------------------------------------------------------------------------------- /sample/media/Sponza/screenshot/screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/Sponza/screenshot/screenshot.jpg -------------------------------------------------------------------------------- /sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/body_AO.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/body_AO.jpg -------------------------------------------------------------------------------- /sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/body_albedo2048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/body_albedo2048.png -------------------------------------------------------------------------------- /sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/body_emissive.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/body_emissive.jpg -------------------------------------------------------------------------------- /sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/body_metalgloss2048_converted_metalRoughness.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/body_metalgloss2048_converted_metalRoughness.jpg -------------------------------------------------------------------------------- /sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/body_normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/body_normal.jpg -------------------------------------------------------------------------------- /sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/concrete_044_metalGloss_converted_metalRoughness.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/concrete_044_metalGloss_converted_metalRoughness.jpg -------------------------------------------------------------------------------- /sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/concrete_044_normal1024.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/concrete_044_normal1024.jpg -------------------------------------------------------------------------------- /sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/concrete_diffuseOpacity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/concrete_diffuseOpacity.png -------------------------------------------------------------------------------- /sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/leg_AO.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/leg_AO.jpg -------------------------------------------------------------------------------- /sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/leg_albedo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/leg_albedo.jpg -------------------------------------------------------------------------------- /sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/leg_metalgloss_converted_metalRoughness.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/leg_metalgloss_converted_metalRoughness.jpg -------------------------------------------------------------------------------- /sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/leg_normal1024.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/buster_drone/Assets/Models/Public/BusterDrone/Materials/leg_normal1024.jpg -------------------------------------------------------------------------------- /sample/media/buster_drone/LICENSE.md: -------------------------------------------------------------------------------- 1 | Buster Drone by LaVADraGoN, published under a [Attribution-NonCommercial 4.0 International (CC BY-NC 4.0)](https://creativecommons.org/licenses/by-nc/4.0/) license 2 | 3 | https://sketchfab.com/models/294e79652f494130ad2ab00a13fdbafd 4 | 5 | https://sketchfab.com/lavadragon 6 | -------------------------------------------------------------------------------- /sample/media/buster_drone/busterDrone.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/buster_drone/busterDrone.bin -------------------------------------------------------------------------------- /sample/media/envmaps/papermill/README.md: -------------------------------------------------------------------------------- 1 | # PaperMill Ruins E 2 | 3 | 4 | ## License Information 5 | 6 | Free set "Papermill Ruins E" by Blochi from www.hdrlabs.com SiBL archive 7 | 8 | Licensed under Creative Commons Attribution Share Alike 3.0 license 9 | -------------------------------------------------------------------------------- /sample/media/envmaps/papermill/diffuse.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/envmaps/papermill/diffuse.dds -------------------------------------------------------------------------------- /sample/media/envmaps/papermill/specular.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/envmaps/papermill/specular.dds -------------------------------------------------------------------------------- /sample/media/readme.md: -------------------------------------------------------------------------------- 1 | # Cauldron-media 2 | 3 | These are the media files needed by the following SDK samples 4 | 5 | - [glTFSample](https://github.com/GPUOpen-LibrariesAndSDKs/glTFSample), a sample aplication featuring the [Cauldron framework](https://github.com/GPUOpen-LibrariesAndSDKs/Cauldron) 6 | 7 | ## Samples 8 | 9 | Here are a few screenshots of glTFSample using some of the models: 10 | 11 | ![Screenshot](screenshot.png) 12 | -------------------------------------------------------------------------------- /sample/media/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GPUOpen-Effects/FidelityFX-CAS/9fabcc9a2c45f958aff55ddfda337e74ef894b7f/sample/media/screenshot.png -------------------------------------------------------------------------------- /sample/src/DX12/CAS_CS.cpp: -------------------------------------------------------------------------------- 1 | #//CAS Sample 2 | // 3 | // Copyright(c) 2019 Advanced Micro Devices, Inc.All rights reserved. 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files(the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions : 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 15 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | // THE SOFTWARE. 19 | 20 | #include "stdafx.h" 21 | #include "CAS_CS.h" 22 | 23 | // CAS 24 | #define A_CPU 25 | #include "ffx_a.h" 26 | #include "ffx_cas.h" 27 | 28 | namespace CAS_SAMPLE_DX12 29 | { 30 | void CAS_Filter::OnCreate( 31 | Device *pDevice, 32 | ResourceViewHeaps *pResourceViewHeaps, 33 | DynamicBufferRing *pConstantBufferRing, 34 | StaticBufferPool *pStaticBufferPool, 35 | DXGI_FORMAT outFormat 36 | ) 37 | { 38 | m_pResourceViewHeaps = pResourceViewHeaps; 39 | m_pConstantBufferRing = pConstantBufferRing; 40 | m_outFormat = outFormat; 41 | m_pDevice = pDevice; 42 | 43 | m_pResourceViewHeaps->AllocCBV_SRV_UAVDescriptor(1, &m_constBuffer); 44 | m_pResourceViewHeaps->AllocCBV_SRV_UAVDescriptor(1, &m_outputTextureUav); 45 | m_pResourceViewHeaps->AllocCBV_SRV_UAVDescriptor(1, &m_outputTextureSrv); 46 | 47 | D3D12_STATIC_SAMPLER_DESC SamplerDesc = {}; 48 | SamplerDesc.Filter = D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT; 49 | SamplerDesc.AddressU = D3D12_TEXTURE_ADDRESS_MODE_CLAMP; 50 | SamplerDesc.AddressV = D3D12_TEXTURE_ADDRESS_MODE_CLAMP; 51 | SamplerDesc.AddressW = D3D12_TEXTURE_ADDRESS_MODE_CLAMP; 52 | SamplerDesc.ComparisonFunc = D3D12_COMPARISON_FUNC_ALWAYS; 53 | SamplerDesc.BorderColor = D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK; 54 | SamplerDesc.MinLOD = 0.0f; 55 | SamplerDesc.MaxLOD = D3D12_FLOAT32_MAX; 56 | SamplerDesc.MipLODBias = 0; 57 | SamplerDesc.MaxAnisotropy = 1; 58 | SamplerDesc.ShaderRegister = 0; 59 | SamplerDesc.RegisterSpace = 0; 60 | SamplerDesc.ShaderVisibility = D3D12_SHADER_VISIBILITY_PIXEL; 61 | 62 | DefineList defines; 63 | defines["CAS_SAMPLE_FP16"] = "0"; 64 | defines["CAS_SAMPLE_SHARPEN_ONLY"] = "0"; 65 | 66 | if (pDevice->IsFp16Supported()) 67 | { 68 | defines["CAS_SAMPLE_FP16"] = "1"; 69 | 70 | defines["CAS_SAMPLE_SHARPEN_ONLY"] = "1"; 71 | m_casPackedSharpenOnly.OnCreate(pDevice, pResourceViewHeaps, "CAS_Shader.hlsl", "mainCS", 1, 1, 64, 1, 1, &defines); 72 | 73 | defines["CAS_SAMPLE_SHARPEN_ONLY"] = "0"; 74 | m_casPackedFast.OnCreate(pDevice, pResourceViewHeaps, "CAS_Shader.hlsl", "mainCS", 1, 1, 64, 1, 1, &defines); 75 | } 76 | 77 | defines["CAS_SAMPLE_FP16"] = "0"; 78 | 79 | defines["CAS_SAMPLE_SHARPEN_ONLY"] = "1"; 80 | m_casSharpenOnly.OnCreate(pDevice, pResourceViewHeaps, "CAS_Shader.hlsl", "mainCS", 1, 1, 64, 1, 1, &defines); 81 | 82 | defines["CAS_SAMPLE_SHARPEN_ONLY"] = "0"; 83 | m_casFast.OnCreate(pDevice, pResourceViewHeaps, "CAS_Shader.hlsl", "mainCS", 1, 1, 64, 1, 1, &defines); 84 | 85 | m_renderFullscreen.OnCreate(pDevice, "CAS_RenderPS.hlsl", pResourceViewHeaps, pStaticBufferPool, 1, 1, &SamplerDesc, outFormat); 86 | } 87 | 88 | void CAS_Filter::OnCreateWindowSizeDependentResources(Device *pDevice, uint32_t renderWidth, uint32_t renderHeight, uint32_t Width, uint32_t Height, CAS_State CASState, bool packedMathEnabled) 89 | { 90 | m_renderWidth = renderWidth; 91 | m_renderHeight = renderHeight; 92 | m_width = Width; 93 | m_height = Height; 94 | 95 | // Create lower res texture that we will upsample 96 | { 97 | D3D12_RESOURCE_DESC textureDesc = {}; 98 | textureDesc.MipLevels = 1; 99 | textureDesc.Format = DXGI_FORMAT_R16G16B16A16_FLOAT; 100 | textureDesc.Width = Width; 101 | textureDesc.Height = Height; 102 | textureDesc.Flags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS; 103 | textureDesc.DepthOrArraySize = 1; 104 | textureDesc.SampleDesc.Count = 1; 105 | textureDesc.SampleDesc.Quality = 0; 106 | textureDesc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D; 107 | 108 | ThrowIfFailed(pDevice->GetDevice()->CreateCommittedResource(&CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_DEFAULT), D3D12_HEAP_FLAG_NONE, &textureDesc, D3D12_RESOURCE_STATE_UNORDERED_ACCESS, nullptr, IID_PPV_ARGS(&m_pOutputTexture))); 109 | 110 | D3D12_SHADER_RESOURCE_VIEW_DESC srvDesc = {}; 111 | srvDesc.Format = DXGI_FORMAT_R16G16B16A16_FLOAT; 112 | srvDesc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D; 113 | srvDesc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; 114 | srvDesc.Texture2D.MostDetailedMip = 0; 115 | srvDesc.Texture2D.MipLevels = 1; 116 | srvDesc.Texture2D.PlaneSlice = 0; 117 | srvDesc.Texture2D.ResourceMinLODClamp = 0; 118 | m_pDevice->GetDevice()->CreateShaderResourceView(m_pOutputTexture, &srvDesc, m_outputTextureSrv.GetCPU()); 119 | 120 | D3D12_UNORDERED_ACCESS_VIEW_DESC uavDesc = {}; 121 | uavDesc.Format = DXGI_FORMAT_R16G16B16A16_FLOAT; 122 | uavDesc.ViewDimension = D3D12_UAV_DIMENSION_TEXTURE2D; 123 | uavDesc.Texture2D.MipSlice = 0; 124 | uavDesc.Texture2D.PlaneSlice = 0; 125 | 126 | pDevice->GetDevice()->CreateUnorderedAccessView(m_pOutputTexture, 0, &uavDesc, m_outputTextureUav.GetCPU()); 127 | 128 | UpdateSharpness(m_sharpenVal, CASState); 129 | } 130 | } 131 | 132 | void CAS_Filter::OnDestroyWindowSizeDependentResources() 133 | { 134 | if (m_pOutputTexture) 135 | { 136 | m_pOutputTexture->Release(); 137 | } 138 | } 139 | 140 | void CAS_Filter::OnDestroy() 141 | { 142 | m_casSharpenOnly.OnDestroy(); 143 | m_casFast.OnDestroy(); 144 | m_renderFullscreen.OnDestroy(); 145 | if (m_pDevice->IsFp16Supported()) 146 | { 147 | m_casPackedFast.OnDestroy(); 148 | m_casPackedSharpenOnly.OnDestroy(); 149 | } 150 | } 151 | 152 | void CAS_Filter::Upscale(ID3D12GraphicsCommandList* pCommandList, bool useCas, bool usePacked, CAS_State casState, ID3D12Resource* inputResource, CBV_SRV_UAV inputSrv) 153 | { 154 | D3D12_GPU_VIRTUAL_ADDRESS cbHandle = {}; 155 | uint32_t* pConstMem = 0; 156 | m_pConstantBufferRing->AllocConstantBuffer(sizeof(CASConstants), (void **)&pConstMem, &cbHandle); 157 | memcpy(pConstMem, &m_consts, sizeof(CASConstants)); 158 | 159 | // This value is the image region dim that each thread group of the CAS shader operates on 160 | static const int threadGroupWorkRegionDim = 16; 161 | int dispatchX = (m_width + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim; 162 | int dispatchY = (m_height + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim; 163 | 164 | if (useCas) 165 | { 166 | pCommandList->ResourceBarrier(1, &CD3DX12_RESOURCE_BARRIER::Transition(inputResource, D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, 0)); 167 | 168 | if (usePacked) 169 | { 170 | if (casState == CAS_State_SharpenOnly) 171 | { 172 | m_casPackedSharpenOnly.Draw(pCommandList, cbHandle, &m_outputTextureUav, &inputSrv, dispatchX, dispatchY, 1); 173 | } 174 | else if (casState == CAS_State_Upsample) 175 | { 176 | m_casPackedFast.Draw(pCommandList, cbHandle, &m_outputTextureUav, &inputSrv, dispatchX, dispatchY, 1); 177 | } 178 | } 179 | else 180 | { 181 | if (casState == CAS_State_SharpenOnly) 182 | { 183 | m_casSharpenOnly.Draw(pCommandList, cbHandle, &m_outputTextureUav, &inputSrv, dispatchX, dispatchY, 1); 184 | } 185 | else if (casState == CAS_State_Upsample) 186 | { 187 | m_casFast.Draw(pCommandList, cbHandle, &m_outputTextureUav, &inputSrv, dispatchX, dispatchY, 1); 188 | } 189 | } 190 | 191 | // Transition our UAV to display it 192 | D3D12_RESOURCE_BARRIER Barriers[] = 193 | { 194 | CD3DX12_RESOURCE_BARRIER::Transition(m_pOutputTexture, D3D12_RESOURCE_STATE_UNORDERED_ACCESS, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, 0), 195 | CD3DX12_RESOURCE_BARRIER::Transition(inputResource, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET, 0), 196 | }; 197 | pCommandList->ResourceBarrier(_countof(Barriers), Barriers); 198 | } 199 | } 200 | 201 | void CAS_Filter::Draw(ID3D12GraphicsCommandList* pCommandList, bool useCas, ID3D12Resource* inputResource, CBV_SRV_UAV inputSrv) 202 | { 203 | // NOTE: Render to swap chain 204 | if (useCas) 205 | { 206 | m_renderFullscreen.Draw(pCommandList, 1, &m_outputTextureSrv, 0); 207 | pCommandList->ResourceBarrier(1, &CD3DX12_RESOURCE_BARRIER::Transition(m_pOutputTexture, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, D3D12_RESOURCE_STATE_UNORDERED_ACCESS, 0)); 208 | } 209 | else 210 | { 211 | pCommandList->ResourceBarrier(1, &CD3DX12_RESOURCE_BARRIER::Transition(inputResource, D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, 0)); 212 | m_renderFullscreen.Draw(pCommandList, 1, &inputSrv, 0); 213 | pCommandList->ResourceBarrier(1, &CD3DX12_RESOURCE_BARRIER::Transition(inputResource, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET, 0)); 214 | } 215 | } 216 | 217 | void CAS_Filter::UpdateSharpness(float NewSharpenVal, CAS_State CASState) 218 | { 219 | AF1 outWidth = static_cast((CASState == CAS_State_Upsample) ? m_width : m_renderWidth); 220 | AF1 outHeight = static_cast((CASState == CAS_State_Upsample) ? m_height : m_renderHeight); 221 | 222 | CasSetup(reinterpret_cast(&m_consts.Const0), reinterpret_cast(&m_consts.Const1), m_sharpenVal, static_cast(m_renderWidth), 223 | static_cast(m_renderHeight), outWidth, outHeight); 224 | m_sharpenVal = NewSharpenVal; 225 | } 226 | 227 | static const ResolutionInfo s_CommonResolutions[] = 228 | { 229 | { "480p", 640, 480 }, 230 | { "720p", 1280, 720 }, 231 | { "1080p", 1920, 1080 }, 232 | { "1440p", 2560, 1440 }, 233 | }; 234 | 235 | void CAS_Filter::GetSupportedResolutions(uint32_t displayWidth, uint32_t displayHeight, std::vector& supportedList) 236 | { 237 | // Check which of the fixed resolutions we support rendering to with CAS enabled 238 | for (uint32_t iRes = 0; iRes < _countof(s_CommonResolutions); ++iRes) 239 | { 240 | ResolutionInfo currResolution = s_CommonResolutions[iRes]; 241 | if (CasSupportScaling(static_cast(displayWidth), static_cast(displayHeight), static_cast(currResolution.Width), static_cast(currResolution.Height)) && 242 | currResolution.Width < displayWidth && currResolution.Height < displayHeight) 243 | { 244 | supportedList.push_back(currResolution); 245 | } 246 | } 247 | 248 | // Also add the display res as a supported render resolution 249 | ResolutionInfo displayResInfo = {}; 250 | displayResInfo.pName = "Display Res"; 251 | displayResInfo.Width = displayWidth; 252 | displayResInfo.Height = displayHeight; 253 | supportedList.push_back(displayResInfo); 254 | } 255 | } 256 | -------------------------------------------------------------------------------- /sample/src/DX12/CAS_CS.h: -------------------------------------------------------------------------------- 1 | #//CAS Sample 2 | // 3 | // Copyright(c) 2019 Advanced Micro Devices, Inc.All rights reserved. 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files(the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions : 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 15 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | // THE SOFTWARE. 19 | 20 | #pragma once 21 | #include "PostProc/PostProcCS.h" 22 | #include "PostProc/PostProcPS.h" 23 | 24 | using namespace CAULDRON_DX12; 25 | 26 | namespace CAS_SAMPLE_DX12 27 | { 28 | enum CAS_State 29 | { 30 | CAS_State_NoCas, 31 | CAS_State_Upsample, 32 | CAS_State_SharpenOnly, 33 | }; 34 | 35 | struct ResolutionInfo 36 | { 37 | const char* pName; 38 | uint32_t Width; 39 | uint32_t Height; 40 | }; 41 | 42 | struct CASConstants 43 | { 44 | XMUINT4 Const0; 45 | XMUINT4 Const1; 46 | }; 47 | 48 | class CAS_Filter 49 | { 50 | public: 51 | void OnCreate( 52 | Device *pDevice, 53 | ResourceViewHeaps *pResourceViewHeaps, 54 | DynamicBufferRing *pConstantBufferRing, 55 | StaticBufferPool *pStaticBufferPool, 56 | DXGI_FORMAT outFormat 57 | ); 58 | void OnDestroy(); 59 | 60 | void OnCreateWindowSizeDependentResources(Device *pDevice, uint32_t renderWidth, uint32_t renderHeight, uint32_t Width, uint32_t Height, CAS_State CASState, bool packedMathEnabled); 61 | void OnDestroyWindowSizeDependentResources(); 62 | 63 | void Upscale(ID3D12GraphicsCommandList* pCommandList, bool useCas, bool usePacked, CAS_State casState, ID3D12Resource* pInputResource, CBV_SRV_UAV inputSrv); 64 | void Draw(ID3D12GraphicsCommandList* pCommandList, bool useCas, ID3D12Resource* inputResource, CBV_SRV_UAV inputSrv); 65 | 66 | void UpdateSharpness(float sharpenControl, CAS_State CASState); 67 | 68 | static void GetSupportedResolutions(uint32_t displayWidth, uint32_t displayHeight, std::vector& supportedList); 69 | 70 | private: 71 | Device *m_pDevice; 72 | 73 | ResourceViewHeaps *m_pResourceViewHeaps; 74 | DynamicBufferRing *m_pConstantBufferRing; 75 | 76 | PostProcCS m_casSharpenOnly; 77 | PostProcCS m_casFast; 78 | PostProcCS m_casPackedSharpenOnly; 79 | PostProcCS m_casPackedFast; 80 | PostProcPS m_renderFullscreen; 81 | 82 | DXGI_FORMAT m_outFormat; 83 | 84 | float m_sharpenVal; 85 | uint32_t m_renderWidth; 86 | uint32_t m_renderHeight; 87 | uint32_t m_width; 88 | uint32_t m_height; 89 | 90 | CASConstants m_consts; 91 | CBV_SRV_UAV m_constBuffer; 92 | 93 | CBV_SRV_UAV m_outputTextureUav; 94 | CBV_SRV_UAV m_outputTextureSrv; 95 | ID3D12Resource *m_pOutputTexture; 96 | }; 97 | } 98 | 99 | -------------------------------------------------------------------------------- /sample/src/DX12/CAS_RenderPS.hlsl: -------------------------------------------------------------------------------- 1 | //CAS Sample 2 | // 3 | // Copyright(c) 2019 Advanced Micro Devices, Inc.All rights reserved. 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files(the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions : 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 15 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | // THE SOFTWARE. 19 | 20 | struct VERTEX 21 | { 22 | float2 vTexcoord : TEXCOORD; 23 | }; 24 | 25 | //-------------------------------------------------------------------------------------- 26 | // Texture definitions 27 | //-------------------------------------------------------------------------------------- 28 | Texture2D UpscaledTexture : register(t0); 29 | SamplerState samLinearClamp : register(s0); 30 | 31 | //-------------------------------------------------------------------------------------- 32 | // Main function 33 | //-------------------------------------------------------------------------------------- 34 | 35 | float4 mainPS(VERTEX Input) : SV_Target 36 | { 37 | float4 texColor = UpscaledTexture.SampleLevel(samLinearClamp, Input.vTexcoord, 0); 38 | return texColor; 39 | } 40 | -------------------------------------------------------------------------------- /sample/src/DX12/CAS_Renderer.h: -------------------------------------------------------------------------------- 1 | #//CAS Sample 2 | // 3 | // Copyright(c) 2019 Advanced Micro Devices, Inc.All rights reserved. 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files(the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions : 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 15 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | // THE SOFTWARE. 19 | 20 | #pragma once 21 | 22 | static const int cNumSwapBufs = 2; 23 | 24 | #define USE_VID_MEM true 25 | 26 | using namespace CAULDRON_DX12; 27 | using namespace CAS_SAMPLE_DX12; 28 | 29 | // 30 | // This class deals with the GPU side of the sample. 31 | // 32 | class CAS_Renderer 33 | { 34 | public: 35 | struct Spotlight 36 | { 37 | Camera light; 38 | XMFLOAT4 color; 39 | float intensity; 40 | }; 41 | 42 | struct State 43 | { 44 | float time; 45 | Camera camera; 46 | 47 | float exposure; 48 | float iblFactor; 49 | float emmisiveFactor; 50 | 51 | int toneMapper; 52 | int skyDomeType; 53 | bool bDrawBoundingBoxes; 54 | 55 | uint32_t spotlightCount; 56 | Spotlight spotlight[4]; 57 | bool bDrawLightFrustum; 58 | 59 | int renderWidth; 60 | int renderHeight; 61 | bool usePackedMath; 62 | CAS_State CASState; 63 | bool profiling; 64 | float sharpenControl; 65 | }; 66 | 67 | void OnCreate(Device* pDevice, SwapChain *pSwapChain); 68 | void OnDestroy(); 69 | 70 | void OnCreateWindowSizeDependentResources(SwapChain *pSwapChain, State* pState, uint32_t Width, uint32_t Height); 71 | void OnDestroyWindowSizeDependentResources(); 72 | 73 | int LoadScene(GLTFCommon *pGLTFCommon, int stage = 0); 74 | void UnloadScene(); 75 | 76 | const std::vector &GetTimingValues() { return m_TimeStamps; } 77 | 78 | void OnRender(State *pState, SwapChain *pSwapChain); 79 | 80 | void UpdateCASSharpness(float sharpenControl, CAS_State CASState); 81 | 82 | private: 83 | Device *m_pDevice; 84 | 85 | uint32_t m_Width; 86 | uint32_t m_Height; 87 | 88 | D3D12_VIEWPORT m_ViewPort; 89 | D3D12_VIEWPORT m_FinalViewPort; 90 | D3D12_RECT m_RectScissor; 91 | D3D12_RECT m_FinalRectScissor; 92 | 93 | // Initialize helper classes 94 | ResourceViewHeaps m_resourceViewHeaps; 95 | UploadHeap m_UploadHeap; 96 | DynamicBufferRing m_ConstantBufferRing; 97 | StaticBufferPool m_VidMemBufferPool; 98 | CommandListRing m_CommandListRing; 99 | GPUTimestamps m_GPUTimer; 100 | 101 | 102 | //gltf passes 103 | GLTFTexturesAndBuffers *m_pGLTFTexturesAndBuffers; 104 | GltfPbrPass *m_pGltfPBR; 105 | GltfDepthPass *m_pGltfDepth; 106 | GltfBBoxPass *m_pGltfBBox; 107 | 108 | // effects 109 | Bloom m_bloom; 110 | SkyDome m_skyDome; 111 | DownSamplePS m_downSample; 112 | SkyDomeProc m_skyDomeProc; 113 | ToneMapping m_toneMapping; 114 | CAS_Filter m_CAS; 115 | 116 | // GUI 117 | ImGUI m_ImGUI; 118 | 119 | // Temporary render targets 120 | 121 | // depth buffer 122 | Texture m_depthBuffer; 123 | DSV m_depthBufferDSV; 124 | 125 | // shadowmaps 126 | Texture m_shadowMap; 127 | DSV m_ShadowMapDSV; 128 | CBV_SRV_UAV m_ShadowMapSRV; 129 | 130 | // MSAA RT 131 | Texture m_HDRMSAA; 132 | RTV m_HDRRTVMSAA; 133 | 134 | // Resolved RT 135 | Texture m_HDR; 136 | CBV_SRV_UAV m_HDRSRV; 137 | RTV m_HDRRTV; 138 | 139 | // Tonemapping RT 140 | Texture m_Tonemap; 141 | CBV_SRV_UAV m_TonemapSRV; 142 | RTV m_TonemapRTV; 143 | 144 | // widgets 145 | Wireframe m_wireframe; 146 | WireframeBox m_wireframeBox; 147 | 148 | std::vector m_TimeStamps; 149 | }; 150 | 151 | -------------------------------------------------------------------------------- /sample/src/DX12/CAS_Sample.cpp: -------------------------------------------------------------------------------- 1 | #//CAS Sample 2 | // 3 | // Copyright(c) 2020 Advanced Micro Devices, Inc.All rights reserved. 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files(the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions : 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 15 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | // THE SOFTWARE. 19 | 20 | #include "stdafx.h" 21 | 22 | #include "CAS_Sample.h" 23 | 24 | #if _DEBUG 25 | const bool VALIDATION_ENABLED = true; 26 | #else 27 | const bool VALIDATION_ENABLED = false; 28 | #endif 29 | 30 | CAS_Sample::CAS_Sample(LPCSTR name) : FrameworkWindows(name) 31 | { 32 | m_lastFrameTime = MillisecondsNow(); 33 | m_time = 0; 34 | m_bPlay = true; 35 | 36 | m_pGltfLoader = NULL; 37 | } 38 | 39 | //-------------------------------------------------------------------------------------- 40 | // 41 | // OnCreate 42 | // 43 | //-------------------------------------------------------------------------------------- 44 | void CAS_Sample::OnCreate(HWND hWnd) 45 | { 46 | // Create Device 47 | // 48 | m_device.OnCreate("CAS DX12 Sample v1.0", "CAS DX12 Engine v1.0", VALIDATION_ENABLED, hWnd); 49 | m_device.CreatePipelineCache(); 50 | 51 | //init the shader compiler 52 | CreateShaderCache(); 53 | 54 | // Create Swapchain 55 | // 56 | m_swapChain.OnCreate(&m_device, cNumSwapBufs, hWnd); 57 | 58 | // Create a instance of the renderer and initialize it, we need to do that for each GPU 59 | // 60 | m_pNode = new CAS_Renderer(); 61 | m_pNode->OnCreate(&m_device, &m_swapChain); 62 | 63 | // init GUI (non gfx stuff) 64 | // 65 | ImGUI_Init((void *)hWnd); 66 | 67 | // Init Camera, looking at the origin 68 | // 69 | m_roll = 0.0f; 70 | m_pitch = 0.0f; 71 | m_distance = 3.5f; 72 | 73 | // init GUI state 74 | m_state.toneMapper = 0; 75 | m_state.skyDomeType = 0; 76 | m_state.exposure = 1.0f; 77 | m_state.iblFactor = 2.0f; 78 | m_state.emmisiveFactor = 1.0f; 79 | m_state.bDrawLightFrustum = false; 80 | m_state.bDrawBoundingBoxes = false; 81 | m_state.camera.LookAt(m_roll, m_pitch, m_distance, XMVectorSet(0, 0, 0, 0)); 82 | 83 | // NOTE: Init render width/height and display mode 84 | m_state.usePackedMath = false; 85 | m_state.CASState = CAS_State_NoCas; 86 | m_currDisplayMode = 0; 87 | m_state.renderWidth = 0; 88 | m_state.renderHeight = 0; 89 | m_state.sharpenControl = 0.0f; 90 | m_state.profiling = false; 91 | 92 | m_state.spotlightCount = 1; 93 | 94 | m_state.spotlight[0].intensity = 10.0f; 95 | m_state.spotlight[0].color = XMFLOAT4(1.0f, 1.0f, 1.0f, 0.0f); 96 | m_state.spotlight[0].light.SetFov(XM_PI / 2.0f, 1024, 1024, 0.1f, 100.0f); 97 | m_state.spotlight[0].light.LookAt(XM_PI / 2.0f, 0.58f, 3.5f, XMVectorSet(0, 0, 0, 0)); 98 | 99 | // Init profiling state 100 | m_CASTimingsCurrId = 0; 101 | m_CASAvgTiming = 0; 102 | } 103 | 104 | //-------------------------------------------------------------------------------------- 105 | // 106 | // OnDestroy 107 | // 108 | //-------------------------------------------------------------------------------------- 109 | void CAS_Sample::OnDestroy() 110 | { 111 | ImGUI_Shutdown(); 112 | 113 | m_device.GPUFlush(); 114 | 115 | // Fullscreen state should always be false before exiting the app. 116 | m_swapChain.SetFullScreen(false); 117 | 118 | m_pNode->UnloadScene(); 119 | m_pNode->OnDestroyWindowSizeDependentResources(); 120 | m_pNode->OnDestroy(); 121 | 122 | if (m_pNode) 123 | { 124 | delete m_pNode; 125 | m_pNode = 0; 126 | } 127 | 128 | m_swapChain.OnDestroyWindowSizeDependentResources(); 129 | m_swapChain.OnDestroy(); 130 | 131 | //shut down the shader compiler 132 | DestroyShaderCache(&m_device); 133 | 134 | if (m_pGltfLoader) 135 | { 136 | delete m_pGltfLoader; 137 | m_pGltfLoader = NULL; 138 | } 139 | 140 | m_device.OnDestroy(); 141 | } 142 | 143 | //-------------------------------------------------------------------------------------- 144 | // 145 | // OnEvent 146 | // 147 | //-------------------------------------------------------------------------------------- 148 | bool CAS_Sample::OnEvent(MSG msg) 149 | { 150 | if (ImGUI_WndProcHandler(msg.hwnd, msg.message, msg.wParam, msg.lParam)) 151 | return true; 152 | 153 | return true; 154 | } 155 | 156 | //-------------------------------------------------------------------------------------- 157 | // 158 | // SetFullScreen 159 | // 160 | //-------------------------------------------------------------------------------------- 161 | void CAS_Sample::SetFullScreen(bool fullscreen) 162 | { 163 | m_device.GPUFlush(); 164 | 165 | m_swapChain.SetFullScreen(fullscreen); 166 | } 167 | 168 | //-------------------------------------------------------------------------------------- 169 | // 170 | // OnResize 171 | // 172 | //-------------------------------------------------------------------------------------- 173 | void CAS_Sample::OnResize(uint32_t width, uint32_t height) 174 | { 175 | if (m_Width != width || m_Height != height) 176 | { 177 | // Flush GPU 178 | // 179 | m_device.GPUFlush(); 180 | 181 | // If resizing but no minimizing 182 | // 183 | if (m_Width > 0 && m_Height > 0) 184 | { 185 | m_pNode->OnDestroyWindowSizeDependentResources(); 186 | m_swapChain.OnDestroyWindowSizeDependentResources(); 187 | } 188 | 189 | m_Width = width; 190 | m_Height = height; 191 | 192 | // NOTE: Reset render width/height and display mode 193 | { 194 | std::vector supportedResolutions = {}; 195 | CAS_Filter::GetSupportedResolutions(m_Width, m_Height, supportedResolutions); 196 | 197 | m_currDisplayMode = 0; 198 | m_state.renderWidth = supportedResolutions[m_currDisplayMode].Width; 199 | m_state.renderHeight = supportedResolutions[m_currDisplayMode].Height; 200 | } 201 | 202 | // if resizing but not minimizing the recreate it with the new size 203 | // 204 | if (m_Width > 0 && m_Height > 0) 205 | { 206 | m_swapChain.OnCreateWindowSizeDependentResources(m_Width, m_Height, false); 207 | m_pNode->OnCreateWindowSizeDependentResources(&m_swapChain, &m_state, m_Width, m_Height); 208 | } 209 | } 210 | m_state.camera.SetFov(XM_PI / 4, m_Width, m_Height, 0.1f, 1000.0f); 211 | } 212 | 213 | //-------------------------------------------------------------------------------------- 214 | // 215 | // OnRender 216 | // 217 | //-------------------------------------------------------------------------------------- 218 | void CAS_Sample::OnRender() 219 | { 220 | // Get timings 221 | // 222 | double timeNow = MillisecondsNow(); 223 | m_deltaTime = timeNow - m_lastFrameTime; 224 | m_lastFrameTime = timeNow; 225 | 226 | // Build UI and set the scene state. Note that the rendering of the UI happens later. 227 | // 228 | ImGUI_UpdateIO(); 229 | ImGui::NewFrame(); 230 | 231 | static int loadingStage = 0; 232 | if (loadingStage >= 0) 233 | { 234 | // LoadScene needs to be called a number of times, the scene is not fully loaded until it returns -1 235 | // This is done so we can display a progress bar when the scene is loading 236 | if (m_pGltfLoader == NULL) 237 | { 238 | m_pGltfLoader = new GLTFCommon(); 239 | m_pGltfLoader->Load("..\\media\\DamagedHelmet\\glTF\\", "DamagedHelmet.gltf"); 240 | loadingStage = 0; 241 | } 242 | loadingStage = m_pNode->LoadScene(m_pGltfLoader, loadingStage); 243 | } 244 | else 245 | { 246 | ImGuiStyle& style = ImGui::GetStyle(); 247 | style.FrameBorderSize = 1.0f; 248 | 249 | bool opened = true; 250 | ImGui::Begin("Stats", &opened); 251 | 252 | if (ImGui::CollapsingHeader("Info", ImGuiTreeNodeFlags_DefaultOpen)) 253 | { 254 | ImGui::Text("Resolution : %ix%i", m_Width, m_Height); 255 | } 256 | 257 | if (ImGui::CollapsingHeader("Animation", ImGuiTreeNodeFlags_DefaultOpen)) 258 | { 259 | ImGui::Checkbox("Play", &m_bPlay); 260 | ImGui::SliderFloat("Time", &m_time, 0, 30); 261 | } 262 | 263 | if (ImGui::CollapsingHeader("Model Selection", ImGuiTreeNodeFlags_DefaultOpen)) 264 | { 265 | const char * models[] = { "busterDrone", "BoomBox", "SciFiHelmet", "DamagedHelmet", "Sponza", "MetalRoughSpheres" }; 266 | static int selected = 3; 267 | if (ImGui::Combo("model", &selected, models, _countof(models))) 268 | { 269 | { 270 | //free resources, unload the current scene, and load new scene... 271 | m_device.GPUFlush(); 272 | 273 | m_pNode->UnloadScene(); 274 | m_pNode->OnDestroyWindowSizeDependentResources(); 275 | m_pGltfLoader->Unload(); 276 | m_pNode->OnDestroy(); 277 | m_pNode->OnCreate(&m_device, &m_swapChain); 278 | m_pNode->OnCreateWindowSizeDependentResources(&m_swapChain, &m_state, m_Width, m_Height); 279 | } 280 | 281 | m_pGltfLoader = new GLTFCommon(); 282 | bool res = false; 283 | switch (selected) 284 | { 285 | case 0: 286 | m_state.iblFactor = 1.0f; 287 | m_roll = 0.0f; m_pitch = 0.0f; m_distance = 3.5f; 288 | m_state.camera.LookAt(m_roll, m_pitch, m_distance, XMVectorSet(0, 0, 0, 0)); 289 | res = m_pGltfLoader->Load("..\\media\\buster_drone\\", "busterDrone.gltf"); break; 290 | case 1: 291 | m_state.iblFactor = 1.0f; 292 | m_roll = 0.0f; m_pitch = 0.0f; m_distance = 3.5f; 293 | m_state.camera.LookAt(m_roll, m_pitch, m_distance, XMVectorSet(0, 0, 0, 0)); 294 | res = m_pGltfLoader->Load("..\\media\\BoomBox\\glTF\\", "BoomBox.gltf"); break; 295 | case 2: 296 | m_state.iblFactor = 1.0f; 297 | m_roll = 0.0f; m_pitch = 0.0f; m_distance = 3.5f; 298 | m_state.camera.LookAt(m_roll, m_pitch, m_distance, XMVectorSet(0, 0, 0, 0)); 299 | res = m_pGltfLoader->Load("..\\media\\SciFiHelmet\\glTF\\", "SciFiHelmet.gltf"); break; 300 | case 3: 301 | m_state.iblFactor = 2.0f; 302 | m_roll = 0.0f; m_pitch = 0.0f; m_distance = 3.5f; 303 | m_state.camera.LookAt(m_roll, m_pitch, m_distance, XMVectorSet(0, 0, 0, 0)); 304 | res = m_pGltfLoader->Load("..\\media\\DamagedHelmet\\glTF\\", "DamagedHelmet.gltf"); break; 305 | case 4: 306 | m_state.iblFactor = 0.362f; 307 | m_pitch = 0.182035938f; m_roll = 1.92130506f; m_distance = 4.83333349f; 308 | m_state.camera.LookAt(m_roll, m_pitch, m_distance, XMVectorSet(0.703276634f, 1.02280307f, 0.218072295f, 0)); 309 | res = m_pGltfLoader->Load("..\\media\\sponza\\gltf\\", "sponza.gltf"); break; 310 | case 5: 311 | m_state.iblFactor = 1.0f; 312 | m_roll = 0.0f; m_pitch = 0.0f; m_distance = 16.0f; 313 | m_state.camera.LookAt(m_roll, m_pitch, m_distance, XMVectorSet(0, 0, 0, 0)); 314 | res = m_pGltfLoader->Load("..\\media\\MetalRoughSpheres\\glTF\\", "MetalRoughSpheres.gltf"); break; 315 | } 316 | 317 | if (res == false) 318 | { 319 | ImGui::OpenPopup("Error"); 320 | 321 | delete m_pGltfLoader; 322 | m_pGltfLoader = NULL; 323 | } 324 | else 325 | { 326 | loadingStage = m_pNode->LoadScene(m_pGltfLoader, 0); 327 | } 328 | 329 | ImGui::End(); 330 | ImGui::EndFrame(); 331 | return; 332 | } 333 | } 334 | 335 | std::vector supportedResolutions = {}; 336 | CAS_Filter::GetSupportedResolutions(m_Width, m_Height, supportedResolutions); 337 | auto itemsGetter = [](void* data, int idx, const char** outText) 338 | { 339 | ResolutionInfo* resolutions = reinterpret_cast(data); 340 | *outText = resolutions[idx].pName; 341 | return true; 342 | }; 343 | 344 | int oldDisplayMode = m_currDisplayMode; 345 | ImGui::Combo("Render Dim", &m_currDisplayMode, itemsGetter, reinterpret_cast(&supportedResolutions.front()), static_cast(supportedResolutions.size())); 346 | 347 | if (m_device.IsFp16Supported()) 348 | { 349 | ImGui::Checkbox("Enable Packed Math", &m_state.usePackedMath); 350 | } 351 | 352 | int oldCasState = (int)m_state.CASState; 353 | const char* casItemNames[] = 354 | { 355 | "No Cas", 356 | "Cas Upsample", 357 | "Cas Sharpen Only", 358 | }; 359 | ImGui::Combo("Cas Options", (int*)&m_state.CASState, casItemNames, _countof(casItemNames)); 360 | 361 | ImGuiIO& io = ImGui::GetIO(); 362 | 363 | if (io.KeysDownDuration['Q'] == 0.0f) 364 | { 365 | m_state.CASState = CAS_State_NoCas; 366 | } 367 | else if (io.KeysDownDuration['W'] == 0.0f) 368 | { 369 | m_state.CASState = CAS_State_Upsample; 370 | } 371 | else if (io.KeysDownDuration['E'] == 0.0f) 372 | { 373 | m_state.CASState = CAS_State_SharpenOnly; 374 | } 375 | 376 | if (oldDisplayMode != m_currDisplayMode || oldCasState != m_state.CASState) 377 | { 378 | m_state.renderWidth = supportedResolutions[m_currDisplayMode].Width; 379 | m_state.renderHeight = supportedResolutions[m_currDisplayMode].Height; 380 | 381 | m_device.GPUFlush(); 382 | m_pNode->OnDestroyWindowSizeDependentResources(); 383 | m_pNode->OnCreateWindowSizeDependentResources(&m_swapChain, &m_state, m_Width, m_Height); 384 | } 385 | 386 | float newSharpenControl = m_state.sharpenControl; 387 | ImGui::SliderFloat("Cas Sharpen", &newSharpenControl, 0, 1); 388 | 389 | if (newSharpenControl != m_state.sharpenControl) 390 | { 391 | m_state.sharpenControl = newSharpenControl; 392 | m_pNode->UpdateCASSharpness(m_state.sharpenControl, m_state.CASState); 393 | } 394 | 395 | const char * cameraControl[] = { "WASD", "Orbit" }; 396 | static int cameraControlSelected = 1; 397 | ImGui::Combo("Camera", &cameraControlSelected, cameraControl, _countof(cameraControl)); 398 | 399 | float CASTime = 0.0f; 400 | if (ImGui::CollapsingHeader("Profiler", ImGuiTreeNodeFlags_DefaultOpen)) 401 | { 402 | std::vector timeStamps = m_pNode->GetTimingValues(); 403 | if (timeStamps.size() > 0) 404 | { 405 | for (uint32_t i = 1; i < timeStamps.size(); i++) 406 | { 407 | float DeltaTime = ((float)(timeStamps[i].m_microseconds - timeStamps[i - 1].m_microseconds)); 408 | if (strcmp("CAS", timeStamps[i].m_label.c_str()) == 0) 409 | { 410 | CASTime = DeltaTime; 411 | } 412 | ImGui::Text("%-17s: %7.1f us", timeStamps[i].m_label.c_str(), DeltaTime); 413 | } 414 | 415 | //scrolling data and average computing 416 | static float values[128]; 417 | values[127] = (float)(timeStamps.back().m_microseconds - timeStamps.front().m_microseconds); 418 | float average = values[0]; 419 | for (uint32_t i = 0; i < 128 - 1; i++) { values[i] = values[i + 1]; average += values[i]; } 420 | average /= 128; 421 | 422 | ImGui::Text("%-17s: %7.1f us", "TotalGPUTime", average); 423 | ImGui::PlotLines("", values, 128, 0, "", 0.0f, 30000.0f, ImVec2(0, 80)); 424 | } 425 | } 426 | 427 | if (m_state.profiling) 428 | { 429 | m_CASTimings[m_CASTimingsCurrId++] = CASTime; 430 | if (m_CASTimingsCurrId == _countof(m_CASTimings)) 431 | { 432 | m_state.profiling = false; 433 | m_CASTimingsCurrId = 0; 434 | for (int i = 0; i < _countof(m_CASTimings); ++i) 435 | { 436 | m_CASAvgTiming += m_CASTimings[i]; 437 | } 438 | 439 | m_CASAvgTiming /= static_cast(_countof(m_CASTimings)); 440 | } 441 | } 442 | 443 | bool isHit = ImGui::Button("Start Timing", { 150, 30 }); 444 | if (isHit) 445 | { 446 | m_state.profiling = true; 447 | } 448 | ImGui::Text("Avg Cas Time: %f", m_CASAvgTiming); 449 | 450 | ImGui::End(); 451 | 452 | // If the mouse was not used by the GUI then it's for the camera 453 | // 454 | if (io.WantCaptureMouse == false) 455 | { 456 | if ((io.KeyCtrl == false) && (io.MouseDown[0] == true)) 457 | { 458 | m_roll -= io.MouseDelta.x / 100.f; 459 | m_pitch += io.MouseDelta.y / 100.f; 460 | } 461 | 462 | // Choose camera movement depending on setting 463 | // 464 | 465 | if (cameraControlSelected == 0) 466 | { 467 | // WASD 468 | // 469 | m_state.camera.UpdateCameraWASD(m_roll, m_pitch, io.KeysDown, io.DeltaTime); 470 | } 471 | else if (cameraControlSelected == 1) 472 | { 473 | // Orbiting 474 | // 475 | m_distance -= static_cast(io.MouseWheel) / 3.0f; 476 | m_distance = std::max(m_distance, 0.1f); 477 | 478 | bool panning = (io.KeyCtrl == true) && (io.MouseDown[0] == true); 479 | 480 | m_state.camera.UpdateCameraPolar(m_roll, m_pitch, panning ? -io.MouseDelta.x / 100.0f : 0.0f, panning ? io.MouseDelta.y / 100.0f : 0.0f, m_distance ); 481 | } 482 | } 483 | } 484 | 485 | // Set animation time 486 | // 487 | if (m_bPlay) 488 | { 489 | m_time += static_cast(m_deltaTime) / 1000.0f; 490 | } 491 | 492 | // Animate and transform the scene 493 | // 494 | if (m_pGltfLoader) 495 | { 496 | m_pGltfLoader->SetAnimationTime(0, m_time); 497 | m_pGltfLoader->TransformScene(0, XMMatrixIdentity()); 498 | } 499 | 500 | m_state.time = m_time; 501 | 502 | // Do Render frame using AFR 503 | // 504 | m_pNode->OnRender(&m_state, &m_swapChain); 505 | 506 | m_swapChain.Present(); 507 | } 508 | 509 | 510 | //-------------------------------------------------------------------------------------- 511 | // 512 | // WinMain 513 | // 514 | //-------------------------------------------------------------------------------------- 515 | int WINAPI WinMain(HINSTANCE hInstance, 516 | HINSTANCE hPrevInstance, 517 | LPSTR lpCmdLine, 518 | int nCmdShow) 519 | { 520 | LPCSTR Name = "CAS DX12 Sample v1.0"; 521 | uint32_t Width = 1280; 522 | uint32_t Height = 720; 523 | 524 | // create new DX sample 525 | return RunFramework(hInstance, lpCmdLine, nCmdShow, Width, Height, new CAS_Sample(Name)); 526 | } 527 | 528 | -------------------------------------------------------------------------------- /sample/src/DX12/CAS_Sample.h: -------------------------------------------------------------------------------- 1 | #//CAS Sample 2 | // 3 | // Copyright(c) 2019 Advanced Micro Devices, Inc.All rights reserved. 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files(the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions : 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 15 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | // THE SOFTWARE. 19 | 20 | #pragma once 21 | 22 | #include "CAS_Renderer.h" 23 | 24 | // 25 | // This is the main class, it manages the state of the sample and does all the high level work without touching the GPU directly. 26 | // This class uses the GPU via the the SampleRenderer class. We would have a SampleRenderer instance for each GPU. 27 | // 28 | // This class takes care of: 29 | // 30 | // - loading a scene (just the CPU data) 31 | // - updating the camera 32 | // - keeping track of time 33 | // - handling the keyboard 34 | // - updating the animation 35 | // - building the UI (but do not renders it) 36 | // - uses the SampleRenderer to update all the state to the GPU and do the rendering 37 | // 38 | 39 | class CAS_Sample : public FrameworkWindows 40 | { 41 | public: 42 | CAS_Sample(LPCSTR name); 43 | void OnCreate(HWND hWnd); 44 | void OnDestroy(); 45 | void OnRender(); 46 | bool OnEvent(MSG msg); 47 | void OnResize(uint32_t Width, uint32_t Height); 48 | void SetFullScreen(bool fullscreen); 49 | 50 | private: 51 | Device m_device; 52 | SwapChain m_swapChain; 53 | 54 | GLTFCommon *m_pGltfLoader; 55 | 56 | CAS_Renderer *m_pNode; 57 | CAS_Renderer::State m_state; 58 | 59 | float m_distance; 60 | float m_roll; 61 | float m_pitch; 62 | 63 | float m_time; // WallClock in seconds. 64 | double m_deltaTime; // The elapsed time in milliseconds since the previous frame. 65 | double m_lastFrameTime; 66 | 67 | bool m_bPlay; 68 | 69 | int m_currDisplayMode; 70 | 71 | // Profiling info for CAS 72 | int m_CASTimingsCurrId; 73 | float m_CASTimings[300]; 74 | float m_CASAvgTiming; 75 | }; 76 | -------------------------------------------------------------------------------- /sample/src/DX12/CAS_Shader.hlsl: -------------------------------------------------------------------------------- 1 | //CAS Sample 2 | // 3 | // Copyright(c) 2019 Advanced Micro Devices, Inc.All rights reserved. 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files(the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions : 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 15 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | // THE SOFTWARE. 19 | 20 | cbuffer cb : register(b0) 21 | { 22 | uint4 const0; 23 | uint4 const1; 24 | }; 25 | 26 | Texture2D InputTexture : register(t0); 27 | RWTexture2D OutputTexture : register(u0); 28 | 29 | #define A_GPU 1 30 | #define A_HLSL 1 31 | 32 | #if CAS_SAMPLE_FP16 33 | 34 | #define A_HALF 1 35 | #define CAS_PACKED_ONLY 1 36 | 37 | #endif 38 | 39 | #include "ffx_a.h" 40 | 41 | #if CAS_SAMPLE_FP16 42 | 43 | AH3 CasLoadH(ASW2 p) 44 | { 45 | return InputTexture.Load(ASU3(p, 0)).rgb; 46 | } 47 | 48 | // Lets you transform input from the load into a linear color space between 0 and 1. See ffx_cas.h 49 | // In this case, our input is already linear and between 0 and 1 50 | void CasInputH(inout AH2 r, inout AH2 g, inout AH2 b) {} 51 | 52 | #else 53 | 54 | AF3 CasLoad(ASU2 p) 55 | { 56 | return InputTexture.Load(int3(p, 0)).rgb; 57 | } 58 | 59 | // Lets you transform input from the load into a linear color space between 0 and 1. See ffx_cas.h 60 | // In this case, our input is already linear and between 0 and 1 61 | void CasInput(inout AF1 r, inout AF1 g, inout AF1 b) {} 62 | 63 | #endif 64 | 65 | #include "ffx_cas.h" 66 | 67 | [numthreads(WIDTH, HEIGHT, DEPTH)] 68 | void mainCS(uint3 LocalThreadId : SV_GroupThreadID, uint3 WorkGroupId : SV_GroupID) 69 | { 70 | // Do remapping of local xy in workgroup for a more PS-like swizzle pattern. 71 | AU2 gxy = ARmp8x8(LocalThreadId.x) + AU2(WorkGroupId.x << 4u, WorkGroupId.y << 4u); 72 | 73 | bool sharpenOnly; 74 | #if CAS_SAMPLE_SHARPEN_ONLY 75 | sharpenOnly = true; 76 | #else 77 | sharpenOnly = false; 78 | #endif 79 | 80 | #if CAS_SAMPLE_FP16 81 | 82 | // Filter. 83 | AH4 c0, c1; 84 | AH2 cR, cG, cB; 85 | 86 | CasFilterH(cR, cG, cB, gxy, const0, const1, sharpenOnly); 87 | CasDepack(c0, c1, cR, cG, cB); 88 | OutputTexture[ASU2(gxy)] = AF4(c0); 89 | OutputTexture[ASU2(gxy) + ASU2(8, 0)] = AF4(c1); 90 | gxy.y += 8u; 91 | 92 | CasFilterH(cR, cG, cB, gxy, const0, const1, sharpenOnly); 93 | CasDepack(c0, c1, cR, cG, cB); 94 | OutputTexture[ASU2(gxy)] = AF4(c0); 95 | OutputTexture[ASU2(gxy) + ASU2(8, 0)] = AF4(c1); 96 | 97 | #else 98 | 99 | // Filter. 100 | AF3 c; 101 | 102 | CasFilter(c.r, c.g, c.b, gxy, const0, const1, sharpenOnly); 103 | OutputTexture[ASU2(gxy)] = AF4(c, 1); 104 | gxy.x += 8u; 105 | 106 | CasFilter(c.r, c.g, c.b, gxy, const0, const1, sharpenOnly); 107 | OutputTexture[ASU2(gxy)] = AF4(c, 1); 108 | gxy.y += 8u; 109 | 110 | CasFilter(c.r, c.g, c.b, gxy, const0, const1, sharpenOnly); 111 | OutputTexture[ASU2(gxy)] = AF4(c, 1); 112 | gxy.x -= 8u; 113 | 114 | CasFilter(c.r, c.g, c.b, gxy, const0, const1, sharpenOnly); 115 | OutputTexture[ASU2(gxy)] = AF4(c, 1); 116 | 117 | #endif 118 | } -------------------------------------------------------------------------------- /sample/src/DX12/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # CAS Sample 2 | # 3 | # Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. 4 | # Permission is hereby granted, free of charge, to any person obtaining a copy 5 | # of this software and associated documentation files (the "Software"), to deal 6 | # in the Software without restriction, including without limitation the rights 7 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | # copies of the Software, and to permit persons to whom the Software is 9 | # furnished to do so, subject to the following conditions: 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | # THE SOFTWARE. 19 | 20 | project (CAS_Sample_DX12) 21 | 22 | include(${CMAKE_CURRENT_SOURCE_DIR}/../../common.cmake) 23 | 24 | set(sources 25 | CAS_CS.cpp 26 | CAS_CS.h 27 | CAS_Sample.cpp 28 | CAS_Sample.h 29 | CAS_Renderer.cpp 30 | CAS_Renderer.h 31 | stdafx.cpp 32 | stdafx.h) 33 | 34 | set(Shaders_src 35 | ${CMAKE_CURRENT_SOURCE_DIR}/CAS_Shader.hlsl 36 | ${CMAKE_CURRENT_SOURCE_DIR}/CAS_RenderPS.hlsl 37 | ${CMAKE_CURRENT_SOURCE_DIR}/../../../ffx-cas/ffx_a.h 38 | ${CMAKE_CURRENT_SOURCE_DIR}/../../../ffx-cas/ffx_cas.h) 39 | 40 | source_group("sources" FILES ${sources}) 41 | source_group("shaders" FILES ${Shaders_src}) 42 | 43 | copyCommand("${Shaders_src}" ${CMAKE_HOME_DIRECTORY}/bin/ShaderLibDX) 44 | 45 | add_executable(${PROJECT_NAME} WIN32 ${sources} ${Shaders_src}) 46 | target_link_libraries (${PROJECT_NAME} LINK_PUBLIC Cauldron_DX12 ImGUI amd_ags DXC d3dcompiler D3D12) 47 | target_include_directories (${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../../ffx-cas) 48 | 49 | set_target_properties(${PROJECT_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}/bin") 50 | set_source_files_properties(${Shaders_src} PROPERTIES VS_TOOL_OVERRIDE "Text") 51 | addManifest(${PROJECT_NAME}) 52 | 53 | -------------------------------------------------------------------------------- /sample/src/DX12/dpiawarescaling.manifest: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 25 | true/PM 26 | 27 | 28 | -------------------------------------------------------------------------------- /sample/src/DX12/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #//CAS Sample 2 | // 3 | // Copyright(c) 2019 Advanced Micro Devices, Inc.All rights reserved. 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files(the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions : 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 15 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | // THE SOFTWARE. 19 | 20 | // stdafx.cpp : source file that includes just the standard includes 21 | // SampleD3D12.pch will be the pre-compiled header 22 | // stdafx.obj will contain the pre-compiled type information 23 | 24 | #include "stdafx.h" 25 | 26 | // TODO: reference any additional headers you need in STDAFX.H 27 | // and not in this file 28 | 29 | #pragma comment(lib,"d3dcompiler.lib") 30 | #pragma comment(lib, "D3D12.lib") 31 | 32 | -------------------------------------------------------------------------------- /sample/src/DX12/stdafx.h: -------------------------------------------------------------------------------- 1 | #//CAS Sample 2 | // 3 | // Copyright(c) 2019 Advanced Micro Devices, Inc.All rights reserved. 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files(the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions : 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 15 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | // THE SOFTWARE. 19 | 20 | // stdafx.h : include file for standard system include files, 21 | // or project specific include files that are used frequently, but 22 | // are changed infrequently 23 | // 24 | #pragma once 25 | 26 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 27 | // Windows Header Files: 28 | #include 29 | #include 30 | 31 | // C RunTime Header Files 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #include "..\..\libs\d3d12x\d3dx12.h" 40 | 41 | // we are using DirectXMath 42 | #include 43 | using namespace DirectX; 44 | 45 | // TODO: reference additional headers your program requires here 46 | #include "Base\Imgui.h" 47 | #include "Base\ImguiHelper.h" 48 | #include "Base\Fence.h" 49 | #include "Base\Helper.h" 50 | #include "Base\Device.h" 51 | #include "Base\Texture.h" 52 | #include "Base\SwapChain.h" 53 | #include "Base\UploadHeap.h" 54 | #include "Base\GPUTimestamps.h" 55 | #include "Base\CommandListRing.h" 56 | #include "Base\StaticBufferPool.h" 57 | #include "Base\DynamicBufferRing.h" 58 | #include "Base\ResourceViewHeaps.h" 59 | #include "Base\ShaderCompilerHelper.h" 60 | #include "Base\StaticConstantBufferPool.h" 61 | 62 | #include "Misc\Misc.h" 63 | #include "Misc\Error.h" 64 | #include "Misc\Camera.h" 65 | #include "Misc\FrameworkWindows.h" 66 | 67 | #include "GLTF\GltfPbrPass.h" 68 | #include "GLTF\GltfDepthPass.h" 69 | #include "GLTF\GltfBBoxPass.h" 70 | 71 | #include "PostProc\ToneMapping.h" 72 | #include "PostProc\DownSamplePS.h" 73 | #include "PostProc\SkyDome.h" 74 | #include "PostProc\SkyDomeProc.h" 75 | #include "PostProc\BlurPS.h" 76 | #include "PostProc\Bloom.h" 77 | #include "CAS_CS.h" 78 | 79 | #include "Widgets\wireframe.h" 80 | using namespace CAULDRON_DX12; -------------------------------------------------------------------------------- /sample/src/VK/CAS_CS.cpp: -------------------------------------------------------------------------------- 1 | //CAS Sample 2 | // 3 | // Copyright(c) 2019 Advanced Micro Devices, Inc.All rights reserved. 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files(the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions : 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 15 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | // THE SOFTWARE. 19 | 20 | #include "stdafx.h" 21 | #include "CAS_CS.h" 22 | 23 | // CAS 24 | #define A_CPU 25 | #include "ffx_a.h" 26 | #include "ffx_cas.h" 27 | 28 | namespace CAS_SAMPLE_VK 29 | { 30 | void CAS_Filter::OnCreate(Device* pDevice, VkRenderPass renderPass, VkFormat outFormat, ResourceViewHeaps *pResourceViewHeaps, StaticBufferPool *pStaticBufferPool, DynamicBufferRing *pDynamicBufferRing) 31 | { 32 | m_pDevice = pDevice; 33 | m_pDynamicBufferRing = pDynamicBufferRing; 34 | m_pResourceViewHeaps = pResourceViewHeaps; 35 | 36 | { 37 | VkSamplerCreateInfo info = {}; 38 | info.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO; 39 | info.magFilter = VK_FILTER_LINEAR; 40 | info.minFilter = VK_FILTER_LINEAR; 41 | info.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; 42 | info.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; 43 | info.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; 44 | info.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; 45 | info.minLod = -1000; 46 | info.maxLod = 1000; 47 | info.maxAnisotropy = 1.0f; 48 | VkResult res = vkCreateSampler(m_pDevice->GetDevice(), &info, NULL, &m_renderSampler); 49 | assert(res == VK_SUCCESS); 50 | } 51 | 52 | { 53 | std::vector layoutBindings(3); 54 | layoutBindings[0].binding = 0; 55 | layoutBindings[0].descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC; 56 | layoutBindings[0].descriptorCount = 1; 57 | layoutBindings[0].stageFlags = VK_SHADER_STAGE_COMPUTE_BIT; 58 | layoutBindings[0].pImmutableSamplers = NULL; 59 | 60 | layoutBindings[1].binding = 1; 61 | layoutBindings[1].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; 62 | layoutBindings[1].descriptorCount = 1; 63 | layoutBindings[1].stageFlags = VK_SHADER_STAGE_COMPUTE_BIT; 64 | layoutBindings[1].pImmutableSamplers = NULL; 65 | 66 | layoutBindings[2].binding = 2; 67 | layoutBindings[2].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; 68 | layoutBindings[2].descriptorCount = 1; 69 | layoutBindings[2].stageFlags = VK_SHADER_STAGE_COMPUTE_BIT; 70 | layoutBindings[2].pImmutableSamplers = NULL; 71 | 72 | m_pResourceViewHeaps->CreateDescriptorSetLayoutAndAllocDescriptorSet(&layoutBindings, &m_upscaleDescriptorSetLayout, &m_upscaleDescriptorSet); 73 | m_pDynamicBufferRing->SetDescriptorSet(0, sizeof(uint32_t) * 12, m_upscaleDescriptorSet); 74 | 75 | DefineList defines; 76 | defines["CAS_SAMPLE_FP16"] = "0"; 77 | defines["CAS_SAMPLE_SHARPEN_ONLY"] = "0"; 78 | 79 | if (pDevice->IsFp16Supported()) 80 | { 81 | defines["CAS_SAMPLE_FP16"] = "1"; 82 | 83 | defines["CAS_SAMPLE_SHARPEN_ONLY"] = "1"; 84 | m_casPackedSharpenOnly.OnCreate(pDevice, "CAS_Shader.glsl", "main", m_upscaleDescriptorSetLayout, 64, 1, 1, &defines); 85 | 86 | defines["CAS_SAMPLE_SHARPEN_ONLY"] = "0"; 87 | m_casPackedUpsample.OnCreate(pDevice, "CAS_Shader.glsl", "main", m_upscaleDescriptorSetLayout, 64, 1, 1, &defines); 88 | } 89 | 90 | defines["CAS_SAMPLE_FP16"] = "0"; 91 | 92 | defines["CAS_SAMPLE_SHARPEN_ONLY"] = "1"; 93 | m_casSharpenOnly.OnCreate(pDevice, "CAS_Shader.glsl", "main", m_upscaleDescriptorSetLayout, 64, 1, 1, &defines); 94 | 95 | defines["CAS_SAMPLE_SHARPEN_ONLY"] = "0"; 96 | m_casUpsample.OnCreate(pDevice, "CAS_Shader.glsl", "main", m_upscaleDescriptorSetLayout, 64, 1, 1, &defines); 97 | } 98 | 99 | { 100 | std::vector layoutBindings(1); 101 | layoutBindings[0].binding = 0; 102 | layoutBindings[0].descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; 103 | layoutBindings[0].descriptorCount = 1; 104 | layoutBindings[0].stageFlags = VK_SHADER_STAGE_FRAGMENT_BIT; 105 | layoutBindings[0].pImmutableSamplers = NULL; 106 | 107 | m_pResourceViewHeaps->CreateDescriptorSetLayout(&layoutBindings, &m_renderDescriptorSetLayout); 108 | m_pResourceViewHeaps->AllocDescriptor(m_renderDescriptorSetLayout, &m_renderSrcSRVDescriptorSet); 109 | m_pResourceViewHeaps->AllocDescriptor(m_renderDescriptorSetLayout, &m_renderDstSRVDescriptorSet); 110 | m_renderFullscreen.OnCreate(pDevice, renderPass, "CAS_RenderPS.glsl", pStaticBufferPool, pDynamicBufferRing, m_renderDescriptorSetLayout); 111 | } 112 | 113 | m_dstLayoutUndefined = false; 114 | } 115 | 116 | void CAS_Filter::OnDestroy() 117 | { 118 | m_casUpsample.OnDestroy(); 119 | m_casSharpenOnly.OnDestroy(); 120 | if (m_pDevice->IsFp16Supported()) 121 | { 122 | m_casPackedUpsample.OnDestroy(); 123 | m_casPackedSharpenOnly.OnDestroy(); 124 | } 125 | m_renderFullscreen.OnDestroy(); 126 | 127 | vkDestroySampler(m_pDevice->GetDevice(), m_renderSampler, nullptr); 128 | 129 | m_pResourceViewHeaps->FreeDescriptor(m_upscaleDescriptorSet); 130 | vkDestroyDescriptorSetLayout(m_pDevice->GetDevice(), m_upscaleDescriptorSetLayout, NULL); 131 | 132 | m_pResourceViewHeaps->FreeDescriptor(m_renderSrcSRVDescriptorSet); 133 | m_pResourceViewHeaps->FreeDescriptor(m_renderDstSRVDescriptorSet); 134 | vkDestroyDescriptorSetLayout(m_pDevice->GetDevice(), m_renderDescriptorSetLayout, NULL); 135 | } 136 | 137 | void CAS_Filter::OnCreateWindowSizeDependentResources(uint32_t renderWidth, uint32_t renderHeight, uint32_t Width, uint32_t Height, VkImageView srcImgView, CAS_State CASState, bool packedMathEnabled) 138 | { 139 | m_renderWidth = renderWidth; 140 | m_renderHeight = renderHeight; 141 | m_width = Width; 142 | m_height = Height; 143 | 144 | // Create upsample target 145 | { 146 | VkImageCreateInfo textureDesc = {}; 147 | textureDesc.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO; 148 | textureDesc.pNext = 0; 149 | textureDesc.flags = 0; 150 | textureDesc.imageType = VK_IMAGE_TYPE_2D; 151 | textureDesc.format = VK_FORMAT_R16G16B16A16_SFLOAT; 152 | textureDesc.extent.width = Width; 153 | textureDesc.extent.height = Height; 154 | textureDesc.extent.depth = 1; 155 | textureDesc.mipLevels = 1; 156 | textureDesc.arrayLayers = 1; 157 | textureDesc.samples = VK_SAMPLE_COUNT_1_BIT; 158 | textureDesc.tiling = VK_IMAGE_TILING_OPTIMAL; 159 | textureDesc.usage = VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_SAMPLED_BIT; 160 | textureDesc.sharingMode = VK_SHARING_MODE_EXCLUSIVE; 161 | textureDesc.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED; 162 | m_dstTexture.Init(m_pDevice, &textureDesc); 163 | m_dstTexture.CreateSRV(&m_dstTextureSRV); 164 | m_dstLayoutUndefined = true; 165 | 166 | UpdateSharpness(m_sharpenVal, CASState); 167 | } 168 | 169 | // Write CAS descriptor set 170 | { 171 | VkDescriptorImageInfo ImgInfos[2] = {}; 172 | VkWriteDescriptorSet SetWrites[2] = {}; 173 | 174 | // Source img 175 | ImgInfos[0].sampler = VK_NULL_HANDLE; 176 | ImgInfos[0].imageView = srcImgView; 177 | ImgInfos[0].imageLayout = VK_IMAGE_LAYOUT_GENERAL; 178 | 179 | SetWrites[0].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; 180 | SetWrites[0].dstSet = m_upscaleDescriptorSet; 181 | SetWrites[0].dstBinding = 1; 182 | SetWrites[0].descriptorCount = 1; 183 | SetWrites[0].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; 184 | SetWrites[0].pImageInfo = ImgInfos + 0; 185 | 186 | // Dst img 187 | ImgInfos[1].sampler = VK_NULL_HANDLE; 188 | ImgInfos[1].imageView = m_dstTextureSRV; 189 | ImgInfos[1].imageLayout = VK_IMAGE_LAYOUT_GENERAL; 190 | 191 | SetWrites[1].sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; 192 | SetWrites[1].dstSet = m_upscaleDescriptorSet; 193 | SetWrites[1].dstBinding = 2; 194 | SetWrites[1].descriptorCount = 1; 195 | SetWrites[1].descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE; 196 | SetWrites[1].pImageInfo = ImgInfos + 1; 197 | 198 | vkUpdateDescriptorSets(m_pDevice->GetDevice(), _countof(SetWrites), SetWrites, 0, 0); 199 | } 200 | 201 | // Write render src img descriptor set 202 | { 203 | VkDescriptorImageInfo ImgInfo = {}; 204 | ImgInfo.sampler = m_renderSampler; 205 | ImgInfo.imageView = srcImgView; 206 | ImgInfo.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; 207 | 208 | VkWriteDescriptorSet SetWrite = {}; 209 | SetWrite.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; 210 | SetWrite.dstSet = m_renderSrcSRVDescriptorSet; 211 | SetWrite.dstBinding = 0; 212 | SetWrite.descriptorCount = 1; 213 | SetWrite.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; 214 | SetWrite.pImageInfo = &ImgInfo; 215 | 216 | vkUpdateDescriptorSets(m_pDevice->GetDevice(), 1, &SetWrite, 0, 0); 217 | } 218 | 219 | // Write render CAS img descriptor set 220 | { 221 | VkDescriptorImageInfo ImgInfo = {}; 222 | ImgInfo.sampler = m_renderSampler; 223 | ImgInfo.imageView = m_dstTextureSRV; 224 | ImgInfo.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; 225 | 226 | VkWriteDescriptorSet SetWrite = {}; 227 | SetWrite.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; 228 | SetWrite.dstSet = m_renderDstSRVDescriptorSet; 229 | SetWrite.dstBinding = 0; 230 | SetWrite.descriptorCount = 1; 231 | SetWrite.descriptorType = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER; 232 | SetWrite.pImageInfo = &ImgInfo; 233 | 234 | vkUpdateDescriptorSets(m_pDevice->GetDevice(), 1, &SetWrite, 0, 0); 235 | } 236 | } 237 | 238 | void CAS_Filter::OnDestroyWindowSizeDependentResources() 239 | { 240 | m_dstTexture.OnDestroy(); 241 | vkDestroyImageView(m_pDevice->GetDevice(), m_dstTextureSRV, nullptr); 242 | } 243 | 244 | void CAS_Filter::Upscale(VkCommandBuffer cmd_buf, Texture srcImg, VkImageView srcImgView, bool useCas, bool usePacked, CAS_State casState) 245 | { 246 | if (m_dstLayoutUndefined) 247 | { 248 | m_dstLayoutUndefined = false; 249 | 250 | // The dst texture was just created, so we transition it out of its undefined layout 251 | VkImageMemoryBarrier barrier = {}; 252 | barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; 253 | barrier.srcAccessMask = 0; 254 | barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT; 255 | barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED; 256 | barrier.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; 257 | barrier.image = m_dstTexture.Resource(); 258 | barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; 259 | barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; 260 | barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; 261 | barrier.subresourceRange.baseMipLevel = 0; 262 | barrier.subresourceRange.levelCount = 1; 263 | barrier.subresourceRange.baseArrayLayer = 0; 264 | barrier.subresourceRange.layerCount = 1; 265 | 266 | vkCmdPipelineBarrier(cmd_buf, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0, 0, NULL, 0, NULL, 1, &barrier); 267 | } 268 | 269 | VkDescriptorBufferInfo constsHandle; 270 | uint32_t* pConstMem; 271 | m_pDynamicBufferRing->AllocConstantBuffer(sizeof(CASConstants), reinterpret_cast(&pConstMem), &constsHandle); 272 | memcpy(pConstMem, &m_consts, sizeof(CASConstants)); 273 | 274 | if (useCas) 275 | { 276 | // Transition output texture from shader read to general layout 277 | { 278 | VkImageMemoryBarrier barrier = {}; 279 | barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; 280 | barrier.srcAccessMask = VK_ACCESS_SHADER_READ_BIT; 281 | barrier.dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT; 282 | barrier.oldLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; 283 | barrier.newLayout = VK_IMAGE_LAYOUT_GENERAL; 284 | barrier.image = m_dstTexture.Resource(); 285 | barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; 286 | barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; 287 | barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; 288 | barrier.subresourceRange.baseMipLevel = 0; 289 | barrier.subresourceRange.levelCount = 1; 290 | barrier.subresourceRange.baseArrayLayer = 0; 291 | barrier.subresourceRange.layerCount = 1; 292 | 293 | vkCmdPipelineBarrier(cmd_buf, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 0, 0, NULL, 0, NULL, 1, &barrier); 294 | } 295 | 296 | // This value is the image region dim that each thread group of the CAS shader operates on 297 | static const int threadGroupWorkRegionDim = 16; 298 | int dispatchX = (m_width + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim; 299 | int dispatchY = (m_height + (threadGroupWorkRegionDim - 1)) / threadGroupWorkRegionDim; 300 | 301 | if (usePacked) 302 | { 303 | if (casState == CAS_State_SharpenOnly) 304 | { 305 | m_casPackedSharpenOnly.Draw(cmd_buf, constsHandle, m_upscaleDescriptorSet, dispatchX, dispatchY, 1); 306 | } 307 | else if (casState == CAS_State_Upsample) 308 | { 309 | m_casPackedUpsample.Draw(cmd_buf, constsHandle, m_upscaleDescriptorSet, dispatchX, dispatchY, 1); 310 | } 311 | } 312 | else 313 | { 314 | if (casState == CAS_State_SharpenOnly) 315 | { 316 | m_casSharpenOnly.Draw(cmd_buf, constsHandle, m_upscaleDescriptorSet, dispatchX, dispatchY, 1); 317 | } 318 | else if (casState == CAS_State_Upsample) 319 | { 320 | m_casUpsample.Draw(cmd_buf, constsHandle, m_upscaleDescriptorSet, dispatchX, dispatchY, 1); 321 | } 322 | } 323 | 324 | // Transition dstImg from UAV to ps texture 325 | { 326 | VkImageMemoryBarrier barrier = {}; 327 | barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; 328 | barrier.srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT; 329 | barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT; 330 | barrier.oldLayout = VK_IMAGE_LAYOUT_GENERAL; 331 | barrier.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; 332 | barrier.image = m_dstTexture.Resource(); 333 | barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; 334 | barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; 335 | barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; 336 | barrier.subresourceRange.baseMipLevel = 0; 337 | barrier.subresourceRange.levelCount = 1; 338 | barrier.subresourceRange.baseArrayLayer = 0; 339 | barrier.subresourceRange.layerCount = 1; 340 | 341 | vkCmdPipelineBarrier(cmd_buf, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0, 0, NULL, 0, NULL, 1, &barrier); 342 | } 343 | } 344 | 345 | // Transition srcImg from UAV to ps texture 346 | { 347 | VkImageMemoryBarrier barrier = {}; 348 | barrier.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; 349 | barrier.srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT; 350 | barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT; 351 | barrier.oldLayout = VK_IMAGE_LAYOUT_GENERAL; 352 | barrier.newLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; 353 | barrier.image = srcImg.Resource(); 354 | barrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; 355 | barrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; 356 | barrier.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; 357 | barrier.subresourceRange.baseMipLevel = 0; 358 | barrier.subresourceRange.levelCount = 1; 359 | barrier.subresourceRange.baseArrayLayer = 0; 360 | barrier.subresourceRange.layerCount = 1; 361 | 362 | vkCmdPipelineBarrier(cmd_buf, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0, 0, NULL, 0, NULL, 1, &barrier); 363 | } 364 | } 365 | 366 | void CAS_Filter::DrawToSwapChain(VkCommandBuffer cmd_buf, VkImageView srcImgView, bool useCas) 367 | { 368 | if (useCas) 369 | { 370 | // Render to swap chain 371 | m_renderFullscreen.Draw(cmd_buf, {}, m_renderDstSRVDescriptorSet); 372 | } 373 | else 374 | { 375 | m_renderFullscreen.Draw(cmd_buf, {}, m_renderSrcSRVDescriptorSet); 376 | } 377 | } 378 | 379 | void CAS_Filter::UpdateSharpness(float NewSharpenVal, CAS_State CASState) 380 | { 381 | AF1 outWidth = static_cast((CASState == CAS_State_Upsample) ? m_width : m_renderWidth); 382 | AF1 outHeight = static_cast((CASState == CAS_State_Upsample) ? m_height : m_renderHeight); 383 | 384 | CasSetup(reinterpret_cast(&m_consts.Const0), reinterpret_cast(&m_consts.Const1), m_sharpenVal, static_cast(m_renderWidth), 385 | static_cast(m_renderHeight), outWidth, outHeight); 386 | m_sharpenVal = NewSharpenVal; 387 | } 388 | 389 | static const ResolutionInfo s_CommonResolutions[] = 390 | { 391 | { "480p", 640, 480 }, 392 | { "720p", 1280, 720 }, 393 | { "1080p", 1920, 1080 }, 394 | { "1440p", 2560, 1440 }, 395 | }; 396 | 397 | void CAS_Filter::GetSupportedResolutions(uint32_t displayWidth, uint32_t displayHeight, std::vector& supportedList) 398 | { 399 | // Check which of the fixed resolutions we support rendering to with CAS enabled 400 | for (uint32_t iRes = 0; iRes < _countof(s_CommonResolutions); ++iRes) 401 | { 402 | ResolutionInfo currResolution = s_CommonResolutions[iRes]; 403 | if (CasSupportScaling(static_cast(displayWidth), static_cast(displayHeight), static_cast(currResolution.Width), static_cast(currResolution.Height)) && 404 | currResolution.Width < displayWidth && currResolution.Height < displayHeight) 405 | { 406 | supportedList.push_back(currResolution); 407 | } 408 | } 409 | 410 | // Also add the display res as a supported render resolution 411 | ResolutionInfo displayResInfo = {}; 412 | displayResInfo.pName = "Display Res"; 413 | displayResInfo.Width = displayWidth; 414 | displayResInfo.Height = displayHeight; 415 | supportedList.push_back(displayResInfo); 416 | } 417 | } -------------------------------------------------------------------------------- /sample/src/VK/CAS_CS.h: -------------------------------------------------------------------------------- 1 | //CAS Sample 2 | // 3 | // Copyright(c) 2019 Advanced Micro Devices, Inc.All rights reserved. 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files(the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions : 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 15 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | // THE SOFTWARE. 19 | 20 | #pragma once 21 | 22 | #include "PostProc/PostProcCS.h" 23 | #include "PostProc/PostProcPS.h" 24 | 25 | using namespace CAULDRON_VK; 26 | 27 | namespace CAS_SAMPLE_VK 28 | { 29 | enum CAS_State 30 | { 31 | CAS_State_NoCas, 32 | CAS_State_Upsample, 33 | CAS_State_SharpenOnly, 34 | }; 35 | 36 | struct ResolutionInfo 37 | { 38 | const char* pName; 39 | uint32_t Width; 40 | uint32_t Height; 41 | }; 42 | 43 | struct CASConstants 44 | { 45 | XMUINT4 Const0; 46 | XMUINT4 Const1; 47 | }; 48 | 49 | class CAS_Filter 50 | { 51 | public: 52 | void OnCreate(Device* pDevice, VkRenderPass renderPass, VkFormat outFormat, ResourceViewHeaps *pResourceViewHeaps, StaticBufferPool *pStaticBufferPool, DynamicBufferRing *pDynamicBufferRing); 53 | void OnDestroy(); 54 | 55 | void OnCreateWindowSizeDependentResources(uint32_t renderWidth, uint32_t renderHeight, uint32_t Width, uint32_t Height, VkImageView srcImgView, CAS_State CASState, bool packedMathEnabled); 56 | void OnDestroyWindowSizeDependentResources(); 57 | 58 | void Upscale(VkCommandBuffer cmd_buf, Texture srcImg, VkImageView srcImgView, bool useCas, bool usePacked, CAS_State casState); 59 | void DrawToSwapChain(VkCommandBuffer cmd_buf, VkImageView srcImgView, bool useCas); 60 | 61 | void UpdateSharpness(float NewSharpen, CAS_State CASState); 62 | 63 | static void GetSupportedResolutions(uint32_t displayWidth, uint32_t displayHeight, std::vector& supportedList); 64 | 65 | private: 66 | Device *m_pDevice; 67 | ResourceViewHeaps *m_pResourceViewHeaps; 68 | 69 | float m_sharpenVal; 70 | uint32_t m_renderWidth; 71 | uint32_t m_renderHeight; 72 | uint32_t m_width; 73 | uint32_t m_height; 74 | CASConstants m_consts; 75 | 76 | PostProcCS m_casSharpenOnly; 77 | PostProcCS m_casUpsample; 78 | PostProcCS m_casPackedSharpenOnly; 79 | PostProcCS m_casPackedUpsample; 80 | PostProcPS m_renderFullscreen; 81 | 82 | DynamicBufferRing *m_pDynamicBufferRing = NULL; 83 | 84 | Texture m_dstTexture; 85 | VkImageView m_dstTextureSRV; 86 | VkSampler m_renderSampler; // Samples dst texture for rendering to swap chain 87 | 88 | VkDescriptorSet m_upscaleDescriptorSet; 89 | VkDescriptorSetLayout m_upscaleDescriptorSetLayout; 90 | 91 | VkDescriptorSet m_renderDstSRVDescriptorSet; 92 | VkDescriptorSet m_renderSrcSRVDescriptorSet; 93 | VkDescriptorSetLayout m_renderDescriptorSetLayout; 94 | 95 | bool m_dstLayoutUndefined; 96 | }; 97 | } 98 | -------------------------------------------------------------------------------- /sample/src/VK/CAS_RenderPS.glsl: -------------------------------------------------------------------------------- 1 | #version 400 2 | #extension GL_ARB_separate_shader_objects : enable 3 | #extension GL_ARB_shading_language_420pack : enable 4 | 5 | //CAS Sample 6 | // 7 | // Copyright(c) 2019 Advanced Micro Devices, Inc.All rights reserved. 8 | // Permission is hereby granted, free of charge, to any person obtaining a copy 9 | // of this software and associated documentation files(the "Software"), to deal 10 | // in the Software without restriction, including without limitation the rights 11 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | // copies of the Software, and to permit persons to whom the Software is 13 | // furnished to do so, subject to the following conditions : 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | // THE SOFTWARE. 23 | 24 | layout(set=0, binding=0) uniform sampler2D sSampler; 25 | 26 | layout (location = 0) in vec2 inTexCoord; 27 | layout (location = 0) out vec4 outColor; 28 | 29 | void main() 30 | { 31 | outColor = texture(sSampler, inTexCoord.st); 32 | } 33 | -------------------------------------------------------------------------------- /sample/src/VK/CAS_Renderer.h: -------------------------------------------------------------------------------- 1 | //CAS Sample 2 | // 3 | // Copyright(c) 2019 Advanced Micro Devices, Inc.All rights reserved. 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files(the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions : 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 15 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | // THE SOFTWARE. 19 | 20 | #pragma once 21 | 22 | static const int cNumSwapBufs = 2; 23 | 24 | #define USE_VID_MEM true 25 | 26 | using namespace CAULDRON_VK; 27 | using namespace CAS_SAMPLE_VK; 28 | 29 | // 30 | // This class deals with the GPU side of the sample. 31 | // 32 | 33 | class CAS_Renderer 34 | { 35 | public: 36 | struct Spotlight 37 | { 38 | Camera light; 39 | XMFLOAT4 color; 40 | float intensity; 41 | }; 42 | 43 | struct State 44 | { 45 | float time; 46 | Camera camera; 47 | 48 | float exposure; 49 | float iblFactor; 50 | float emmisiveFactor; 51 | 52 | int toneMapper; 53 | int skyDomeType; 54 | bool bDrawBoundingBoxes; 55 | 56 | uint32_t spotlightCount; 57 | Spotlight spotlight[4]; 58 | bool bDrawLightFrustum; 59 | 60 | int renderWidth; 61 | int renderHeight; 62 | bool usePackedMath; 63 | CAS_State CASState; 64 | bool profiling; 65 | float sharpenControl; 66 | }; 67 | 68 | void OnCreate(Device *pDevice, SwapChain *pSwapChain); 69 | void OnDestroy(); 70 | 71 | void OnCreateWindowSizeDependentResources(SwapChain *pSwapChain, State* pState, uint32_t Width, uint32_t Height); 72 | void OnDestroyWindowSizeDependentResources(); 73 | 74 | int LoadScene(GLTFCommon *pGLTFCommon, int stage = 0); 75 | void UnloadScene(); 76 | 77 | const std::vector &GetTimingValues() { return m_TimeStamps; } 78 | 79 | void OnRender(State *pState, SwapChain *pSwapChain); 80 | 81 | void UpdateCASSharpness(float sharpenControl, CAS_State CASState); 82 | 83 | private: 84 | Device *m_pDevice; 85 | 86 | uint32_t m_Width; 87 | uint32_t m_Height; 88 | 89 | VkRect2D m_scissor; 90 | VkRect2D m_finalScissor; 91 | VkViewport m_viewport; 92 | VkViewport m_finalViewport; 93 | 94 | // Initialize helper classes 95 | ResourceViewHeaps m_resourceViewHeaps; 96 | UploadHeap m_UploadHeap; 97 | DynamicBufferRing m_ConstantBufferRing; 98 | StaticBufferPool m_VidMemBufferPool; 99 | StaticBufferPool m_SysMemBufferPool; 100 | CommandListRing m_CommandListRing; 101 | GPUTimestamps m_GPUTimer; 102 | 103 | //gltf passes 104 | GLTFTexturesAndBuffers *m_pGLTFTexturesAndBuffers; 105 | GltfPbrPass *m_pGltfPBR; 106 | GltfDepthPass *m_pGltfDepth; 107 | GltfBBoxPass *m_pGltfBBox; 108 | 109 | // effects 110 | Bloom m_bloom; 111 | SkyDome m_skyDome; 112 | DownSamplePS m_downSample; 113 | SkyDomeProc m_skyDomeProc; 114 | ToneMapping m_toneMapping; 115 | CAS_Filter m_CAS; 116 | 117 | // GUI 118 | ImGUI m_ImGUI; 119 | 120 | // Temporary render targets 121 | 122 | // depth buffer 123 | Texture m_depthBuffer; 124 | VkImageView m_depthBufferView; 125 | 126 | // shadowmaps 127 | Texture m_shadowMap; 128 | VkImageView m_shadowMapDSV; 129 | VkImageView m_shadowMapSRV; 130 | 131 | // MSAA RT 132 | Texture m_HDRMSAA; 133 | VkImageView m_HDRSRV; 134 | VkImageView m_HDRMSAASRV; 135 | 136 | // Resolved RT 137 | Texture m_HDR; 138 | 139 | // Tone map RT 140 | Texture m_tonemapTexture; 141 | VkImageView m_tonemapSRV; 142 | 143 | // widgets 144 | Wireframe m_wireframe; 145 | WireframeBox m_wireframeBox; 146 | 147 | VkRenderPass m_render_pass_shadow; 148 | VkRenderPass m_render_pass_HDR_MSAA; 149 | VkRenderPass m_render_pass_tonemap; 150 | VkRenderPass m_render_pass_swap_chain; 151 | 152 | VkFramebuffer m_shadowMapBuffers; 153 | VkFramebuffer m_frameBuffer_HDR_MSAA; 154 | VkFramebuffer m_frameBuffer_tonemap; 155 | 156 | std::vector m_TimeStamps; 157 | }; 158 | 159 | -------------------------------------------------------------------------------- /sample/src/VK/CAS_Sample.cpp: -------------------------------------------------------------------------------- 1 | //CAS Sample 2 | // 3 | // Copyright(c) 2020 Advanced Micro Devices, Inc.All rights reserved. 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files(the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions : 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 15 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | // THE SOFTWARE. 19 | 20 | #include "stdafx.h" 21 | 22 | #include "CAS_Sample.h" 23 | 24 | #if _DEBUG 25 | const bool VALIDATION_ENABLED = true; 26 | #else 27 | const bool VALIDATION_ENABLED = false; 28 | #endif 29 | 30 | CAS_Sample::CAS_Sample(LPCSTR name) : FrameworkWindows(name) 31 | { 32 | m_lastFrameTime = MillisecondsNow(); 33 | m_time = 0; 34 | m_bPlay = true; 35 | 36 | m_pGltfLoader = NULL; 37 | } 38 | 39 | //-------------------------------------------------------------------------------------- 40 | // 41 | // OnCreate 42 | // 43 | //-------------------------------------------------------------------------------------- 44 | void CAS_Sample::OnCreate(HWND hWnd) 45 | { 46 | // Create Device 47 | // 48 | m_device.OnCreate("CAS VK Sample v1.0", "CAS VK Engine v1.0", VALIDATION_ENABLED, hWnd); 49 | m_device.CreatePipelineCache(); 50 | 51 | //init the shader compiler 52 | CreateShaderCache(); 53 | 54 | // Create Swapchain 55 | // 56 | m_swapChain.OnCreate(&m_device, cNumSwapBufs, hWnd); 57 | 58 | // Create a instance of the renderer and initialize it, we need to do that for each GPU 59 | // 60 | m_pNode = new CAS_Renderer(); 61 | m_pNode->OnCreate(&m_device, &m_swapChain); 62 | 63 | // init GUI (non gfx stuff) 64 | // 65 | ImGUI_Init(reinterpret_cast(hWnd)); 66 | 67 | // Init Camera, looking at the origin 68 | // 69 | m_roll = 0.0f; 70 | m_pitch = 0.0f; 71 | m_distance = 3.5f; 72 | 73 | // init GUI state 74 | m_state.toneMapper = 0; 75 | m_state.skyDomeType = 0; 76 | m_state.exposure = 1.0f; 77 | m_state.iblFactor = 2.0f; 78 | m_state.emmisiveFactor = 1.0f; 79 | m_state.bDrawLightFrustum = false; 80 | m_state.bDrawBoundingBoxes = false; 81 | m_state.camera.LookAt(m_roll, m_pitch, m_distance, XMVectorSet(0, 0, 0, 0)); 82 | 83 | m_state.spotlightCount = 1; 84 | 85 | m_state.spotlight[0].intensity = 10.0f; 86 | m_state.spotlight[0].color = XMFLOAT4(1.0f, 1.0f, 1.0f, 0.0f); 87 | m_state.spotlight[0].light.SetFov(XM_PI / 2.0f, 1024, 1024, 0.1f, 100.0f); 88 | m_state.spotlight[0].light.LookAt(XM_PI / 2.0f, 0.58f, 3.5f, XMVectorSet(0, 0, 0, 0)); 89 | 90 | m_state.sharpenControl = 0.0f; 91 | m_state.renderWidth = 0; 92 | m_state.renderHeight = 0; 93 | m_state.CASState = CAS_State_NoCas; 94 | m_state.usePackedMath = false; 95 | m_state.profiling = false; 96 | 97 | // Init profiling state 98 | m_CASTimingsCurrId = 0; 99 | m_CASAvgTiming = 0; 100 | } 101 | 102 | //-------------------------------------------------------------------------------------- 103 | // 104 | // OnDestroy 105 | // 106 | //-------------------------------------------------------------------------------------- 107 | void CAS_Sample::OnDestroy() 108 | { 109 | ImGUI_Shutdown(); 110 | 111 | m_device.GPUFlush(); 112 | 113 | // Fullscreen state should always be false before exiting the app. 114 | m_swapChain.SetFullScreen(false); 115 | 116 | m_pNode->UnloadScene(); 117 | m_pNode->OnDestroyWindowSizeDependentResources(); 118 | m_pNode->OnDestroy(); 119 | 120 | if (m_pNode) 121 | { 122 | delete m_pNode; 123 | m_pNode = 0; 124 | } 125 | 126 | m_swapChain.OnDestroyWindowSizeDependentResources(); 127 | m_swapChain.OnDestroy(); 128 | 129 | //shut down the shader compiler 130 | DestroyShaderCache(&m_device); 131 | 132 | if (m_pGltfLoader) 133 | { 134 | delete m_pGltfLoader; 135 | m_pGltfLoader = NULL; 136 | } 137 | 138 | m_device.DestroyPipelineCache(); 139 | m_device.OnDestroy(); 140 | } 141 | 142 | //-------------------------------------------------------------------------------------- 143 | // 144 | // OnEvent 145 | // 146 | //-------------------------------------------------------------------------------------- 147 | bool CAS_Sample::OnEvent(MSG msg) 148 | { 149 | if (ImGUI_WndProcHandler(msg.hwnd, msg.message, msg.wParam, msg.lParam)) 150 | return true; 151 | return true; 152 | } 153 | 154 | //-------------------------------------------------------------------------------------- 155 | // 156 | // SetFullScreen 157 | // 158 | //-------------------------------------------------------------------------------------- 159 | void CAS_Sample::SetFullScreen(bool fullscreen) 160 | { 161 | m_device.GPUFlush(); 162 | 163 | m_swapChain.SetFullScreen(fullscreen); 164 | } 165 | 166 | //-------------------------------------------------------------------------------------- 167 | // 168 | // OnResize 169 | // 170 | //-------------------------------------------------------------------------------------- 171 | void CAS_Sample::OnResize(uint32_t width, uint32_t height) 172 | { 173 | if (m_Width != width || m_Height != height) 174 | { 175 | // Flush GPU 176 | // 177 | m_device.GPUFlush(); 178 | 179 | // If resizing but no minimizing 180 | // 181 | if (m_Width > 0 && m_Height > 0) 182 | { 183 | m_pNode->OnDestroyWindowSizeDependentResources(); 184 | m_swapChain.OnDestroyWindowSizeDependentResources(); 185 | } 186 | 187 | m_Width = width; 188 | m_Height = height; 189 | 190 | // NOTE: Reset render width/height and display mode 191 | { 192 | std::vector supportedResolutions = {}; 193 | CAS_Filter::GetSupportedResolutions(m_Width, m_Height, supportedResolutions); 194 | 195 | m_currDisplayMode = 0; 196 | m_state.renderWidth = supportedResolutions[m_currDisplayMode].Width; 197 | m_state.renderHeight = supportedResolutions[m_currDisplayMode].Height; 198 | } 199 | 200 | // if resizing but not minimizing the recreate it with the new size 201 | // 202 | if (m_Width > 0 && m_Height > 0) 203 | { 204 | m_swapChain.OnCreateWindowSizeDependentResources(m_Width, m_Height, false); 205 | m_pNode->OnCreateWindowSizeDependentResources(&m_swapChain, &m_state, m_Width, m_Height); 206 | } 207 | } 208 | m_state.camera.SetFov(XM_PI / 4, m_Width, m_Height, 0.1f, 1000.0f); 209 | } 210 | 211 | //-------------------------------------------------------------------------------------- 212 | // 213 | // OnRender 214 | // 215 | //-------------------------------------------------------------------------------------- 216 | 217 | void CAS_Sample::OnRender() 218 | { 219 | // Get timings 220 | // 221 | double timeNow = MillisecondsNow(); 222 | m_deltaTime = timeNow - m_lastFrameTime; 223 | m_lastFrameTime = timeNow; 224 | 225 | // Build UI and set the scene state. Note that the rendering of the UI happens later. 226 | // 227 | ImGUI_UpdateIO(); 228 | ImGui::NewFrame(); 229 | 230 | static int loadingStage = 0; 231 | if (loadingStage >= 0) 232 | { 233 | // LoadScene needs to be called a number of times, the scene is not fully loaded until it returns -1 234 | // This is done so we can display a progress bar when the scene is loading 235 | if (m_pGltfLoader == NULL) 236 | { 237 | m_pGltfLoader = new GLTFCommon(); 238 | m_pGltfLoader->Load("..\\media\\DamagedHelmet\\glTF\\", "DamagedHelmet.gltf"); 239 | loadingStage = 0; 240 | } 241 | loadingStage = m_pNode->LoadScene(m_pGltfLoader, loadingStage); 242 | } 243 | else 244 | { 245 | ImGuiStyle& style = ImGui::GetStyle(); 246 | style.FrameBorderSize = 1.0f; 247 | 248 | bool opened = true; 249 | ImGui::Begin("Stats", &opened); 250 | 251 | if (ImGui::CollapsingHeader("Info", ImGuiTreeNodeFlags_DefaultOpen)) 252 | { 253 | ImGui::Text("Resolution : %ix%i", m_Width, m_Height); 254 | } 255 | 256 | if (ImGui::CollapsingHeader("Animation", ImGuiTreeNodeFlags_DefaultOpen)) 257 | { 258 | ImGui::Checkbox("Play", &m_bPlay); 259 | ImGui::SliderFloat("Time", &m_time, 0, 30); 260 | } 261 | 262 | if (ImGui::CollapsingHeader("Model Selection", ImGuiTreeNodeFlags_DefaultOpen)) 263 | { 264 | const char * models[] = { "busterDrone", "BoomBox", "SciFiHelmet", "DamagedHelmet", "Sponza", "MetalRoughSpheres"}; 265 | static int selected = 3; 266 | if (ImGui::Combo("model", &selected, models, _countof(models))) 267 | { 268 | { 269 | //free resources, unload the current scene, and load new scene... 270 | m_device.GPUFlush(); 271 | 272 | m_pNode->UnloadScene(); 273 | m_pNode->OnDestroyWindowSizeDependentResources(); 274 | m_pGltfLoader->Unload(); 275 | m_pNode->OnDestroy(); 276 | m_pNode->OnCreate(&m_device, &m_swapChain); 277 | m_pNode->OnCreateWindowSizeDependentResources(&m_swapChain, &m_state, m_Width, m_Height); 278 | } 279 | 280 | m_pGltfLoader = new GLTFCommon(); 281 | bool res = false; 282 | switch (selected) 283 | { 284 | case 0: 285 | m_state.iblFactor = 1.0f; 286 | m_roll = 0.0f; m_pitch = 0.0f; m_distance = 3.5f; 287 | m_state.camera.LookAt(m_roll, m_pitch, m_distance, XMVectorSet(0, 0, 0, 0)); 288 | res = m_pGltfLoader->Load("..\\media\\buster_drone\\", "busterDrone.gltf"); break; 289 | case 1: 290 | m_state.iblFactor = 1.0f; 291 | m_roll = 0.0f; m_pitch = 0.0f; m_distance = 3.5f; 292 | m_state.camera.LookAt(m_roll, m_pitch, m_distance, XMVectorSet(0, 0, 0, 0)); 293 | res = m_pGltfLoader->Load("..\\media\\BoomBox\\glTF\\", "BoomBox.gltf"); break; 294 | case 2: 295 | m_state.iblFactor = 1.0f; 296 | m_roll = 0.0f; m_pitch = 0.0f; m_distance = 3.5f; 297 | m_state.camera.LookAt(m_roll, m_pitch, m_distance, XMVectorSet(0, 0, 0, 0)); 298 | res = m_pGltfLoader->Load("..\\media\\SciFiHelmet\\glTF\\", "SciFiHelmet.gltf"); break; 299 | case 3: 300 | m_state.iblFactor = 2.0f; 301 | m_roll = 0.0f; m_pitch = 0.0f; m_distance = 3.5f; 302 | m_state.camera.LookAt(m_roll, m_pitch, m_distance, XMVectorSet(0, 0, 0, 0)); 303 | res = m_pGltfLoader->Load("..\\media\\DamagedHelmet\\glTF\\", "DamagedHelmet.gltf"); break; 304 | case 4: 305 | m_state.iblFactor = 0.362f; 306 | m_pitch = 0.182035938f; m_roll = 1.92130506f; m_distance = 4.83333349f; 307 | m_state.camera.LookAt(m_roll, m_pitch, m_distance, XMVectorSet(0.703276634f, 1.02280307f, 0.218072295f, 0)); 308 | res = m_pGltfLoader->Load("..\\media\\sponza\\gltf\\", "sponza.gltf"); break; 309 | case 5: 310 | m_state.iblFactor = 1.0f; 311 | m_roll = 0.0f; m_pitch = 0.0f; m_distance = 16.0f; 312 | m_state.camera.LookAt(m_roll, m_pitch, m_distance, XMVectorSet(0, 0, 0, 0)); 313 | res = m_pGltfLoader->Load("..\\media\\MetalRoughSpheres\\glTF\\", "MetalRoughSpheres.gltf"); break; 314 | } 315 | 316 | if (res == false) 317 | { 318 | ImGui::OpenPopup("Error"); 319 | 320 | delete m_pGltfLoader; 321 | m_pGltfLoader = NULL; 322 | } 323 | else 324 | { 325 | loadingStage = m_pNode->LoadScene(m_pGltfLoader, 0); 326 | } 327 | 328 | ImGui::End(); 329 | ImGui::EndFrame(); 330 | return; 331 | } 332 | } 333 | 334 | std::vector supportedResolutions = {}; 335 | CAS_Filter::GetSupportedResolutions(m_Width, m_Height, supportedResolutions); 336 | auto itemsGetter = [](void* data, int idx, const char** outText) 337 | { 338 | ResolutionInfo* resolutions = reinterpret_cast(data); 339 | *outText = resolutions[idx].pName; 340 | return true; 341 | }; 342 | 343 | int oldDisplayMode = m_currDisplayMode; 344 | ImGui::Combo("Render Dim", &m_currDisplayMode, itemsGetter, reinterpret_cast(&supportedResolutions.front()), static_cast(supportedResolutions.size())); 345 | 346 | if (m_device.IsFp16Supported()) 347 | { 348 | ImGui::Checkbox("Enable Packed Math", &m_state.usePackedMath); 349 | } 350 | 351 | int oldCasState = (int)m_state.CASState; 352 | const char* casItemNames[] = 353 | { 354 | "No Cas", 355 | "Cas Upsample", 356 | "Cas Sharpen Only", 357 | }; 358 | ImGui::Combo("Cas Options", (int*)&m_state.CASState, casItemNames, _countof(casItemNames)); 359 | 360 | ImGuiIO& io = ImGui::GetIO(); 361 | if (io.KeysDownDuration['Q'] == 0.0f) 362 | { 363 | m_state.CASState = CAS_State_NoCas; 364 | } 365 | else if (io.KeysDownDuration['W'] == 0.0f) 366 | { 367 | m_state.CASState = CAS_State_Upsample; 368 | } 369 | else if (io.KeysDownDuration['E'] == 0.0f) 370 | { 371 | m_state.CASState = CAS_State_SharpenOnly; 372 | } 373 | 374 | if (oldDisplayMode != m_currDisplayMode || oldCasState != m_state.CASState) 375 | { 376 | m_state.renderWidth = supportedResolutions[m_currDisplayMode].Width; 377 | m_state.renderHeight = supportedResolutions[m_currDisplayMode].Height; 378 | 379 | m_device.GPUFlush(); 380 | m_pNode->OnDestroyWindowSizeDependentResources(); 381 | m_pNode->OnCreateWindowSizeDependentResources(&m_swapChain, &m_state, m_Width, m_Height); 382 | } 383 | 384 | float NewCASSharpen = m_state.sharpenControl; 385 | ImGui::SliderFloat("Cas Sharpen", &NewCASSharpen, 0, 1); 386 | 387 | if (NewCASSharpen != m_state.sharpenControl) 388 | { 389 | m_state.sharpenControl = NewCASSharpen; 390 | m_pNode->UpdateCASSharpness(m_state.sharpenControl, m_state.CASState); 391 | } 392 | 393 | const char * cameraControl[] = { "WASD", "Orbit" }; 394 | static int cameraControlSelected = 1; 395 | ImGui::Combo("Camera", &cameraControlSelected, cameraControl, _countof(cameraControl)); 396 | 397 | float CASTime = 0.0f; 398 | if (ImGui::CollapsingHeader("Profiler", ImGuiTreeNodeFlags_DefaultOpen)) 399 | { 400 | std::vector timeStamps = m_pNode->GetTimingValues(); 401 | if (timeStamps.size() > 0) 402 | { 403 | for (uint32_t i = 1; i < timeStamps.size(); i++) 404 | { 405 | float DeltaTime = ((float)(timeStamps[i].m_microseconds - timeStamps[i - 1].m_microseconds)); 406 | if (strcmp("CAS", timeStamps[i].m_label.c_str()) == 0) 407 | { 408 | CASTime = DeltaTime; 409 | } 410 | 411 | ImGui::Text("%-17s: %7.1f us", timeStamps[i].m_label.c_str(), DeltaTime); 412 | } 413 | 414 | //scrolling data and average computing 415 | static float values[128]; 416 | values[127] = static_cast(timeStamps.back().m_microseconds - timeStamps.front().m_microseconds); 417 | float average = values[0]; 418 | for (uint32_t i = 0; i < 128 - 1; i++) { values[i] = values[i + 1]; average += values[i]; } 419 | average /= 128; 420 | 421 | ImGui::Text("%-17s: %7.1f us", "TotalGPUTime", average); 422 | ImGui::PlotLines("", values, 128, 0, "", 0.0f, 30000.0f, ImVec2(0, 80)); 423 | } 424 | } 425 | 426 | if (m_state.profiling) 427 | { 428 | m_CASTimings[m_CASTimingsCurrId++] = CASTime; 429 | if (m_CASTimingsCurrId == _countof(m_CASTimings)) 430 | { 431 | m_state.profiling = false; 432 | m_CASTimingsCurrId = 0; 433 | for (int i = 0; i < _countof(m_CASTimings); ++i) 434 | { 435 | m_CASAvgTiming += m_CASTimings[i]; 436 | } 437 | 438 | m_CASAvgTiming /= static_cast(_countof(m_CASTimings)); 439 | } 440 | } 441 | 442 | bool isHit = ImGui::Button("Start Timing", { 150, 30 }); 443 | if (isHit) 444 | { 445 | m_state.profiling = true; 446 | } 447 | 448 | ImGui::Text("Avg Cas Time: %f", m_CASAvgTiming); 449 | 450 | #ifdef USE_VMA 451 | if (ImGui::Button("Save VMA json")) 452 | { 453 | char *pJson; 454 | vmaBuildStatsString(m_device.GetAllocator(), &pJson, VK_TRUE); 455 | 456 | static char filename[256]; 457 | time_t now = time(NULL); 458 | tm buf; 459 | localtime_s(&buf, &now); 460 | strftime(filename, sizeof(filename), "VMA_%Y%m%d_%H%M%S.json", &buf); 461 | std::ofstream ofs(filename, std::ofstream::out); 462 | ofs << pJson; 463 | ofs.close(); 464 | vmaFreeStatsString(m_device.GetAllocator(), pJson); 465 | } 466 | #endif 467 | 468 | ImGui::End(); 469 | 470 | // If the mouse was not used by the GUI then it's for the camera 471 | // 472 | if (io.WantCaptureMouse == false) 473 | { 474 | if ((io.KeyCtrl == false) && (io.MouseDown[0] == true)) 475 | { 476 | m_roll -= io.MouseDelta.x / 100.f; 477 | m_pitch += io.MouseDelta.y / 100.f; 478 | } 479 | 480 | // Choose camera movement depending on setting 481 | // 482 | 483 | if (cameraControlSelected == 0) 484 | { 485 | // WASD 486 | // 487 | m_state.camera.UpdateCameraWASD(m_roll, m_pitch, io.KeysDown, io.DeltaTime); 488 | } 489 | else if (cameraControlSelected == 1) 490 | { 491 | // Orbiting 492 | // 493 | m_distance -= static_cast(io.MouseWheel) / 3.0f; 494 | m_distance = std::max(m_distance, 0.1f); 495 | 496 | bool panning = (io.KeyCtrl == true) && (io.MouseDown[0] == true); 497 | 498 | m_state.camera.UpdateCameraPolar(m_roll, m_pitch, panning ? -io.MouseDelta.x / 100.0f : 0.0f, panning ? io.MouseDelta.y / 100.0f : 0.0f, m_distance); 499 | } 500 | } 501 | } 502 | 503 | // Set animation time 504 | // 505 | if (m_bPlay) 506 | { 507 | m_time += static_cast(m_deltaTime) / 1000.0f; 508 | } 509 | 510 | // Animate and transform the scene 511 | // 512 | if (m_pGltfLoader) 513 | { 514 | m_pGltfLoader->SetAnimationTime(0, m_time); 515 | m_pGltfLoader->TransformScene(0, XMMatrixIdentity()); 516 | } 517 | 518 | m_state.time = m_time; 519 | 520 | // Do Render frame using AFR 521 | // 522 | m_pNode->OnRender(&m_state, &m_swapChain); 523 | 524 | m_swapChain.Present(); 525 | } 526 | 527 | 528 | //-------------------------------------------------------------------------------------- 529 | // 530 | // WinMain 531 | // 532 | //-------------------------------------------------------------------------------------- 533 | int WINAPI WinMain(HINSTANCE hInstance, 534 | HINSTANCE hPrevInstance, 535 | LPSTR lpCmdLine, 536 | int nCmdShow) 537 | { 538 | LPCSTR Name = "CAS VK Sample v1.0"; 539 | uint32_t Width = 1280; 540 | uint32_t Height = 720; 541 | 542 | // create new Vulkan sample 543 | return RunFramework(hInstance, lpCmdLine, nCmdShow, Width, Height, new CAS_Sample(Name)); 544 | } 545 | 546 | -------------------------------------------------------------------------------- /sample/src/VK/CAS_Sample.h: -------------------------------------------------------------------------------- 1 | //CAS Sample 2 | // 3 | // Copyright(c) 2019 Advanced Micro Devices, Inc.All rights reserved. 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files(the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions : 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 15 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | // THE SOFTWARE. 19 | 20 | #pragma once 21 | 22 | #include "CAS_Renderer.h" 23 | 24 | // 25 | // This is the main class, it manages the state of the sample and does all the high level work without touching the GPU directly. 26 | // This class uses the GPU via the the SampleRenderer class. We would have a SampleRenderer instance for each GPU. 27 | // 28 | // This class takes care of: 29 | // 30 | // - loading a scene (just the CPU data) 31 | // - updating the camera 32 | // - keeping track of time 33 | // - handling the keyboard 34 | // - updating the animation 35 | // - building the UI (but do not renders it) 36 | // - uses the SampleRenderer to update all the state to the GPU and do the rendering 37 | // 38 | 39 | class CAS_Sample : public FrameworkWindows 40 | { 41 | public: 42 | CAS_Sample(LPCSTR name); 43 | void OnCreate(HWND hWnd); 44 | void OnDestroy(); 45 | void OnRender(); 46 | bool OnEvent(MSG msg); 47 | void OnResize(uint32_t Width, uint32_t Height); 48 | void SetFullScreen(bool fullscreen); 49 | 50 | private: 51 | Device m_device; 52 | SwapChain m_swapChain; 53 | 54 | GLTFCommon *m_pGltfLoader; 55 | 56 | CAS_Renderer *m_pNode; 57 | CAS_Renderer::State m_state; 58 | 59 | float m_distance; 60 | float m_roll; 61 | float m_pitch; 62 | 63 | float m_time; // WallClock in seconds. 64 | double m_deltaTime; // The elapsed time in milliseconds since the previous frame. 65 | double m_lastFrameTime; 66 | 67 | bool m_bPlay; 68 | int m_currDisplayMode; 69 | 70 | // Profiling info for CAS 71 | int m_CASTimingsCurrId; 72 | float m_CASTimings[300]; 73 | float m_CASAvgTiming; 74 | }; -------------------------------------------------------------------------------- /sample/src/VK/CAS_Shader.glsl: -------------------------------------------------------------------------------- 1 | #version 450 2 | #extension GL_ARB_separate_shader_objects : enable 3 | #extension GL_ARB_shading_language_420pack : enable 4 | #extension GL_GOOGLE_include_directive : enable 5 | 6 | //CAS Sample 7 | // 8 | // Copyright(c) 2019 Advanced Micro Devices, Inc.All rights reserved. 9 | // Permission is hereby granted, free of charge, to any person obtaining a copy 10 | // of this software and associated documentation files(the "Software"), to deal 11 | // in the Software without restriction, including without limitation the rights 12 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 13 | // copies of the Software, and to permit persons to whom the Software is 14 | // furnished to do so, subject to the following conditions : 15 | // The above copyright notice and this permission notice shall be included in 16 | // all copies or substantial portions of the Software. 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | 25 | layout(set=0,binding=0) uniform const_buffer 26 | { 27 | uvec4 const0; 28 | uvec4 const1; 29 | }; 30 | 31 | layout(set=0,binding=1,rgba16) uniform image2D imgSrc; 32 | 33 | layout(set=0,binding=2,rgba16) uniform image2D imgDst; 34 | 35 | #define A_GPU 1 36 | #define A_GLSL 1 37 | 38 | #if CAS_SAMPLE_FP16 39 | 40 | #define A_HALF 1 41 | #define CAS_PACKED_ONLY 1 42 | 43 | #endif 44 | 45 | #include "ffx_a.h" 46 | 47 | #if CAS_SAMPLE_FP16 48 | 49 | AH3 CasLoadH(ASW2 p) 50 | { 51 | return AH3(imageLoad(imgSrc,ASU2(p)).rgb); 52 | } 53 | 54 | // Lets you transform input from the load into a linear color space between 0 and 1. See ffx_cas.h 55 | // In this case, our input is already linear and between 0 and 1 56 | void CasInputH(inout AH2 r, inout AH2 g, inout AH2 b) {} 57 | 58 | #else 59 | 60 | AF3 CasLoad(ASU2 p) 61 | { 62 | return imageLoad(imgSrc,p).rgb; 63 | } 64 | 65 | // Lets you transform input from the load into a linear color space between 0 and 1. See ffx_cas.h 66 | // In this case, our input is already linear and between 0 and 1 67 | void CasInput(inout AF1 r, inout AF1 g, inout AF1 b) {} 68 | 69 | #endif 70 | 71 | #include "ffx_cas.h" 72 | 73 | layout(local_size_x=64) in; 74 | void main() 75 | { 76 | // Do remapping of local xy in workgroup for a more PS-like swizzle pattern. 77 | AU2 gxy = ARmp8x8(gl_LocalInvocationID.x)+AU2(gl_WorkGroupID.x<<4u,gl_WorkGroupID.y<<4u); 78 | 79 | bool sharpenOnly; 80 | #if CAS_SAMPLE_SHARPEN_ONLY 81 | sharpenOnly = true; 82 | #else 83 | sharpenOnly = false; 84 | #endif 85 | 86 | #if CAS_SAMPLE_FP16 87 | 88 | // Filter. 89 | AH4 c0,c1; 90 | AH2 cR, cG, cB; 91 | 92 | CasFilterH(cR, cG, cB, gxy, const0, const1, sharpenOnly); 93 | CasDepack(c0, c1, cR, cG, cB); 94 | imageStore(imgDst, ASU2(gxy), AF4(c0)); 95 | imageStore(imgDst, ASU2(gxy)+ASU2(8,0), AF4(c1)); 96 | gxy.y+=8u; 97 | 98 | CasFilterH(cR, cG, cB, gxy, const0, const1, sharpenOnly); 99 | CasDepack(c0, c1, cR, cG, cB); 100 | imageStore(imgDst, ASU2(gxy), AF4(c0)); 101 | imageStore(imgDst, ASU2(gxy)+ASU2(8,0), AF4(c1)); 102 | 103 | #else 104 | 105 | // Filter. 106 | AF4 c; 107 | CasFilter(c.r, c.g, c.b, gxy, const0, const1, sharpenOnly); 108 | imageStore(imgDst, ASU2(gxy), c); 109 | gxy.x += 8u; 110 | 111 | CasFilter(c.r, c.g, c.b, gxy, const0, const1, sharpenOnly); 112 | imageStore(imgDst, ASU2(gxy), c); 113 | gxy.y += 8u; 114 | 115 | CasFilter(c.r, c.g, c.b, gxy, const0, const1, sharpenOnly); 116 | imageStore(imgDst, ASU2(gxy), c); 117 | gxy.x -= 8u; 118 | 119 | CasFilter(c.r, c.g, c.b, gxy, const0, const1, sharpenOnly); 120 | imageStore(imgDst, ASU2(gxy), c); 121 | 122 | #endif 123 | } -------------------------------------------------------------------------------- /sample/src/VK/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # CAS Sample 2 | # 3 | # Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. 4 | # Permission is hereby granted, free of charge, to any person obtaining a copy 5 | # of this software and associated documentation files (the "Software"), to deal 6 | # in the Software without restriction, including without limitation the rights 7 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | # copies of the Software, and to permit persons to whom the Software is 9 | # furnished to do so, subject to the following conditions: 10 | # The above copyright notice and this permission notice shall be included in 11 | # all copies or substantial portions of the Software. 12 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | # THE SOFTWARE. 19 | 20 | project (CAS_Sample_VK) 21 | 22 | include(${CMAKE_CURRENT_SOURCE_DIR}/../../common.cmake) 23 | 24 | set(sources 25 | CAS_CS.cpp 26 | CAS_CS.h 27 | CAS_Sample.cpp 28 | CAS_Sample.h 29 | CAS_Renderer.cpp 30 | CAS_Renderer.h 31 | stdafx.cpp 32 | stdafx.h) 33 | 34 | source_group("Sources" FILES ${sources}) 35 | 36 | set(Shaders_src 37 | ${CMAKE_CURRENT_SOURCE_DIR}/CAS_Shader.glsl 38 | ${CMAKE_CURRENT_SOURCE_DIR}/CAS_RenderPS.glsl 39 | ${CMAKE_CURRENT_SOURCE_DIR}/../../../ffx-cas/ffx_a.h 40 | ${CMAKE_CURRENT_SOURCE_DIR}/../../../ffx-cas/ffx_cas.h) 41 | 42 | source_group("Shaders" FILES ${Shaders_src}) 43 | 44 | copyCommand("${Shaders_src}" ${CMAKE_HOME_DIRECTORY}/bin/ShaderLibVK) 45 | 46 | add_executable(${PROJECT_NAME} WIN32 ${sources} ${Shaders_src}) 47 | target_link_libraries (${PROJECT_NAME} LINK_PUBLIC Cauldron_VK ImGUI Vulkan::Vulkan) 48 | target_include_directories (${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../../ffx-cas) 49 | 50 | set_target_properties(${PROJECT_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_HOME_DIRECTORY}/bin") 51 | set_source_files_properties(${Shaders_src} PROPERTIES VS_TOOL_OVERRIDE "Text") 52 | addManifest(${PROJECT_NAME}) -------------------------------------------------------------------------------- /sample/src/VK/dpiawarescaling.manifest: -------------------------------------------------------------------------------- 1 | 2 | 22 | 23 | 24 | 25 | true/PM 26 | 27 | 28 | -------------------------------------------------------------------------------- /sample/src/VK/stdafx.cpp: -------------------------------------------------------------------------------- 1 | //CAS Sample 2 | // 3 | // Copyright(c) 2019 Advanced Micro Devices, Inc.All rights reserved. 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files(the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions : 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 15 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | // THE SOFTWARE. 19 | 20 | // stdafx.cpp : source file that includes just the standard includes 21 | // ObjRendererD3D12.pch will be the pre-compiled header 22 | // stdafx.obj will contain the pre-compiled type information 23 | 24 | #include "stdafx.h" 25 | 26 | // TODO: reference any additional headers you need in STDAFX.H 27 | // and not in this file 28 | 29 | 30 | -------------------------------------------------------------------------------- /sample/src/VK/stdafx.h: -------------------------------------------------------------------------------- 1 | //CAS Sample 2 | // 3 | // Copyright(c) 2019 Advanced Micro Devices, Inc.All rights reserved. 4 | // Permission is hereby granted, free of charge, to any person obtaining a copy 5 | // of this software and associated documentation files(the "Software"), to deal 6 | // in the Software without restriction, including without limitation the rights 7 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | // copies of the Software, and to permit persons to whom the Software is 9 | // furnished to do so, subject to the following conditions : 10 | // The above copyright notice and this permission notice shall be included in 11 | // all copies or substantial portions of the Software. 12 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE 15 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | // THE SOFTWARE. 19 | 20 | // stdafx.h : include file for standard system include files, 21 | // or project specific include files that are used frequently, but 22 | // are changed infrequently 23 | // 24 | #pragma once 25 | 26 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 27 | // Windows Header Files: 28 | #include 29 | #include 30 | 31 | // C RunTime Header Files 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #include "vulkan/vulkan.h" 40 | 41 | // we are using DirectXMath 42 | #include 43 | using namespace DirectX; 44 | 45 | // TODO: reference additional headers your program requires here 46 | #include "Base\Imgui.h" 47 | #include "Base\ImguiHelper.h" 48 | #include "Base\Device.h" 49 | #include "Base\Helper.h" 50 | #include "Base\Texture.h" 51 | #include "Base\SwapChain.h" 52 | #include "Base\UploadHeap.h" 53 | #include "Base\GPUTimeStamps.h" 54 | #include "Base\ExtDebugMarkers.h" 55 | #include "Base\CommandListRing.h" 56 | #include "Base\StaticBufferPool.h" 57 | #include "Base\DynamicBufferRing.h" 58 | #include "Base\ResourceViewHeaps.h" 59 | #include "Base\ShaderCompilerHelper.h" 60 | 61 | #include "Misc\Misc.h" 62 | #include "Misc\Camera.h" 63 | #include "Misc\FrameworkWindows.h" 64 | 65 | #include "PostProc\Bloom.h" 66 | #include "PostProc\BlurPS.h" 67 | #include "PostProc\SkyDome.h" 68 | #include "PostProc\ToneMapping.h" 69 | #include "PostProc\SkyDomeProc.h" 70 | #include "PostProc\DownSamplePS.h" 71 | #include "CAS_CS.h" 72 | 73 | #include "GLTF\GltfPbrPass.h" 74 | #include "GLTF\GltfBBoxPass.h" 75 | #include "GLTF\GltfDepthPass.h" 76 | 77 | #include "Widgets\Axis.h" 78 | #include "Widgets\CheckerBoardFloor.h" 79 | #include "Widgets\WireframeBox.h" 80 | #include "Widgets\WireframeSphere.h" 81 | 82 | 83 | using namespace CAULDRON_VK; 84 | --------------------------------------------------------------------------------