diff --git a/External/NRD.cmake b/External/NRD.cmake index 6aa16d4..d555e75 100644 --- a/External/NRD.cmake +++ b/External/NRD.cmake @@ -11,5 +11,5 @@ if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/NRD/CMakeLists.txt") option(NRD_SUPPORTS_BASECOLOR_METALNESS "" OFF) option(NRD_STATIC_LIBRARY "" ON) - add_subdirectory(external/NRD) + add_subdirectory(External/NRD) endif() diff --git a/External/cxxopts b/External/cxxopts index e84ab5f..44380e5 160000 --- a/External/cxxopts +++ b/External/cxxopts @@ -1 +1 @@ -Subproject commit e84ab5f67ca34dfb6d5b1f6801e1d6f338b8ebe5 +Subproject commit 44380e5a44706ab7347f400698c703eb2a196202 diff --git a/Libraries/Rtxdi b/Libraries/Rtxdi index d28e20f..e2f06f1 160000 --- a/Libraries/Rtxdi +++ b/Libraries/Rtxdi @@ -1 +1 @@ -Subproject commit d28e20f11c6bdd5a1cca273cfbad5e8493e4ba05 +Subproject commit e2f06f17c2943d384ab5c00c8a03a86cb4ad6a1f diff --git a/README.md b/README.md index fced9e9..238d5a0 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ For an academic presentation on the ReSTIR family of algorithms, see the SIGGRAP - `mkdir build && cd build` 5. Configure the project with CMake: - - `cmake ..` + - `cmake .. -DNVRHI_WITH_NVAPI=OFF` 6. Build: - `make -j8` (example for an 8-core CPU, or use [Ninja](https://ninja-build.org) instead) diff --git a/Samples/FullSample/Shaders/CMakeLists.txt b/Samples/FullSample/Shaders/CMakeLists.txt index be5f578..dda7a14 100644 --- a/Samples/FullSample/Shaders/CMakeLists.txt +++ b/Samples/FullSample/Shaders/CMakeLists.txt @@ -59,7 +59,7 @@ set(shaders ShaderDebug/ShaderDebugPrint/ShaderDebugPrint.hlsli ShaderDebug/VisualizeConfidence.hlsl ShaderDebug/VisualizeHdrSignals.hlsl - SharedShaderInclude/SharedShaderInclude/ShaderDebug/PTPathViz/PTPathViZConstants.h + SharedShaderInclude/SharedShaderInclude/ShaderDebug/PTPathViz/PTPathVizConstants.h SharedShaderInclude/SharedShaderInclude/ShaderDebug/PTPathViz/PTPathVertexRecord.h SharedShaderInclude/SharedShaderInclude/ShaderDebug/PTPathViz/PTPathSetRecord.h SharedShaderInclude/SharedShaderInclude/ShaderDebug/ReSTIRShaderDebugParameters.h @@ -79,8 +79,6 @@ set(shaders GBufferHelpers.hlsli GlassPass.hlsl HelperFunctions.hlsli - GlassPass.hlsl - Helperfunctions.hlsli LightShaping.hlsli PolymorphicLight.hlsli PostprocessGBuffer.hlsl @@ -110,7 +108,7 @@ set(FULL_SAMPLE_SHARED_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/SharedShaderInc set(FULL_SAMPLE_SHARED_INCLUDE_PATH ${FULL_SAMPLE_SHARED_INCLUDE_PATH} PARENT_SCOPE) if(TARGET NRD) - set(NRD_OPTIONS -I "${CMAKE_CURRENT_SOURCE_DIR}/../../../external/NRD/Shaders" -D WITH_NRD) + set(NRD_OPTIONS -I "${CMAKE_CURRENT_SOURCE_DIR}/../../../External/NRD/Shaders" -D WITH_NRD) else() set(NRD_OPTIONS --relaxedInclude NRD.hlsli) endif() diff --git a/Samples/FullSample/Shaders/LightingPasses/RtxdiApplicationBridge/RAB_Material.hlsli b/Samples/FullSample/Shaders/LightingPasses/RtxdiApplicationBridge/RAB_Material.hlsli index 4e297f4..2e5795f 100644 --- a/Samples/FullSample/Shaders/LightingPasses/RtxdiApplicationBridge/RAB_Material.hlsli +++ b/Samples/FullSample/Shaders/LightingPasses/RtxdiApplicationBridge/RAB_Material.hlsli @@ -14,7 +14,7 @@ #define RAB_MATERIAL_HLSLI #include "donut/shaders/brdf.hlsli" -#include "Rtxdi/Utils/RandomSamplerstate.hlsli" +#include "Rtxdi/Utils/RandomSamplerState.hlsli" static const float kMinRoughness = 0.03f; @@ -127,4 +127,4 @@ bool RAB_AreMaterialsSimilar(RAB_Material a, RAB_Material b) return true; } -#endif // RAB_MATERIAL_HLSLI \ No newline at end of file +#endif // RAB_MATERIAL_HLSLI diff --git a/Samples/FullSample/Shaders/LightingPasses/RtxdiApplicationBridge/RAB_Surface.hlsli b/Samples/FullSample/Shaders/LightingPasses/RtxdiApplicationBridge/RAB_Surface.hlsli index 919443d..8dc7e24 100644 --- a/Samples/FullSample/Shaders/LightingPasses/RtxdiApplicationBridge/RAB_Surface.hlsli +++ b/Samples/FullSample/Shaders/LightingPasses/RtxdiApplicationBridge/RAB_Surface.hlsli @@ -19,7 +19,7 @@ #include "Rtxdi/Utils/BrdfRaySample.hlsli" #include "Rtxdi/Utils/Color.hlsli" -#include "Rtxdi/Utils/RandomSamplerstate.hlsli" +#include "Rtxdi/Utils/RandomSamplerState.hlsli" #include "RAB_Material.hlsli" struct RAB_Surface @@ -430,4 +430,4 @@ void PrintSurface_(RAB_Surface surface) #endif // SHADER_DEBUG_PRINT_FULL_HLSLI -#endif // RTXDI_RAB_SURFACE_HLSLI \ No newline at end of file +#endif // RTXDI_RAB_SURFACE_HLSLI diff --git a/Samples/FullSample/Source/App/CommandLineArgs.cpp b/Samples/FullSample/Source/App/CommandLineArgs.cpp index 410e92a..a6dbcf8 100644 --- a/Samples/FullSample/Source/App/CommandLineArgs.cpp +++ b/Samples/FullSample/Source/App/CommandLineArgs.cpp @@ -20,13 +20,16 @@ static void toupper(std::string& s) [](unsigned char c) { return std::toupper(c); }); } -std::istream& operator>> (std::istream& is, float3& vec) -{ - is >> vec.x; - is >> vec.y; - is >> vec.z; - - return is; +namespace donut::math { + template + std::istream& operator>> (std::istream& is, vector& vec) + { + for (int i = 0; i < n; ++i) + { + is >> vec[i]; + } + return is; + } } std::istream& operator>> (std::istream& is, AntiAliasingMode& mode) diff --git a/Samples/FullSample/Source/CMakeLists.txt b/Samples/FullSample/Source/CMakeLists.txt index c11219f..bbe9957 100644 --- a/Samples/FullSample/Source/CMakeLists.txt +++ b/Samples/FullSample/Source/CMakeLists.txt @@ -56,8 +56,8 @@ set(sources "RenderPasses/GlassPass.h" "RenderPasses/PrepareLightsPass.cpp" "RenderPasses/PrepareLightsPass.h" - "RenderPasses/RaytracingPass.cpp" - "RenderPasses/RaytracingPass.h" + "RenderPasses/RayTracingPass.cpp" + "RenderPasses/RayTracingPass.h" "RenderPasses/RenderEnvironmentMapPass.cpp" "RenderPasses/RenderEnvironmentMapPass.h" "Scene/Lights.h" @@ -118,4 +118,4 @@ endif() if(DONUT_WITH_AFTERMATH) file(COPY ${AFTERMATH_RUNTIME_LIBRARY} DESTINATION ${CMAKE_BINARY_DIR}/bin) -endif() \ No newline at end of file +endif() diff --git a/Samples/FullSample/Source/RenderPasses/LightingPasses/LightingPasses.cpp b/Samples/FullSample/Source/RenderPasses/LightingPasses/LightingPasses.cpp index 80f6c62..3bba985 100644 --- a/Samples/FullSample/Source/RenderPasses/LightingPasses/LightingPasses.cpp +++ b/Samples/FullSample/Source/RenderPasses/LightingPasses/LightingPasses.cpp @@ -29,7 +29,9 @@ #include "ShaderDebug/ShaderPrint.h" #include "ShaderDebug/PTPathViz/PTPathVizPass.h" +#ifdef _WIN32 #include "nvapi.h" +#endif #include @@ -786,4 +788,4 @@ uint32_t LightingPasses::GetOutputReservoirBufferIndex() const uint32_t LightingPasses::GetGIOutputReservoirBufferIndex() const { return m_currentFrameGIOutputReservoir; -} \ No newline at end of file +} diff --git a/Samples/FullSample/Source/ShaderDebug/ShaderPrint.cpp b/Samples/FullSample/Source/ShaderDebug/ShaderPrint.cpp index 6effc18..d4e02e0 100644 --- a/Samples/FullSample/Source/ShaderDebug/ShaderPrint.cpp +++ b/Samples/FullSample/Source/ShaderDebug/ShaderPrint.cpp @@ -204,7 +204,13 @@ static std::string MakeString(const char* format, ...) char buffer[1024 * 16] = { 0 }; va_list args; va_start(args, format); - vsprintf_s(buffer, ArraySize_(buffer), format, args); + + #ifdef _WIN32 + vsprintf_s(buffer, ArraySize_(buffer), format, args); + #else + vsnprintf(buffer, ArraySize_(buffer), format, args); + #endif + return std::string(buffer); } diff --git a/Samples/FullSample/Source/main.cpp b/Samples/FullSample/Source/main.cpp index c850541..13ad7d5 100644 --- a/Samples/FullSample/Source/main.cpp +++ b/Samples/FullSample/Source/main.cpp @@ -17,7 +17,11 @@ #include "App/CommandLineArgs.h" #include "App/LoggingCallback.h" #include "App/SceneRenderer.h" + +#ifdef _WIN32 #include "nvapi.h" +#endif + #include "SharedShaderInclude/NvapiIntegration.h" #include diff --git a/Samples/MinimalSample/Shaders/RtxdiApplicationBridge/RAB_Surface.hlsli b/Samples/MinimalSample/Shaders/RtxdiApplicationBridge/RAB_Surface.hlsli index 6178b9e..c41c9b3 100644 --- a/Samples/MinimalSample/Shaders/RtxdiApplicationBridge/RAB_Surface.hlsli +++ b/Samples/MinimalSample/Shaders/RtxdiApplicationBridge/RAB_Surface.hlsli @@ -3,7 +3,7 @@ #include "../GBufferHelpers.hlsli" -#include "Rtxdi/Utils/RandomSamplerstate.hlsli" +#include "Rtxdi/Utils/RandomSamplerState.hlsli" #include "RAB_Material.hlsli" // A surface with enough information to evaluate BRDFs diff --git a/Samples/MinimalSample/Source/PrepareLightsPass.cpp b/Samples/MinimalSample/Source/PrepareLightsPass.cpp index 646c9d8..1d5716f 100644 --- a/Samples/MinimalSample/Source/PrepareLightsPass.cpp +++ b/Samples/MinimalSample/Source/PrepareLightsPass.cpp @@ -21,7 +21,7 @@ #include using namespace donut::math; -#include "../shaders/ShaderParameters.h" +#include "../Shaders/ShaderParameters.h" using namespace donut::engine; diff --git a/Samples/MinimalSample/Source/RenderPass.cpp b/Samples/MinimalSample/Source/RenderPass.cpp index 34867e1..16bd576 100644 --- a/Samples/MinimalSample/Source/RenderPass.cpp +++ b/Samples/MinimalSample/Source/RenderPass.cpp @@ -21,7 +21,7 @@ #include using namespace donut::math; -#include "../shaders/ShaderParameters.h" +#include "../Shaders/ShaderParameters.h" using namespace donut::engine; diff --git a/Samples/MinimalSample/Source/RtxdiResources.cpp b/Samples/MinimalSample/Source/RtxdiResources.cpp index b4ba81e..23f1c9e 100644 --- a/Samples/MinimalSample/Source/RtxdiResources.cpp +++ b/Samples/MinimalSample/Source/RtxdiResources.cpp @@ -14,7 +14,7 @@ #include using namespace dm; -#include "../shaders/ShaderParameters.h" +#include "../Shaders/ShaderParameters.h" RtxdiResources::RtxdiResources( nvrhi::IDevice* device, diff --git a/Samples/MinimalSample/Source/SampleScene.cpp b/Samples/MinimalSample/Source/SampleScene.cpp index 9ccf030..533203f 100644 --- a/Samples/MinimalSample/Source/SampleScene.cpp +++ b/Samples/MinimalSample/Source/SampleScene.cpp @@ -20,7 +20,7 @@ using namespace donut; using namespace donut::math; -#include "../shaders/ShaderParameters.h" +#include "../Shaders/ShaderParameters.h" inline uint64_t AdvanceHeapPtr(uint64_t& heapPtr, const nvrhi::MemoryRequirements& memReq) { @@ -204,4 +204,4 @@ void SampleScene::BuildTopLevelAccelStruct(nvrhi::ICommandList* commandList) nvrhi::rt::IAccelStruct* SampleScene::GetTopLevelAS() const { return m_topLevelAS; -} \ No newline at end of file +} diff --git a/Support/Tests/RtxdiRuntimeShaderTests/Shaders/RtxdiApplicationBridge/RAB_Surface.hlsli b/Support/Tests/RtxdiRuntimeShaderTests/Shaders/RtxdiApplicationBridge/RAB_Surface.hlsli index dbe7963..78be6f1 100644 --- a/Support/Tests/RtxdiRuntimeShaderTests/Shaders/RtxdiApplicationBridge/RAB_Surface.hlsli +++ b/Support/Tests/RtxdiRuntimeShaderTests/Shaders/RtxdiApplicationBridge/RAB_Surface.hlsli @@ -1,7 +1,7 @@ #ifndef RTXDI_RAB_SURFACE_HLSLI #define RTXDI_RAB_SURFACE_HLSLI -#include "Rtxdi/Utils/RandomSamplerstate.hlsli" +#include "Rtxdi/Utils/RandomSamplerState.hlsli" #include "RAB_Material.hlsli" struct RAB_Surface