Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.7.0 - Multi-threaded command recording & frustum culling, Ambient Occlusion #139

Merged
merged 62 commits into from
Jul 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
bbbbf4c
Add HLSL source for PIX captures on Debug
vilbeyli Mar 26, 2021
3f53732
Update utils submodule to latest
vilbeyli Mar 26, 2021
473bfc1
cosmetic refactoring
vilbeyli Apr 2, 2021
5285bdd
Dynamically pick environment map resolution based on the monitor the …
vilbeyli Apr 12, 2021
20e8847
Update vqutils to fix image downsize crash
vilbeyli Apr 12, 2021
45e2aeb
Validate environment map hi-res file name
vilbeyli Apr 12, 2021
c743a6e
Write out lower res environment map at one go instead of on iteration…
vilbeyli Apr 13, 2021
1e6448a
Merge branch 'dev' into dev-ui-rebase
vilbeyli Apr 13, 2021
46dacaa
Bump app versoin
vilbeyli Apr 13, 2021
b05f145
Merge pull request #134 from vilbeyli/dev-ui-rebase
vilbeyli Apr 13, 2021
80d745b
Selectively load the referenced builtin materials during level loadin…
vilbeyli Apr 14, 2021
55eb59f
Remove incorrect err msg when loading materials
vilbeyli Apr 14, 2021
dbb0e9e
Fix CAS black line at the bottom of the image due to incorrect dispat…
vilbeyli Apr 14, 2021
3600630
DXC (April 2021 Release) & SM6 support
vilbeyli Apr 21, 2021
7aae536
Move PSOCache and ShaderCache into a single Cache folder for a tidier…
vilbeyli Apr 21, 2021
36252f2
Fix gitignore, add missing binaries
vilbeyli Apr 21, 2021
358f8d6
Add FidelityFX CACAO files, rearrange FidelityFX folders, add skeleto…
vilbeyli Apr 25, 2021
a75ebd3
Add AMD FidelityFX-CACAO - need to fix SSAO output/composition
vilbeyli Apr 27, 2021
48072a5
Update AMD FidelityFX CACAO
vilbeyli May 9, 2021
c29e51f
Update and fix FFX-CACAO
vilbeyli May 9, 2021
3563bbf
MainView & Shadow Frustum culling based on Mesh AABBs, WIP: GameObjec…
vilbeyli May 18, 2021
afeee41
Multithreaded view frustum culling for light views
vilbeyli May 20, 2021
ec9c3b3
Fix shader include path
vilbeyli May 20, 2021
321922b
Fix frustum culling 'memory leak'
vilbeyli May 20, 2021
3906b35
RGP markers for PIX events
vilbeyli May 21, 2021
7ae1f97
Add PIX CPU marker definition
vilbeyli May 21, 2021
b9da1f7
Add PIX CPU markers to update and render threads
vilbeyli May 21, 2021
9845219
WIP: MT command recording with shadow maps
vilbeyli May 21, 2021
17161c1
Add more markers, verify parllel command recording works!
vilbeyli May 21, 2021
8d67965
WIP: multi-threaded command recording (unstable)
vilbeyli May 24, 2021
5588b31
fix MT command recording
vilbeyli May 24, 2021
d6d39ea
Fix compiler warnings, load stress test scene
vilbeyli May 24, 2021
54f0870
Fix culling 'mem leak' for BB-game object pointer mapping container
vilbeyli May 24, 2021
41b220e
Fix toggling post process settings through keyboard
vilbeyli May 24, 2021
17c69cd
Update stress test scene, reduce global ambient lighting factor to half
vilbeyli May 24, 2021
a283b75
Update stress test scene: lift cubes up a bit so they don't clip thro…
vilbeyli May 24, 2021
6fab15f
Merge pull request #135 from vilbeyli/dev-mt-cmd
vilbeyli May 24, 2021
39a395f
Fix command list close() issue, fix alpha maked geometry rendering issue
vilbeyli May 25, 2021
be661bd
Fix MSAA toggle
vilbeyli May 25, 2021
f1ad47d
Fix command list memory leak
vilbeyli May 25, 2021
6764b82
Game Object AABBs
vilbeyli May 31, 2021
17351dc
Render bounding boxes all the time (there's a bug to fix)
vilbeyli Jun 26, 2021
8a09240
Fix bounding box world transformation error, render mesh + gameobj Bo…
vilbeyli Jun 26, 2021
1543ae9
Simplify culling code: remove redundant sse load/stores
vilbeyli Jun 26, 2021
d8d9d68
Add toggle key N & shift+N for gameobj and mesh bounding boxes
vilbeyli Jun 26, 2021
8519804
Keep environment maps 8k and skip downsizing
vilbeyli Jul 2, 2021
32f1c32
Skip downloading some 8k textures
vilbeyli Jul 2, 2021
1431e5b
Update README and screenshots
vilbeyli Jul 2, 2021
f8f8847
Merge pull request #138 from vilbeyli/dev
vilbeyli Jul 2, 2021
df9d440
CodeReview: Remove unintended file.
vilbeyli Jul 3, 2021
d9cac7e
CodeReview: cleanup + comment
vilbeyli Jul 3, 2021
c860e1c
CodeReview: remove TODO comment, clarify name collision
vilbeyli Jul 3, 2021
0030c5f
CodeReview: Separate render commands from VQEngine_Render.cpp, halves…
vilbeyli Jul 3, 2021
ac7a13a
Fix StressTest scene's shadow acne
vilbeyli Jul 3, 2021
9f20250
CodeReview: skip redundant IA set calls for bounding box rendering
vilbeyli Jul 3, 2021
16b481d
CodeReview: undo unintended newline
vilbeyli Jul 4, 2021
ed2a474
CodeReview: make RGP PIX markers off by default, tie them up to #define
vilbeyli Jul 4, 2021
b498f78
CodeReview: remove TODO:
vilbeyli Jul 4, 2021
f0ecc9d
CodeReview: Update AO screenshot
vilbeyli Jul 4, 2021
ab02679
Update README: DXIL support
vilbeyli Jul 4, 2021
0fd661a
Merge pull request #140 from vilbeyli/dev
vilbeyli Jul 4, 2021
a767400
Bump .exe app version
vilbeyli Jul 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# Precompiled Headers
*.gch
*.pch
Libs/AMDFidelityFX/CACAO/PrecompiledShadersDXIL/*

# Compiled Dynamic libraries
*.so
Expand Down Expand Up @@ -62,8 +63,7 @@ bld/
[Oo]bj/
[Ll]og/
Build/_artifacts/
ShaderCache/
PSOCache/
Cache/
Data/Textures/PBR/*/*.png

# Visual Studio 2015 cache/options directory
Expand Down Expand Up @@ -349,4 +349,10 @@ $RECYCLE.BIN/
!Tools/wget.exe
!Libs/WinPixEventRuntime/bin
!Libs/WinPixEventRuntime/bin/x64/
!Libs/WinPixEventRuntime/bin/x64/*
!Libs/WinPixEventRuntime/bin/x64/*
!Libs/DirectXCompiler/lib
!Libs/DirectXCompiler/lib/x64/
!Libs/DirectXCompiler/lib/x64/*
!Libs/DirectXCompiler/bin
!Libs/DirectXCompiler/bin/x64/
!Libs/DirectXCompiler/bin/x64/*
183 changes: 125 additions & 58 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ add_compile_options(/MP)

set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME})

#
# DATA
#
set (Resource
"Data/Resources/VQE.rc"
"Data/Resources/resource.h"
Expand Down Expand Up @@ -44,6 +47,9 @@ set (Materials
"Data/Materials/DefaultMaterials.xml"
)

#
# SHADERS
#
set (Shaders
"Shaders/hello-triangle.hlsl"
"Shaders/hello-cube.hlsl"
Expand All @@ -58,74 +64,110 @@ set (Shaders
"Shaders/Lighting.hlsl"
"Shaders/LightingConstantBufferData.h"
"Shaders/Unlit.hlsl"
"Shaders/DepthPass.hlsl"
"Shaders/ShadowDepthPass.hlsl"
"Shaders/DepthPrePass.hlsl"
"Shaders/DepthResolve.hlsl"
"Shaders/CubemapConvolution.hlsl"
"Shaders/GaussianBlur.hlsl"
"Shaders/AMDFidelityFX.hlsl"
)

set (HeaderVQE
"Source/Application/Platform.h"
"Source/Application/Window.h"
"Source/Application/Settings.h"
"Source/Application/Types.h"
"Source/Application/Math.h"
"Source/Application/VQEngine.h"
"Source/Application/Events.h"
"Source/Application/Mesh.h"
"Source/Application/Material.h"
"Source/Application/Model.h"
"Source/Application/Geometry.h"
"Source/Application/Transform.h"
"Source/Application/Quaternion.h"
"Source/Application/Camera.h"
"Source/Application/Input.h"
"Source/Application/AssetLoader.h"
"Source/Application/Scene.h"
"Source/Application/Light.h"
"Source/Application/GameObject.h"
"Source/Application/Memory.h"
"Source/Application/GPUMarker.h"
#
# SOURCE
#
set (RenderPassFiles
"Source/Engine/RenderPass/RenderPass.h"
"Source/Engine/RenderPass/AmbientOcclusion.h"
"Source/Engine/RenderPass/DepthPrePass.h"

"Source/Engine/RenderPass/AmbientOcclusion.cpp"
"Source/Engine/RenderPass/DepthPrePass.cpp"
)

set (CoreFiles
"Source/Engine/Core/Platform.h"
"Source/Engine/Core/Window.h"
"Source/Engine/Core/Input.h"
"Source/Engine/Core/Events.h"
"Source/Engine/Core/Types.h"
"Source/Engine/Core/Memory.h"

"Source/Engine/Core/Platform.cpp"
"Source/Engine/Core/Window.cpp"
"Source/Engine/Core/Input.cpp"
"Source/Engine/Core/Events.cpp"
"Source/Engine/Core/VQEngine_WindowEvents.cpp"
"Source/Engine/Core/VQEngine_EventHandlers.cpp"
"Source/Engine/Core/FileParser.cpp"
"Source/Engine/Core/Memory.cpp"

)

set (SceneFiles
"Shaders/LightingConstantBufferData.h"

"Source/Engine/Scene/Transform.h"
"Source/Engine/Scene/Quaternion.h"
"Source/Engine/Scene/Scene.h"
"Source/Engine/Scene/Light.h"
"Source/Engine/Scene/Camera.h"
"Source/Engine/Scene/Mesh.h"
"Source/Engine/Scene/Material.h"
"Source/Engine/Scene/Model.h"
"Source/Engine/Scene/GameObject.h"

"Source/Engine/Scene/Scene.cpp"
"Source/Engine/Scene/SceneLoading.cpp"
"Source/Engine/Scene/Light.cpp"
"Source/Engine/Scene/Camera.cpp"
"Source/Engine/Scene/Mesh.cpp"
"Source/Engine/Scene/Material.cpp"
"Source/Engine/Scene/Model.cpp"
"Source/Engine/Scene/GameObject.cpp"
"Source/Engine/Scene/Transform.cpp"
"Source/Engine/Scene/Quaternion.cpp"

)

set (SourceVQE
"Source/Application/Platform.cpp"
"Source/Application/Window.cpp"
"Source/Application/Main.cpp"
"Source/Application/VQEngine_Main.cpp"
"Source/Application/VQEngine_Render.cpp"
"Source/Application/VQEngine_Update.cpp"
"Source/Application/VQEngine_WindowEvents.cpp"
"Source/Application/VQEngine_EventHandlers.cpp"
"Source/Application/EnvironmentMap.cpp"
"Source/Application/FileParser.cpp"
"Source/Application/Events.cpp"
"Source/Application/Mesh.cpp"
"Source/Application/Material.cpp"
"Source/Application/Model.cpp"
"Source/Application/Geometry.cpp"
"Source/Application/Transform.cpp"
"Source/Application/Math.cpp"
"Source/Application/Quaternion.cpp"
"Source/Application/Camera.cpp"
"Source/Application/Input.cpp"
"Source/Application/AssetLoader.cpp"
"Source/Application/Scene.cpp"
"Source/Application/Light.cpp"
"Source/Application/GameObject.cpp"
"Source/Application/Memory.cpp"
"Source/Application/GPUMarker.cpp"
"Source/Engine/VQEngine.h"
"Source/Engine/VQEngine_RenderCommon.h"
"Source/Engine/Settings.h"
"Source/Engine/Math.h"
"Source/Engine/Culling.h"
"Source/Engine/Geometry.h"
"Source/Engine/AssetLoader.h"
"Source/Engine/GPUMarker.h"

"Source/Engine/Main.cpp"
"Source/Engine/VQEngine_Main.cpp"
"Source/Engine/VQEngine_Render.cpp"
"Source/Engine/VQEngine_RenderCommands.cpp"
"Source/Engine/VQEngine_Update.cpp"
"Source/Engine/EnvironmentMap.cpp"
"Source/Engine/Geometry.cpp"
"Source/Engine/Math.cpp"
"Source/Engine/Culling.cpp"
"Source/Engine/AssetLoader.cpp"
"Source/Engine/GPUMarker.cpp"
)

set (FidelityFX
"Shaders/FidelityFX/ffx_a.h"
"Shaders/FidelityFX/CAS/ffx_cas.h"
set (FidelityFXShaders
"Shaders/AMDFidelityFX/CAS/ffx_a.h"
"Shaders/AMDFidelityFX/CAS/ffx_cas.h"
# "Shaders/FidelityFX/SPD/ffx_spd.h"
)

set (PIXIncl
"Libs/WinPixEventRuntime/Include"
set (LibsIncl
"Libs/"
)

set (LibFFX
"Libs/AMDFidelityFX/CACAO/ffx_cacao_defines.h"
"Libs/AMDFidelityFX/CACAO/ffx_cacao.cpp"
"Libs/AMDFidelityFX/CACAO/ffx_cacao.h"
"Libs/AMDFidelityFX/CACAO/ffx_cacao_impl.cpp"
"Libs/AMDFidelityFX/CACAO/ffx_cacao_impl.h"
)

# ouput exe to bin directory
Expand Down Expand Up @@ -154,23 +196,35 @@ source_group("Config" FILES ${Config})
source_group("Resource" FILES ${Resource})
source_group("Icons" FILES ${Icons})
source_group("Shaders" FILES ${Shaders})
source_group("Shaders\\AMD-FidelityFX" FILES ${FidelityFX})
source_group("Shaders\\AMD-FidelityFX" FILES ${FidelityFXShaders})
source_group("Scenes" FILES ${Scenes})
source_group("Materials" FILES ${Materials})
source_group("Source\\RenderPass" FILES ${RenderPassFiles})
source_group("Source\\Core" FILES ${CoreFiles})
source_group("Source\\Scene" FILES ${SceneFiles})
source_group("Source" FILES ${SourceVQE})
source_group("Libs\\AMDFidelityFX\\CACAO" FILES ${LibFFX})

set_source_files_properties(${Config} PROPERTIES VS_TOOL_OVERRIDE "Text")
set_source_files_properties(${Materials} PROPERTIES VS_TOOL_OVERRIDE "Text")
set_source_files_properties(${Scenes} PROPERTIES VS_TOOL_OVERRIDE "Text")
set_source_files_properties(${Shaders} PROPERTIES VS_TOOL_OVERRIDE "Text")
set_source_files_properties(${FidelityFX} PROPERTIES VS_TOOL_OVERRIDE "Text")
set_source_files_properties(${FidelityFXShaders} PROPERTIES VS_TOOL_OVERRIDE "Text")
set_source_files_properties(${CoreFiles} PROPERTIES VS_TOOL_OVERRIDE "Text")
set_source_files_properties(${RenderPassFiles} PROPERTIES VS_TOOL_OVERRIDE "Text")
set_source_files_properties(${SceneFiles} PROPERTIES VS_TOOL_OVERRIDE "Text")
set_source_files_properties(${LibFFX} PROPERTIES VS_TOOL_OVERRIDE "Text")
set_source_files_properties(Data/Resources/VQE.rc PROPERTIES VS_TOOL_OVERRIDE "Resource compiler")
set_source_files_properties(Data/Icons/VQE32.ico PROPERTIES VS_TOOL_OVERRIDE "Image")

link_directories(${CMAKE_CURRENT_SOURCE_DIR}/Libs/VQUtils/Bin/)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/Libs/WinPixEventRuntime/bin/x64)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/Libs/DirectXCompiler/lib/x64)

add_definitions(-DFFX_CACAO_ENABLE_D3D12)

# Create a library with the project name that is build with the Headers and Source files
add_executable( ${PROJECT_NAME} ${HeaderVQE} ${SourceVQE} ${Config} ${Scenes} ${Resource} ${Shaders} ${Materials} ${FidelityFX})
add_executable( ${PROJECT_NAME} ${SourceVQE} ${Config} ${Scenes} ${Resource} ${Shaders} ${Materials} ${FidelityFXShaders} ${LibFFX} ${RenderPassFiles} ${CoreFiles} ${SceneFiles})

set_target_properties(${PROJECT_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY} )

Expand Down Expand Up @@ -201,13 +255,26 @@ set_target_properties(D3D12MA PROPERTIES FOLDER Libs)

# Make sure the compiler can find include files for the libraries
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${Includes})
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${PIXIncl})
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${LibsIncl})

target_link_libraries(${PROJECT_NAME} PRIVATE VQUtils VQRenderer assimp WinPixEventRuntime)


add_custom_command(TARGET ${PROJECT_NAME} PRE_BUILD
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/Libs/AMDFidelityFX/CACAO/build_shaders_dxil.bat)

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/Libs/WinPixEventRuntime/bin/x64/WinPixEventRuntime.dll"
$<TARGET_FILE_DIR:${PROJECT_NAME}>
)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/Libs/DirectXCompiler/bin/x64/dxcompiler.dll"
$<TARGET_FILE_DIR:${PROJECT_NAME}>
)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${CMAKE_CURRENT_SOURCE_DIR}/Libs/DirectXCompiler/bin/x64/dxil.dll"
$<TARGET_FILE_DIR:${PROJECT_NAME}>
)
8 changes: 0 additions & 8 deletions Data/EnvironmentMaps.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[Shanghai]
Path=Data/Textures/HDRI/shanghai_bund_8k.hdr
MaxCLL=20374

[VondelPark]
Path=Data/Textures/HDRI/sunny_vondelpark_8k.hdr
MaxCLL=11987
Expand All @@ -17,7 +13,3 @@ MaxCLL=340
[GymEntrance]
Path=Data/Textures/HDRI/gym_entrance_8k.hdr
MaxCLL=26293

[WinterEvening]
Path=Data/Textures/HDRI/winter_evening_8k.hdr
MaxCLL=10247
Loading