Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 External/NRD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 2 additions & 4 deletions Samples/FullSample/Shaders/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -79,8 +79,6 @@ set(shaders
GBufferHelpers.hlsli
GlassPass.hlsl
HelperFunctions.hlsli
GlassPass.hlsl
Helperfunctions.hlsli
LightShaping.hlsli
PolymorphicLight.hlsli
PostprocessGBuffer.hlsl
Expand Down Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -127,4 +127,4 @@ bool RAB_AreMaterialsSimilar(RAB_Material a, RAB_Material b)
return true;
}

#endif // RAB_MATERIAL_HLSLI
#endif // RAB_MATERIAL_HLSLI
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -430,4 +430,4 @@ void PrintSurface_(RAB_Surface surface)

#endif // SHADER_DEBUG_PRINT_FULL_HLSLI

#endif // RTXDI_RAB_SURFACE_HLSLI
#endif // RTXDI_RAB_SURFACE_HLSLI
17 changes: 10 additions & 7 deletions Samples/FullSample/Source/App/CommandLineArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T, int n>
std::istream& operator>> (std::istream& is, vector<T, n>& vec)
{
for (int i = 0; i < n; ++i)
{
is >> vec[i];
}
return is;
}
}

std::istream& operator>> (std::istream& is, AntiAliasingMode& mode)
Expand Down
6 changes: 3 additions & 3 deletions Samples/FullSample/Source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -118,4 +118,4 @@ endif()

if(DONUT_WITH_AFTERMATH)
file(COPY ${AFTERMATH_RUNTIME_LIBRARY} DESTINATION ${CMAKE_BINARY_DIR}/bin)
endif()
endif()
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
#include "ShaderDebug/ShaderPrint.h"
#include "ShaderDebug/PTPathViz/PTPathVizPass.h"

#ifdef _WIN32
#include "nvapi.h"
#endif

#include <utility>

Expand Down Expand Up @@ -786,4 +788,4 @@ uint32_t LightingPasses::GetOutputReservoirBufferIndex() const
uint32_t LightingPasses::GetGIOutputReservoirBufferIndex() const
{
return m_currentFrameGIOutputReservoir;
}
}
8 changes: 7 additions & 1 deletion Samples/FullSample/Source/ShaderDebug/ShaderPrint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 4 additions & 0 deletions Samples/FullSample/Source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <donut/render/DLSS.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Samples/MinimalSample/Source/PrepareLightsPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <utility>

using namespace donut::math;
#include "../shaders/ShaderParameters.h"
#include "../Shaders/ShaderParameters.h"

using namespace donut::engine;

Expand Down
2 changes: 1 addition & 1 deletion Samples/MinimalSample/Source/RenderPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <Rtxdi/DI/ReSTIRDI.h>

using namespace donut::math;
#include "../shaders/ShaderParameters.h"
#include "../Shaders/ShaderParameters.h"

using namespace donut::engine;

Expand Down
2 changes: 1 addition & 1 deletion Samples/MinimalSample/Source/RtxdiResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <donut/core/math/math.h>

using namespace dm;
#include "../shaders/ShaderParameters.h"
#include "../Shaders/ShaderParameters.h"

RtxdiResources::RtxdiResources(
nvrhi::IDevice* device,
Expand Down
4 changes: 2 additions & 2 deletions Samples/MinimalSample/Source/SampleScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -204,4 +204,4 @@ void SampleScene::BuildTopLevelAccelStruct(nvrhi::ICommandList* commandList)
nvrhi::rt::IAccelStruct* SampleScene::GetTopLevelAS() const
{
return m_topLevelAS;
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand Down