Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
4e66059
fix readme link
vilbeyli Jun 21, 2025
4b28731
bump version to 0.12.0
vilbeyli Jun 21, 2025
8e1c1fa
[FidelityFX] rename AMDFidelityFX/ folder to AMD/
vilbeyli Jun 20, 2025
2308417
[FidelityFX] add FidelityFX-SDK submodule
vilbeyli Jun 20, 2025
33fb715
move post process files into Renderer, rearrange & separate upscaling…
vilbeyli Jun 20, 2025
3b6bcb1
remove unneeded function from VQEngine interface
vilbeyli Jun 21, 2025
3f96813
GUI perf window now shows render vs display resolution, fix upscaler …
vilbeyli Jun 21, 2025
19fb819
refactor render/postprocess options: move render resolution vs displa…
vilbeyli Jun 22, 2025
911c4bd
refactor graphics settings / scene render options: clear separation
vilbeyli Jun 23, 2025
1f28fc9
update CMakelists.txt: add fidelityfx sdk binary
vilbeyli Jun 23, 2025
fede603
move post processing settings into gfx settings, remove post process …
vilbeyli Jun 25, 2025
f06c705
FSR3: WIP command recording parameter setup
vilbeyli Jun 25, 2025
f3728a3
FSR3: wire up input/output resources
vilbeyli Jun 26, 2025
a7ba909
Fix UI upscaler selection logic
vilbeyli Jun 26, 2025
7eafee8
Fix resolution scaling slider behavior
vilbeyli Jun 27, 2025
6e1fdf3
validate settings when msaa/upscaling changes
vilbeyli Jun 27, 2025
a2e480d
add jittered rendering, needs debugging
vilbeyli Jun 27, 2025
c08e889
unjittered motion vectors, wire up FSR3 output
vilbeyli Jul 2, 2025
4283de8
remove magnifier state from UI state, add state under debug scene dra…
vilbeyli Jul 2, 2025
91193b5
fix magnifier/tonemapper output resolution
vilbeyli Jul 2, 2025
2dd7be9
add mip bias
vilbeyli Jul 3, 2025
54f8a5b
fix display resolution setting not updating when changing monitors wi…
vilbeyli Jul 4, 2025
85fa134
fix missing render resolution parameter for objectID pass
vilbeyli Jul 4, 2025
275083d
fsr3: add history buffer reset mechanism
vilbeyli Jul 5, 2025
361b77b
fix missing motion vector history for objects
vilbeyli Jul 5, 2025
35d1cd1
fsr3: add reactivity mask auto generation
vilbeyli Jul 5, 2025
8acd186
fsr3: add transparencyAndCompositionMask rendering for skydome
vilbeyli Jul 5, 2025
e63adea
fix magnifier for HDR, move common code into new SwapChainPass
vilbeyli Jul 6, 2025
f5d8162
fsr3: parameterize opaque-only input for auto reactivity mask generation
vilbeyli Jul 6, 2025
e1ba2a1
renderer: remove empty postprocess.h/cpp files
vilbeyli Jul 6, 2025
4d5a3d4
Merge pull request #190 from vilbeyli/dev-fsr3
vilbeyli Jul 6, 2025
699842d
fix build script: include new amd submodule in checks
vilbeyli Jul 6, 2025
fadafe4
fix build script: fix path to new amd fidelityfx submodule
vilbeyli Jul 6, 2025
de63d43
fix build script: fix path to new amd fidelityfx submodule
vilbeyli Jul 6, 2025
c66350f
fix build: add missing header for memcpy in Transform.cpp
vilbeyli Jul 6, 2025
1cb04a4
prevent crash when GUI updates bounding box rendering state
vilbeyli Jul 6, 2025
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# Precompiled Headers
*.gch
*.pch
Source/Renderer/Libs/AMDFidelityFX/CACAO/PrecompiledShadersDXIL/*
Source/Renderer/Libs/AMD/CACAO/PrecompiledShadersDXIL/*

# Compiled Dynamic libraries
*.so
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@
[submodule "Data/Textures/PBR"]
path = Data/Textures/PBR
url = https://github.com/vilbeyli/PBRCollection.git
[submodule "Source/Renderer/Libs/AMD/FidelityFX-SDK"]
path = Source/Renderer/Libs/AMD/FidelityFX-SDK
url = https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK.git
8 changes: 8 additions & 0 deletions Build/GenerateProjectFiles.bat
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ set SUBMODULE_DIR0=..\Libs\VQUtils\
set SUBMODULE_DIR1=..\Source\Renderer\Libs\D3D12MA\
set SUBMODULE_DIR2=..\Source\Renderer\Libs\D3DX12\
set SUBMODULE_DIR3=..\Libs\imgui\
set SUBMODULE_DIR4=..\Source\Renderer\Libs\AMD\FidelityFX-SDK\
set SUBMODULE_FILE_PATH0=!SUBMODULE_DIR0!!SUBMODULE_FILE!
set SUBMODULE_FILE_PATH1=!SUBMODULE_DIR1!!SUBMODULE_FILE!
set SUBMODULE_FILE_PATH2=!SUBMODULE_DIR2!
set SUBMODULE_FILE_PATH3=!SUBMODULE_DIR3!!SUBMODULE_FILE!
set SUBMODULE_FILE_PATH4=!SUBMODULE_DIR4!!SUBMODULE_FILE!

:: walk thru submodule paths
set MISSING_SUBMODULE_DIRS=
Expand All @@ -97,6 +99,10 @@ if not exist !SUBMODULE_FILE_PATH3! (
set NEED_TO_INIT_SUBMODULES=1
set MISSING_SUBMODULE_DIRS=!MISSING_SUBMODULE_DIRS! !SUBMODULE_DIR3!,
)
if not exist !SUBMODULE_FILE_PATH4! (
set NEED_TO_INIT_SUBMODULES=1
set MISSING_SUBMODULE_DIRS=!MISSING_SUBMODULE_DIRS! !SUBMODULE_DIR4!,
)

:: init submodules if necessary
if !NEED_TO_INIT_SUBMODULES! neq 0 (
Expand All @@ -111,6 +117,7 @@ if !NEED_TO_INIT_SUBMODULES! neq 0 (
git submodule update --init Libs/imgui
git submodule update --init Libs/cgltf
git submodule update --init Source/Renderer/Libs/D3DX12
git submodule update --init Source/Renderer/Libs/AMD/FidelityFX-SDK
cd Build

:: check if submodule initialized properly
Expand All @@ -119,6 +126,7 @@ if !NEED_TO_INIT_SUBMODULES! neq 0 (
if not exist !SUBMODULE_FILE_PATH1! ( set NEED_TO_INIT_SUBMODULES=1 )
if not exist !SUBMODULE_FILE_PATH2! ( set NEED_TO_INIT_SUBMODULES=1 )
if not exist !SUBMODULE_FILE_PATH3! ( set NEED_TO_INIT_SUBMODULES=1 )
if not exist !SUBMODULE_FILE_PATH4! ( set NEED_TO_INIT_SUBMODULES=1 )
if !NEED_TO_INIT_SUBMODULES! neq 0 (
echo.
echo [VQBuild] Could not initialize submodule. Make sure all the submodules are initialized and updated.
Expand Down
10 changes: 3 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,6 @@ set (SceneFiles
"Source/Engine/Scene/Quaternion.cpp"
)

set (PostProcessFiles
"Source/Engine/PostProcess/PostProcess.h"
"Source/Engine/PostProcess/PostProcess.cpp"
)

set (UIFiles
"Source/Engine/UI/VQUI.cpp"
"Source/Engine/UI/VQUI.h"
Expand Down Expand Up @@ -177,7 +172,6 @@ source_group("Source\\Importer" FILES ${ImporterFiles})
source_group("Source\\Core" FILES ${CoreFiles})
source_group("Source\\Scene" FILES ${SceneFiles})
source_group("Source\\UI" FILES ${UIFiles})
source_group("Source\\PostProcess" FILES ${PostProcessFiles})
source_group("Source" FILES ${SourceVQE})

set_source_files_properties(${Config} PROPERTIES VS_TOOL_OVERRIDE "Text")
Expand All @@ -187,6 +181,7 @@ set_source_files_properties(${Materials} PROPERTIES VS_TOOL_OVERRIDE "Text")

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}/Source/Renderer/Libs/AMD/FidelityFX-SDK/PrebuiltSignedDLL)

# Create a library with the project name that is build with the Headers and Source files
add_executable( ${PROJECT_NAME}
Expand Down Expand Up @@ -227,7 +222,8 @@ set_target_properties(ImGUI PROPERTIES FOLDER Libs)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${Includes})
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${LibsIncl})

target_link_libraries(${PROJECT_NAME} PRIVATE VQUtils VQRenderer WinPixEventRuntime ImGUI)
target_link_libraries(${PROJECT_NAME} PRIVATE VQUtils VQRenderer WinPixEventRuntime ImGUI amd_fidelityfx_dx12)


add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
Expand Down
2 changes: 1 addition & 1 deletion Data/EngineSettings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[Graphics]
VSync=false
RenderScale=1.0
RenderResolutionScale=1.0
TripleBuffer=true
AntiAliasing=true
Reflections=1
Expand Down
4 changes: 2 additions & 2 deletions Data/Resources/VQE.rc
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ BEGIN
BEGIN
VALUE "CompanyName", "Volkan Ilbeyli @vilbeyli - GitHub/VQE"
VALUE "FileDescription", "VQEngine Renderer Application"
VALUE "FileVersion", "0.11.0.0"
VALUE "FileVersion", "0.12.0.0"
VALUE "InternalName", "VQE.exe"
VALUE "OriginalFilename", "VQE.exe"
VALUE "ProductName", "VQEngine"
VALUE "ProductVersion", "0.11.0.0"
VALUE "ProductVersion", "0.12.0.0"
END
END
BLOCK "VarFileInfo"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ VQE supports the following command line parameters:
- [D3D12MA](https://github.com/GPUOpen-LibrariesAndSDKs/D3D12MemoryAllocator)
- [stb](https://github.com/nothings/stb)
- [tinyxml2](https://github.com/leethomason/tinyxml2)
- [cgltf][https://github.com/jkuhlmann/cgltf]
- [cgltf](https://github.com/jkuhlmann/cgltf)
- [WinPixEventRuntime](https://devblogs.microsoft.com/pix/winpixeventruntime/)
- [Khronos glTF Sample Models](https://github.com/KhronosGroup/glTF-Sample-Models)
- [cgbookcase PBR Textures](https://www.cgbookcase.com/)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions Shaders/AMDFidelityFX.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
//
//--------------------------------------------------------------------------------------
#if FFXCAS_CS || FFXCAS_PS
#include "AMDFidelityFX/CAS/ffx_a.h"
#include "AMD/CAS/ffx_a.h"

//
// App-side Defines
Expand Down Expand Up @@ -114,7 +114,7 @@ cbuffer CASConstants : register(b0)



#include "AMDFidelityFX/CAS/ffx_cas.h"
#include "AMD/CAS/ffx_cas.h"

//
// CAS Main
Expand Down Expand Up @@ -183,7 +183,7 @@ void CAS_CSMain(uint3 LocalThreadId : SV_GroupThreadID, uint3 WorkGroupId : SV_G
//
//--------------------------------------------------------------------------------------
#if FSR_EASU_CS || FSR_EASU_PS
#include "AMDFidelityFX/FSR1.0/ffx_a.h"
#include "AMD/FSR1.0/ffx_a.h"

//
// App-side Defines
Expand Down Expand Up @@ -238,7 +238,7 @@ SamplerState samLinearClamp : register(s0);



#include "AMDFidelityFX/FSR1.0/ffx_fsr1.h"
#include "AMD/FSR1.0/ffx_fsr1.h"


//
Expand Down Expand Up @@ -304,7 +304,7 @@ cbuffer RCASConstants : register(b0)
uint4 RCASConst0;
}

#include "AMDFidelityFX/FSR1.0/ffx_a.h"
#include "AMD/FSR1.0/ffx_a.h"


//
Expand All @@ -328,7 +328,7 @@ cbuffer RCASConstants : register(b0)

#endif // FSR_FP16

#include "AMDFidelityFX/FSR1.0/ffx_fsr1.h"
#include "AMD/FSR1.0/ffx_fsr1.h"
//
// RCAS
//
Expand Down Expand Up @@ -518,7 +518,7 @@ AH4 SpdReduce4H(AH4 v0, AH4 v1, AH4 v2, AH4 v3)
}
#endif // A_HALF

#include "AMDFidelityFX/SPD/ffx_spd.h"
#include "AMD/SPD/ffx_spd.h"
//
// SPD Main
//
Expand Down
4 changes: 2 additions & 2 deletions Shaders/DepthPrePass.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ Texture2D texHeightmap : register(t8);
#if INSTANCED_DRAW
matrix GetWorldMatrix(uint instID) { return cbPerObject.matWorld[instID]; }
matrix GetWorldNormalMatrix(uint instID) { return cbPerObject.matNormal[instID]; }
matrix GetWorldViewProjectionMatrix(uint instID) { return cbPerObject.matWorldViewProj[instID]; }
matrix GetWorldViewProjectionMatrix(uint instID) { return cbPerObject.matJitteredWorldViewProj[instID]; }
#else
matrix GetWorldMatrix() { return cbPerObject.matWorld; }
matrix GetWorldNormalMatrix() { return cbPerObject.matNormal; }
matrix GetWorldViewProjectionMatrix() { return cbPerObject.matWorldViewProj; }
matrix GetWorldViewProjectionMatrix() { return cbPerObject.matJitteredWorldViewProj; }
#endif
float2 GetUVScale() { return cbPerObject.materialData.uvScaleOffset.xy; }
float2 GetUVOffset() { return cbPerObject.materialData.uvScaleOffset.zw; }
Expand Down
4 changes: 2 additions & 2 deletions Shaders/DownsampleDepth.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ cbuffer cbDownsampleDepth

#define A_GPU
#define A_HLSL
#include "AMDFidelityFX/SPD/ffx_a.h"
#include "AMD/SPD/ffx_a.h"

groupshared float g_group_shared_depth_values[16][16];
groupshared uint g_group_shared_counter;
Expand All @@ -71,7 +71,7 @@ AF4 SpdLoadIntermediate(AU1 x, AU1 y) {
void SpdStoreIntermediate(AU1 x, AU1 y, AF4 value) { g_group_shared_depth_values[x][y] = value.x; }
AF4 SpdReduce4(AF4 v0, AF4 v1, AF4 v2, AF4 v3) { return min(min(v0, v1), min(v2, v3)); }

#include "AMDFidelityFX/SPD/ffx_spd.h"
#include "AMD/SPD/ffx_spd.h"

uint GetThreadgroupCount(uint2 image_size) {
// Each threadgroup works on 64x64 texels
Expand Down
51 changes: 35 additions & 16 deletions Shaders/ForwardLighting.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,27 @@ struct PSInput
struct PSOutput
{
float4 color : SV_TARGET0;

#if PS_OUTPUT_ALBEDO_METALLIC
float4 albedo_metallic : SV_TARGET1;
#endif

#if PS_OUTPUT_ALBEDO_METALLIC && PS_OUTPUT_MOTION_VECTORS
#if PS_OUTPUT_MOTION_VECTORS
#if PS_OUTPUT_ALBEDO_METALLIC
float2 motion_vectors : SV_TARGET2;
#elif !PS_OUTPUT_ALBEDO_METALLIC && PS_OUTPUT_MOTION_VECTORS
#else
float2 motion_vectors : SV_TARGET1;
#endif
#endif

#if PS_OUTPUT_MASK
#if PS_OUTPUT_ALBEDO_METALLIC && PS_OUTPUT_MOTION_VECTORS
float transparencyAndCompositionMask : SV_TARGET3;
#elif S_OUTPUT_ALBEDO_METALLIC || PS_OUTPUT_MOTION_VECTORS
float transparencyAndCompositionMask : SV_TARGET2;
#else
float transparencyAndCompositionMask : SV_TARGET1;
#endif
#endif
};

Expand Down Expand Up @@ -119,13 +132,15 @@ TextureCubeArray texPointLightShadowMaps : register(t22);
matrix GetWorldMatrix(uint instID) { return cbPerObject.matWorld[instID]; }
matrix GetWorldNormalMatrix(uint instID) { return cbPerObject.matNormal[instID]; }
matrix GetWorldViewProjectionMatrix(uint instID) { return cbPerObject.matWorldViewProj[instID]; }
matrix GetJitteredWorldViewProjectionMatrix(uint instID) { return cbPerObject.matJitteredWorldViewProj[instID]; }
#if PS_OUTPUT_MOTION_VECTORS
matrix GetPrevWorldViewProjectionMatrix(uint instID) { return cbPerObject.matWorldViewProjPrev[instID]; }
#endif
#else
matrix GetWorldMatrix() { return cbPerObject.matWorld; }
matrix GetWorldNormalMatrix() { return cbPerObject.matNormal; }
matrix GetWorldViewProjectionMatrix() { return cbPerObject.matWorldViewProj; }
matrix GetJitteredWorldViewProjectionMatrix() { return cbPerObject.matJitteredWorldViewProj; }
#if PS_OUTPUT_MOTION_VECTORS
matrix GetPrevWorldViewProjectionMatrix() { return cbPerObject.matWorldViewProjPrev; }
#endif
Expand Down Expand Up @@ -155,35 +170,36 @@ PSInput TransformVertex(

#if INSTANCED_DRAW
matrix matW = GetWorldMatrix(InstanceID);
matrix matWVP = GetWorldViewProjectionMatrix(InstanceID);
matrix matJWVP = GetJitteredWorldViewProjectionMatrix(InstanceID);
matrix matWN = GetWorldNormalMatrix(InstanceID);

#if PS_OUTPUT_MOTION_VECTORS
matrix matWVP = GetWorldViewProjectionMatrix(InstanceID);
matrix matPrevWVP = GetPrevWorldViewProjectionMatrix(InstanceID);
#endif
#else
matrix matW = GetWorldMatrix();
matrix matWVP = GetWorldViewProjectionMatrix();
matrix matJWVP = GetJitteredWorldViewProjectionMatrix();
matrix matWN = GetWorldNormalMatrix();
#if PS_OUTPUT_MOTION_VECTORS
matrix matWVP = GetWorldViewProjectionMatrix();
matrix matPrevWVP = GetPrevWorldViewProjectionMatrix();
#endif
#endif // INSTANCED_DRAW

PSInput result;
result.position = mul(matWVP, vPosition);
result.position = mul(matJWVP, vPosition);
result.WorldSpacePosition = mul(matW, vPosition).xyz;
result.WorldSpaceNormal = mul((float4x3)matWN, Normal).xyz;
result.WorldSpaceTangent = mul((float4x3)matWN, Tangent).xyz;
#if PS_OUTPUT_MOTION_VECTORS
#if PS_OUTPUT_MOTION_VECTORS
result.svPositionPrev = mul(matPrevWVP, vPosition);
#endif
#endif
result.uv = uv;

#if PS_OUTPUT_MOTION_VECTORS
result.svPositionCurr = result.position;
result.svPositionCurr = mul(matWVP, vPosition);
#endif

return result;
}

Expand Down Expand Up @@ -225,14 +241,15 @@ PSOutput PSMain(PSInput In)

const float2 uv = In.uv * cbPerObject.materialData.uvScaleOffset.xy + cbPerObject.materialData.uvScaleOffset.zw;
const int TEX_CFG = cbPerObject.materialData.textureConfig;
const float MipBias = OverrideGlobalMipBias(TEX_CFG) ? cbPerObject.materialData.mipMapBias : cbPerFrame.fGlobalMipBias;

float4 AlbedoAlpha = texDiffuse .Sample(AnisoSampler, uv);
float4 AlbedoAlpha = texDiffuse.SampleBias(AnisoSampler, uv, MipBias);
float3 Normal = texNormals.SampleBias(AnisoSampler, uv, cbPerObject.materialData.normalMapMipBias).rgb;
float3 Emissive = texEmissive .Sample(LinearSampler, uv).rgb;
float Metalness = texMetalness.Sample(AnisoSampler, uv).r;
float Roughness = texRoughness.Sample(AnisoSampler, uv).r;
float3 OcclRghMtl = texOcclRoughMetal.Sample(AnisoSampler, uv).rgb;
float LocalAO = texLocalAO.Sample(AnisoSampler, uv).r;
float3 Emissive = texEmissive.SampleBias(LinearSampler, uv, MipBias).rgb;
float Metalness = texMetalness.SampleBias(AnisoSampler, uv, MipBias).r;
float Roughness = texRoughness.SampleBias(AnisoSampler, uv, MipBias).r;
float3 OcclRghMtl = texOcclRoughMetal.SampleBias(AnisoSampler, uv, MipBias).rgb;
float LocalAO = texLocalAO.SampleBias(AnisoSampler, uv, MipBias).r;

#if ENABLE_ALPHA_MASK
if (HasDiffuseMap(TEX_CFG) && AlbedoAlpha.a < 0.01f)
Expand Down Expand Up @@ -383,9 +400,11 @@ PSOutput PSMain(PSInput In)
o.albedo_metallic = float4(Surface.diffuseColor, Surface.metalness);
#endif
#if PS_OUTPUT_MOTION_VECTORS
//o.motion_vectors = float2(0.77777777777777, 0.8888888888888888); // debug output
o.motion_vectors = float2(In.svPositionCurr.xy / In.svPositionCurr.w - In.svPositionPrev.xy / In.svPositionPrev.w);
#endif
#if PS_OUTPUT_MASK
o.transparencyAndCompositionMask = 1.0f;
#endif

return o;
}
Loading