Skip to content

Commit 11f4bc7

Browse files
committed
glTFSample v1.3
1 parent e055500 commit 11f4bc7

File tree

14 files changed

+369
-635
lines changed

14 files changed

+369
-635
lines changed

.gitmodules

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
[submodule "media/Cauldron-Media"]
55
path = media/Cauldron-Media
66
url = ../../GPUOpen-LibrariesAndSDKs/Cauldron-Media
7-

libs/cauldron

media/Cauldron-Media

src/Common/GLTFSample.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"stablePowerState": false
1111
},
1212
"scenes": [
13-
{
13+
{
1414
"name": "Sponza",
1515
"directory": "..\\media\\cauldron-media\\sponza\\GLTF\\",
1616
"filename": "sponza.gltf",

src/DX12/GLTFSample.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// AMD SampleDX12 sample code
22
//
3-
// Copyright(c) 2018 Advanced Micro Devices, Inc.All rights reserved.
3+
// Copyright(c) 2020 Advanced Micro Devices, Inc.All rights reserved.
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files(the "Software"), to deal
66
// in the Software without restriction, including without limitation the rights
@@ -238,7 +238,7 @@ void GLTFSample::OnResize(uint32_t width, uint32_t height, DisplayModes displayM
238238
//
239239
m_device.GPUFlush();
240240

241-
// destroy resources (if were not minimized)
241+
// destroy resources (if we are not minimized)
242242
//
243243
if (m_Width > 0 && m_Height > 0)
244244
{
@@ -395,7 +395,7 @@ void GLTFSample::BuildUI()
395395
}
396396

397397
ImGui::SliderFloat("exposure", &m_state.exposure, 0.0f, 4.0f);
398-
ImGui::SliderFloat("emmisive", &m_state.emmisiveFactor, 1.0f, 1000.0f, NULL, 1.0f);
398+
ImGui::SliderFloat("emissive", &m_state.emmisiveFactor, 1.0f, 1000.0f, NULL, 1.0f);
399399
ImGui::SliderFloat("iblFactor", &m_state.iblFactor, 0.0f, 3.0f);
400400
for (int i = 0; i < m_pGltfLoader->m_lights.size(); i++)
401401
{
@@ -616,7 +616,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
616616
LPSTR lpCmdLine,
617617
int nCmdShow)
618618
{
619-
LPCSTR Name = "SampleDX12 v1.0";
619+
LPCSTR Name = "SampleDX12 v1.3";
620620

621621
// create new DX sample
622622
return RunFramework(hInstance, lpCmdLine, nCmdShow, new GLTFSample(Name));

src/DX12/GLTFSample.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// AMD SampleDX12 sample code
22
//
3-
// Copyright(c) 2017 Advanced Micro Devices, Inc.All rights reserved.
3+
// Copyright(c) 2020 Advanced Micro Devices, Inc.All rights reserved.
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files(the "Software"), to deal
66
// in the Software without restriction, including without limitation the rights

src/DX12/SampleRenderer.cpp

Lines changed: 125 additions & 287 deletions
Large diffs are not rendered by default.

src/DX12/SampleRenderer.h

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// AMD SampleDX12 sample code
22
//
3-
// Copyright(c) 2018 Advanced Micro Devices, Inc.All rights reserved.
3+
// Copyright(c) 2020 Advanced Micro Devices, Inc.All rights reserved.
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files(the "Software"), to deal
66
// in the Software without restriction, including without limitation the rights
@@ -17,6 +17,7 @@
1717
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1818
// THE SOFTWARE.
1919
#pragma once
20+
#include "base/GBuffer.h"
2021

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

104104
// effects
@@ -109,39 +109,19 @@ class SampleRenderer
109109
ToneMapping m_toneMappingPS;
110110
ToneMappingCS m_toneMappingCS;
111111
ColorConversionPS m_colorConversionPS;
112-
Sharpen m_sharpen;
113-
TAA m_taa;
112+
TAA m_TAA;
114113

115114
// GUI
116115
ImGUI m_ImGUI;
117116

118117
// Temporary render targets
118+
GBuffer m_GBuffer;
119+
GBufferRenderPass m_renderPassFullGBuffer;
120+
GBufferRenderPass m_renderPassJustDepthAndHdr;
119121

120-
// depth buffer
121-
Texture m_depthBuffer;
122-
DSV m_depthBufferDSV;
123-
124-
// Motion Vectors resources
125122
Texture m_MotionVectorsDepthMap;
126123
DSV m_MotionVectorsDepthMapDSV;
127124
CBV_SRV_UAV m_MotionVectorsDepthMapSRV;
128-
Texture m_MotionVectors;
129-
RTV m_MotionVectorsRTV;
130-
CBV_SRV_UAV m_MotionVectorsSRV;
131-
CBV_SRV_UAV m_MotionVectorsInputsSRV;
132-
133-
// TAA buffer
134-
Texture m_TAABuffer;
135-
CBV_SRV_UAV m_TAABufferSRV;
136-
CBV_SRV_UAV m_TAABufferUAV;
137-
CBV_SRV_UAV m_TAAInputsSRV;
138-
Texture m_HistoryBuffer;
139-
RTV m_HistoryBufferRTV;
140-
141-
// Normal buffer
142-
Texture m_NormalBuffer;
143-
RTV m_NormalBufferRTV;
144-
CBV_SRV_UAV m_NormalBufferSRV;
145125

146126
#if USE_SHADOWMASK
147127
// shadow mask
@@ -156,16 +136,6 @@ class SampleRenderer
156136
DSV m_ShadowMapDSV;
157137
CBV_SRV_UAV m_ShadowMapSRV;
158138

159-
// MSAA RT
160-
Texture m_HDRMSAA;
161-
RTV m_HDRRTVMSAA;
162-
163-
// Resolved RT
164-
Texture m_HDR;
165-
CBV_SRV_UAV m_HDRSRV;
166-
CBV_SRV_UAV m_HDRUAV;
167-
RTV m_HDRRTV;
168-
169139
// widgets
170140
Wireframe m_wireframe;
171141
WireframeBox m_wireframeBox;

src/DX12/stdafx.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ using namespace DirectX;
5656
#include "PostProc/TAA.h"
5757
#include "PostProc/Bloom.h"
5858
#include "PostProc/BlurPS.h"
59-
#include "PostProc/Sharpen.h"
6059
#include "PostProc/SkyDome.h"
6160
#include "PostProc/SkyDomeProc.h"
6261
#include "PostProc/PostProcCS.h"

src/VK/GLTFSample.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// AMD SampleVK sample code
22
//
3-
// Copyright(c) 2018 Advanced Micro Devices, Inc.All rights reserved.
3+
// Copyright(c) 2020 Advanced Micro Devices, Inc.All rights reserved.
44
// Permission is hereby granted, free of charge, to any person obtaining a copy
55
// of this software and associated documentation files(the "Software"), to deal
66
// in the Software without restriction, including without limitation the rights
@@ -144,7 +144,7 @@ void GLTFSample::OnCreate(HWND hWnd)
144144

145145
// init GUI state
146146
m_state.toneMapper = 0;
147-
m_state.m_useTAA = false; // no TAA in VK
147+
m_state.m_useTAA = true;
148148
m_state.skyDomeType = 0;
149149
m_state.exposure = 1.0f;
150150
m_state.iblFactor = 2.0f;
@@ -391,7 +391,7 @@ void GLTFSample::BuildUI()
391391
}
392392

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

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

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

422-
// FreeSync2 display mode selector
423+
// FreeSync HDR display mode selector
423424
//
424425
if (ImGui::Button("FreeSync HDR"))
425426
{
@@ -631,7 +632,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
631632
LPSTR lpCmdLine,
632633
int nCmdShow)
633634
{
634-
LPCSTR Name = "SampleVK v1.0";
635+
LPCSTR Name = "SampleVK v1.3";
635636

636637
// create new Vulkan sample
637638
return RunFramework(hInstance, lpCmdLine, nCmdShow, new GLTFSample(Name));

0 commit comments

Comments
 (0)