Skip to content

Commit

Permalink
Cauldron v1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
rys committed Nov 18, 2020
1 parent 354e408 commit b3a4f62
Show file tree
Hide file tree
Showing 263 changed files with 3,206 additions and 1,271 deletions.
423 changes: 236 additions & 187 deletions libs/AGS/amd_ags.h

Large diffs are not rendered by default.

Binary file modified libs/AGS/amd_ags_x64.dll
Binary file not shown.
Binary file modified libs/AGS/amd_ags_x64.lib
Binary file not shown.
4 changes: 2 additions & 2 deletions libs/AGS/license.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2017 Advanced Micro Devices, Inc. All rights reserved.
Copyright (c) 2020 Advanced Micro Devices, Inc. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.
28 changes: 17 additions & 11 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,33 @@ Cauldron is compiled as a static library. To see it in action check projects bel
- [GLTFSample](https://github.com/GPUOpen-LibrariesAndSDKs/gltfsample), a simple demo app to show off Cauldron's features
![GLTFSample](https://github.com/GPUOpen-LibrariesAndSDKs/gltfsample/raw/master/screenshot.png)


# Cauldron Features

- [glTF 2.0](https://github.com/KhronosGroup/glTF/tree/master/specification/2.0) File loader
- Animation for cameras, objects, skeletons and lights
- Skinning
- Baking skinning into buffers (DX12 only)
- Rendering techniques
- Motion vectors
- Depth pass only
- PBR Materials
- Metallic-Roughness
- Specular-Glossiness (KHR_materials_pbrSpecularGlossiness)
- Lighting (KHR_lights_punctual extension)
- Spot Lights w/ Shadows (up to 4)
- PBR Materials
- Metallic-Roughness
- Specular-Glossiness (KHR_materials_pbrSpecularGlossiness)
- Lighting
- KHR_lights_punctual extension
- Point
- Directional
- Spot Lights w/ Shadows (up to 4)
- Image-based Lighting (IBL) CubeMaps
- Shadow techniques
- shadow maps
- shadow maps (PCF)
- shadow masks (DX12 only)
- Configurable GBuffer, supported techniques:
- Full forward
- Motion vectors
- Normals
- Depth
- Specular-roughness
- Diffuse-alpha
- Postprocessing
- TAA (DX12 only)
- TAA
- Bloom
- HDR/Tonemapping
- Texture Loaders for DDS (including the BCn formats), JPEG and PNG formats
Expand Down
55 changes: 32 additions & 23 deletions src/DX12/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ set(PostProc_src
PostProc/PostProcCS.h
PostProc/PostProcPS.cpp
PostProc/PostProcPS.h
PostProc/Sharpen.cpp
PostProc/Sharpen.h
PostProc/SkyDome.cpp
PostProc/SkyDome.h
PostProc/SkyDomeProc.cpp
Expand All @@ -53,6 +51,8 @@ set(PostProc_src
)

set(Base_src
base/Buffer.cpp
base/Buffer.h
base/CommandListRing.cpp
base/CommandListRing.h
base/Device.cpp
Expand All @@ -63,6 +63,8 @@ set(Base_src
base/Fence.h
base/FreeSyncHDR.cpp
base/FreeSyncHDR.h
base/GBuffer.cpp
base/GBuffer.h
base/GPUTimestamps.cpp
base/GPUTimestamps.h
base/Helper.cpp
Expand Down Expand Up @@ -98,32 +100,36 @@ set(Widgets_src
widgets/WireframeSphere.h
)

set(Shaders_src
${CMAKE_CURRENT_SOURCE_DIR}/shaders/common.h
set(Shaders_PostProc_src
${CMAKE_CURRENT_SOURCE_DIR}/shaders/blend.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/blur.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/Debug.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/DownSamplePS.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/Tonemappers.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/Tonemapping.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/TonemappingCS.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/ColorConversionPS.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/TAA.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/TAASharpenerCS.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/motionBlur.hlsl
)

set(Shaders_GLTF_src
${CMAKE_CURRENT_SOURCE_DIR}/shaders/common.h
${CMAKE_CURRENT_SOURCE_DIR}/shaders/GLTFPbrPass-PS.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/GLTFPbrPass-VS.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/GLTFPbrPass-IO.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/GLTFPbrPass-IO.h
${CMAKE_CURRENT_SOURCE_DIR}/shaders/GLTFPBRLighting.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/GLTFDepthPass.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/GLTFNormals.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/ShadowResolve.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/GLTFMotionVectorsPass.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/SkyDome.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/SkyDomeProc.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/Tonemappers.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/Tonemapping.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/TonemappingCS.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/ColorConversionPS.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/functions.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/taa.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/sharpen.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/textures.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/PBRTextures.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/shadowFiltering.h
${CMAKE_CURRENT_SOURCE_DIR}/shaders/motionBlur.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/PixelParams.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/PBRPixelParams.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/BakeSkinning.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/Skinning.hlsl
${CMAKE_CURRENT_SOURCE_DIR}/shaders/GLTFVertexFactory.hlsl
Expand All @@ -135,21 +141,24 @@ set(media_src
)

copyCommand("${media_src}" ${CMAKE_HOME_DIRECTORY}/bin)
copyCommand("${Shaders_src}" ${CMAKE_HOME_DIRECTORY}/bin/ShaderLibDX)
copyCommand("${Shaders_GLTF_src}" ${CMAKE_HOME_DIRECTORY}/bin/ShaderLibDX)
copyCommand("${Shaders_PostProc_src}" ${CMAKE_HOME_DIRECTORY}/bin/ShaderLibDX)

add_library (${PROJECT_NAME} STATIC ${GLTF_src} ${PostProc_src} ${Base_src} ${Widgets_src} ${Shaders_src} ${media_src})
add_library (${PROJECT_NAME} STATIC ${GLTF_src} ${PostProc_src} ${Base_src} ${Widgets_src} ${Shaders_GLTF_src} ${Shaders_PostProc_src} ${media_src})

target_link_libraries (${PROJECT_NAME} Cauldron_Common NJSON D3D12X)
target_include_directories (${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

source_group("GLTF" FILES ${GLTF_src})
source_group("PostProc" FILES ${PostProc_src})
source_group("Base" FILES ${Base_src})
source_group("Widgets" FILES ${Widgets_src})
source_group("Shaders" FILES ${Shaders_src})
source_group("media" FILES ${media_src})
source_group("GLTF" FILES ${GLTF_src})
source_group("PostProc" FILES ${PostProc_src})
source_group("PostProc Shaders" FILES ${Shaders_PostProc_src})
source_group("Base" FILES ${Base_src})
source_group("Widgets" FILES ${Widgets_src})
source_group("GLTF Shaders" FILES ${Shaders_GLTF_src})
source_group("media" FILES ${media_src})

set_source_files_properties(${Shaders_src} PROPERTIES VS_TOOL_OVERRIDE "Text")
set_source_files_properties(${Shaders_GLTF_src} PROPERTIES VS_TOOL_OVERRIDE "Text")
set_source_files_properties(${Shaders_PostProc_src} PROPERTIES VS_TOOL_OVERRIDE "Text")
set_source_files_properties(${media_src} PROPERTIES VS_TOOL_OVERRIDE "Media")


10 changes: 5 additions & 5 deletions src/DX12/GLTF/GLTFTexturesAndBuffers.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// AMD AMDUtils code
// AMD Cauldron code
//
// Copyright(c) 2018 Advanced Micro Devices, Inc.All rights reserved.
// Copyright(c) 2020 Advanced Micro Devices, Inc.All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
Expand Down Expand Up @@ -231,10 +231,10 @@ namespace CAULDRON_DX12

void GLTFTexturesAndBuffers::SetSkinningMatricesForSkeletons()
{
for (auto &t : m_pGLTFCommon->m_pCurrentFrameTransformedData->m_worldSpaceSkeletonMats)
for (auto &t : m_pGLTFCommon->m_worldSpaceSkeletonMats)
{
std::vector<XMMATRIX> *matrices = &t.second;
D3D12_GPU_VIRTUAL_ADDRESS perSkeleton = m_pDynamicBufferRing->AllocConstantBuffer((uint32_t)(matrices->size() * sizeof(XMMATRIX)), matrices->data());
std::vector<Matrix2> *matrices = &t.second;
D3D12_GPU_VIRTUAL_ADDRESS perSkeleton = m_pDynamicBufferRing->AllocConstantBuffer((uint32_t)(matrices->size() * sizeof(Matrix2)), matrices->data());

m_skeletonMatricesBuffer[t.first] = perSkeleton;
}
Expand Down
4 changes: 2 additions & 2 deletions src/DX12/GLTF/GLTFTexturesAndBuffers.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// AMD AMDUtils code
// AMD Cauldron code
//
// Copyright(c) 2018 Advanced Micro Devices, Inc.All rights reserved.
// Copyright(c) 2020 Advanced Micro Devices, Inc.All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
Expand Down
6 changes: 3 additions & 3 deletions src/DX12/GLTF/GltfBBoxPass.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// AMD AMDUtils code
// AMD Cauldron code
//
// Copyright(c) 2018 Advanced Micro Devices, Inc.All rights reserved.
// Copyright(c) 2020 Advanced Micro Devices, Inc.All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
Expand Down Expand Up @@ -71,7 +71,7 @@ namespace CAULDRON_DX12
if (pNode->meshIndex < 0)
continue;

XMMATRIX mWorldViewProj = pC->m_pCurrentFrameTransformedData->m_worldSpaceMats[i] * cameraViewProjMatrix;
XMMATRIX mWorldViewProj = pC->m_worldSpaceMats[i].GetCurrent() * cameraViewProjMatrix;

tfMesh *pMesh = &pC->m_meshes[pNode->meshIndex];
for (uint32_t p = 0; p < pMesh->m_pPrimitives.size(); p++)
Expand Down
4 changes: 2 additions & 2 deletions src/DX12/GLTF/GltfBBoxPass.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// AMD AMDUtils code
// AMD Cauldron code
//
// Copyright(c) 2018 Advanced Micro Devices, Inc.All rights reserved.
// Copyright(c) 2020 Advanced Micro Devices, Inc.All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
Expand Down
8 changes: 4 additions & 4 deletions src/DX12/GLTF/GltfDepthPass.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// AMD AMDUtils code
// AMD Cauldron code
//
// Copyright(c) 2018 Advanced Micro Devices, Inc.All rights reserved.
// Copyright(c) 2020 Advanced Micro Devices, Inc.All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
Expand Down Expand Up @@ -351,7 +351,7 @@ namespace CAULDRON_DX12
// loop through nodes
//
std::vector<tfNode> *pNodes = &m_pGLTFTexturesAndBuffers->m_pGLTFCommon->m_nodes;
XMMATRIX *pNodesMatrices = m_pGLTFTexturesAndBuffers->m_pGLTFCommon->m_pCurrentFrameTransformedData->m_worldSpaceMats.data();
Matrix2 *pNodesMatrices = m_pGLTFTexturesAndBuffers->m_pGLTFCommon->m_worldSpaceMats.data();

for (uint32_t i = 0; i < pNodes->size(); i++)
{
Expand All @@ -373,7 +373,7 @@ namespace CAULDRON_DX12
// Set per Object constants
//
per_object cbPerObject;
cbPerObject.mWorld = pNodesMatrices[i];
cbPerObject.mWorld = pNodesMatrices[i].GetCurrent();
D3D12_GPU_VIRTUAL_ADDRESS perObjectDesc= m_pDynamicBufferRing->AllocConstantBuffer(sizeof(per_object), &cbPerObject);

// Bind indices and vertices using the right offsets into the buffer
Expand Down
4 changes: 2 additions & 2 deletions src/DX12/GLTF/GltfDepthPass.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// AMD AMDUtils code
// AMD Cauldron code
//
// Copyright(c) 2018 Advanced Micro Devices, Inc.All rights reserved.
// Copyright(c) 2020 Advanced Micro Devices, Inc.All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
Expand Down
11 changes: 5 additions & 6 deletions src/DX12/GLTF/GltfMotionVectorsPass.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// AMD AMDUtils code
// AMD Cauldron code
//
// Copyright(c) 2018 Advanced Micro Devices, Inc.All rights reserved.
// Copyright(c) 2020 Advanced Micro Devices, Inc.All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
Expand Down Expand Up @@ -380,8 +380,7 @@ namespace CAULDRON_DX12
// loop through nodes
//
std::vector<tfNode> *pNodes = &m_pGLTFTexturesAndBuffers->m_pGLTFCommon->m_nodes;
XMMATRIX *pNodesCurrMatrices = m_pGLTFTexturesAndBuffers->m_pGLTFCommon->m_pCurrentFrameTransformedData->m_worldSpaceMats.data();
XMMATRIX *pNodesPrevMatrices = m_pGLTFTexturesAndBuffers->m_pGLTFCommon->m_pPreviousFrameTransformedData->m_worldSpaceMats.data();
Matrix2 *pNodesMatrices = m_pGLTFTexturesAndBuffers->m_pGLTFCommon->m_worldSpaceMats.data();

for (uint32_t i = 0; i < pNodes->size(); i++)
{
Expand All @@ -403,8 +402,8 @@ namespace CAULDRON_DX12
// Set per Object constants
//
per_object cbPerObject;
cbPerObject.mCurrentWorld = pNodesCurrMatrices[i];
cbPerObject.mPreviousWorld = pNodesPrevMatrices[i];
cbPerObject.mCurrentWorld = pNodesMatrices[i].GetCurrent();
cbPerObject.mPreviousWorld = pNodesMatrices[i].GetPrevious();

D3D12_GPU_VIRTUAL_ADDRESS perObjectDesc = m_pDynamicBufferRing->AllocConstantBuffer(sizeof(per_object), &cbPerObject);

Expand Down
4 changes: 2 additions & 2 deletions src/DX12/GLTF/GltfMotionVectorsPass.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// AMD AMDUtils code
// AMD Cauldron code
//
// Copyright(c) 2018 Advanced Micro Devices, Inc.All rights reserved.
// Copyright(c) 2020 Advanced Micro Devices, Inc.All rights reserved.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
Expand Down
Loading

0 comments on commit b3a4f62

Please sign in to comment.