Skip to content

Commit

Permalink
glTFSample v1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
rys committed Nov 24, 2020
1 parent e055500 commit 11f4bc7
Show file tree
Hide file tree
Showing 14 changed files with 369 additions and 635 deletions.
1 change: 0 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
[submodule "media/Cauldron-Media"]
path = media/Cauldron-Media
url = ../../GPUOpen-LibrariesAndSDKs/Cauldron-Media

2 changes: 1 addition & 1 deletion libs/cauldron
2 changes: 1 addition & 1 deletion media/Cauldron-Media
2 changes: 1 addition & 1 deletion src/Common/GLTFSample.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"stablePowerState": false
},
"scenes": [
{
{
"name": "Sponza",
"directory": "..\\media\\cauldron-media\\sponza\\GLTF\\",
"filename": "sponza.gltf",
Expand Down
8 changes: 4 additions & 4 deletions src/DX12/GLTFSample.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// AMD SampleDX12 sample 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 @@ -238,7 +238,7 @@ void GLTFSample::OnResize(uint32_t width, uint32_t height, DisplayModes displayM
//
m_device.GPUFlush();

// destroy resources (if were not minimized)
// destroy resources (if we are not minimized)
//
if (m_Width > 0 && m_Height > 0)
{
Expand Down Expand Up @@ -395,7 +395,7 @@ void GLTFSample::BuildUI()
}

ImGui::SliderFloat("exposure", &m_state.exposure, 0.0f, 4.0f);
ImGui::SliderFloat("emmisive", &m_state.emmisiveFactor, 1.0f, 1000.0f, NULL, 1.0f);
ImGui::SliderFloat("emissive", &m_state.emmisiveFactor, 1.0f, 1000.0f, NULL, 1.0f);
ImGui::SliderFloat("iblFactor", &m_state.iblFactor, 0.0f, 3.0f);
for (int i = 0; i < m_pGltfLoader->m_lights.size(); i++)
{
Expand Down Expand Up @@ -616,7 +616,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
LPCSTR Name = "SampleDX12 v1.0";
LPCSTR Name = "SampleDX12 v1.3";

// create new DX sample
return RunFramework(hInstance, lpCmdLine, nCmdShow, new GLTFSample(Name));
Expand Down
2 changes: 1 addition & 1 deletion src/DX12/GLTFSample.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// AMD SampleDX12 sample code
//
// 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
// in the Software without restriction, including without limitation the rights
Expand Down
412 changes: 125 additions & 287 deletions src/DX12/SampleRenderer.cpp

Large diffs are not rendered by default.

42 changes: 6 additions & 36 deletions src/DX12/SampleRenderer.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// AMD SampleDX12 sample 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 All @@ -17,6 +17,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#pragma once
#include "base/GBuffer.h"

// We are queuing (backBufferCount + 0.5) frames, so we need to triple buffer the resources that get modified each frame
static const int backBufferCount = 3;
Expand Down Expand Up @@ -98,7 +99,6 @@ class SampleRenderer
GltfPbrPass *m_gltfPBR;
GltfBBoxPass *m_gltfBBox;
GltfDepthPass *m_gltfDepth;
GltfMotionVectorsPass *m_gltfMotionVectors;
GLTFTexturesAndBuffers *m_pGLTFTexturesAndBuffers;

// effects
Expand All @@ -109,39 +109,19 @@ class SampleRenderer
ToneMapping m_toneMappingPS;
ToneMappingCS m_toneMappingCS;
ColorConversionPS m_colorConversionPS;
Sharpen m_sharpen;
TAA m_taa;
TAA m_TAA;

// GUI
ImGUI m_ImGUI;

// Temporary render targets
GBuffer m_GBuffer;
GBufferRenderPass m_renderPassFullGBuffer;
GBufferRenderPass m_renderPassJustDepthAndHdr;

// depth buffer
Texture m_depthBuffer;
DSV m_depthBufferDSV;

// Motion Vectors resources
Texture m_MotionVectorsDepthMap;
DSV m_MotionVectorsDepthMapDSV;
CBV_SRV_UAV m_MotionVectorsDepthMapSRV;
Texture m_MotionVectors;
RTV m_MotionVectorsRTV;
CBV_SRV_UAV m_MotionVectorsSRV;
CBV_SRV_UAV m_MotionVectorsInputsSRV;

// TAA buffer
Texture m_TAABuffer;
CBV_SRV_UAV m_TAABufferSRV;
CBV_SRV_UAV m_TAABufferUAV;
CBV_SRV_UAV m_TAAInputsSRV;
Texture m_HistoryBuffer;
RTV m_HistoryBufferRTV;

// Normal buffer
Texture m_NormalBuffer;
RTV m_NormalBufferRTV;
CBV_SRV_UAV m_NormalBufferSRV;

#if USE_SHADOWMASK
// shadow mask
Expand All @@ -156,16 +136,6 @@ class SampleRenderer
DSV m_ShadowMapDSV;
CBV_SRV_UAV m_ShadowMapSRV;

// MSAA RT
Texture m_HDRMSAA;
RTV m_HDRRTVMSAA;

// Resolved RT
Texture m_HDR;
CBV_SRV_UAV m_HDRSRV;
CBV_SRV_UAV m_HDRUAV;
RTV m_HDRRTV;

// widgets
Wireframe m_wireframe;
WireframeBox m_wireframeBox;
Expand Down
1 change: 0 additions & 1 deletion src/DX12/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ using namespace DirectX;
#include "PostProc/TAA.h"
#include "PostProc/Bloom.h"
#include "PostProc/BlurPS.h"
#include "PostProc/Sharpen.h"
#include "PostProc/SkyDome.h"
#include "PostProc/SkyDomeProc.h"
#include "PostProc/PostProcCS.h"
Expand Down
11 changes: 6 additions & 5 deletions src/VK/GLTFSample.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// AMD SampleVK sample 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 @@ -144,7 +144,7 @@ void GLTFSample::OnCreate(HWND hWnd)

// init GUI state
m_state.toneMapper = 0;
m_state.m_useTAA = false; // no TAA in VK
m_state.m_useTAA = true;
m_state.skyDomeType = 0;
m_state.exposure = 1.0f;
m_state.iblFactor = 2.0f;
Expand Down Expand Up @@ -391,7 +391,7 @@ void GLTFSample::BuildUI()
}

ImGui::SliderFloat("exposure", &m_state.exposure, 0.0f, 4.0f);
ImGui::SliderFloat("emmisive", &m_state.emmisiveFactor, 1.0f, 1000.0f, NULL, 1.0f);
ImGui::SliderFloat("emissive", &m_state.emmisiveFactor, 1.0f, 1000.0f, NULL, 1.0f);
ImGui::SliderFloat("iblFactor", &m_state.iblFactor, 0.0f, 3.0f);
for (int i = 0; i < m_pGltfLoader->m_lights.size(); i++)
{
Expand All @@ -409,6 +409,7 @@ void GLTFSample::BuildUI()
m_activeCamera = 0;
ImGui::Combo("Camera", &m_activeCamera, cameraControl, min((int)(m_pGltfLoader->m_cameras.size() + 2), _countof(cameraControl)));

ImGui::Checkbox("TAA", &m_state.m_useTAA);
ImGui::Checkbox("Show Bounding Boxes", &m_state.bDrawBoundingBoxes);
ImGui::Checkbox("Show Light Frustum", &m_state.bDrawLightFrustum);

Expand All @@ -419,7 +420,7 @@ void GLTFSample::BuildUI()
m_pGltfLoader->m_animatedMats[idx] = m_pGltfLoader->m_nodes[idx].m_tranform.GetWorldMat();
}

// FreeSync2 display mode selector
// FreeSync HDR display mode selector
//
if (ImGui::Button("FreeSync HDR"))
{
Expand Down Expand Up @@ -631,7 +632,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
LPCSTR Name = "SampleVK v1.0";
LPCSTR Name = "SampleVK v1.3";

// create new Vulkan sample
return RunFramework(hInstance, lpCmdLine, nCmdShow, new GLTFSample(Name));
Expand Down
2 changes: 1 addition & 1 deletion src/VK/GLTFSample.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// AMD SampleVK sample 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 11f4bc7

Please sign in to comment.