Skip to content

Commit

Permalink
v1.2.11 release
Browse files Browse the repository at this point in the history
  • Loading branch information
acmarrs-nvidia committed Apr 27, 2022
1 parent c0d6f49 commit ecff095
Show file tree
Hide file tree
Showing 15 changed files with 249 additions and 125 deletions.
28 changes: 28 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# RTXGI SDK Change Log

## 1.2.11

### SDK

Features and Improvements:
- Improved flexibility for specifying thresholds for probe ray backface hits
- The backface hit threshold used in ```ProbeBlendingCS``` is now adjustable
- Thresholds for random rays (blending) and fixed rays (relocation/classification) can now be specified separately
- **Note:** this change modifies the ```DDGIVolumeDescGPU``` struct
- Improved lighting responsiveness after a probe is scrolled (and cleared)
- Drops hysteresis to zero for the first update cycle after a probe is scrolled and cleared
- **Note:** hysteresis is now set to zero for all probe texels where the previous irradiance is zero in all color channels
- Renames ```DDGIResetScrolledPlane()``` to ```DDGIClearScrolledPlane()``` to better reflect its purpose
- Adds option to use shared memory during probe scroll clear testing
- When enabled, scroll clear tests will only run for the first thread of a blending thread group
- ```RTXGI_DDGI_BLEND_SCROLL_SHARED_MEMORY``` is now a required define for ```ProbeBlendingCS.hlsl```
- Can be a performance win on some hardware

Bug Fixes:
- Fixes issue where some probes were not being cleared properly during scrolling events ([Issue #62](https://github.com/NVIDIAGameWorks/RTXGI/issues/62))
- **Note:** this change modifies the ```DDGIVolumeDescGPU``` struct

### Test Harness

Features and Improvements:
- Improves support for loading GLTF files that contain geometry primitives without assigned materials ([Issue #61](https://github.com/NVIDIAGameWorks/RTXGI/issues/61))
- Updates UI to reflect the separate random and fixed probe ray threshold options

## 1.2.07

### SDK
Expand Down
1 change: 1 addition & 0 deletions docs/DDGIVolume.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ Compute shader code that updates (blends) either radiance or distance values int
- ```RTXGI_DDGI_BLEND_RADIANCE``` specifies the blending mode (0: distance, 1: radiance).
- ```RTXGI_DDGI_BLEND_SHARED_MEMORY``` toggles shared memory use. This can substantially improve performance at the cost of higher register and shared memory use (potentially lowering occupancy).
- ```RTXGI_DDGI_BLEND_RAYS_PER_PROBE``` specifies the number of rays traced per probe. Required when shared memory is enabled.
- ```RTXGI_DDGI_BLEND_SCROLL_SHARED_MEMORY``` toggles the use of shared memory to store the result of probe scroll clear tests. When enabled, the scroll clear tests are performed by the group's first thread and written to shared memory for use by the rest of the thread group . This can reduce the compute workload and improve performance on some hardware.

**Debug Defines**

Expand Down
4 changes: 2 additions & 2 deletions rtxgi-sdk/include/rtxgi/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ namespace rtxgi
{
static const int major = 1;
static const int minor = 2;
static const int revision = 7;
static const int revision = 11;

inline static const char* getVersionString()
{
return "1.2.07";
return "1.2.11";
}
};

Expand Down
32 changes: 21 additions & 11 deletions rtxgi-sdk/include/rtxgi/ddgi/DDGIVolume.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ namespace rtxgi
// texel's irradiance in a single update cycle.
float probeBrightnessThreshold = 0.10f;

// Bias values for Indirect Lighting.
// Probe blending assumes probes with more than this ratio of backface hits are inside of geometry
float probeRandomRayBackfaceThreshold = 0.1f;

// Probe relocation and probe classification assume probes with more than this ratio of backface hits are inside of geometry
float probeFixedRayBackfaceThreshold = 0.25f;

// Bias values for indirect lighting.
float probeViewBias = 0.1f; // A small offset along the camera view ray applied to the shaded surface point to avoid numerical instabilities when determining visibility
float probeNormalBias = 0.1f; // A small offset along the surface normal applied to the shaded surface point to avoid numerical instabilities when determining visibility

Expand All @@ -115,6 +121,9 @@ namespace rtxgi
uint32_t probeDistanceFormat = 0; // Texel format index for the distance texture, used with GetDDGIVolumeTextureFormat()
uint32_t probeDataFormat = 0; // Texel format index for the probe data texture, used with GetDDGIVolumeTextureFormat()

// Using shared memory for scroll tests in probe blending can be a performance win on some hardware by reducing the compute workload.
bool probeBlendingUseScrollSharedMemory = false;

// Probe relocation moves probes to more useful positions.
bool probeRelocationEnabled = false;
bool probeRelocationNeedsReset = false;
Expand All @@ -126,10 +135,6 @@ namespace rtxgi
bool probeClassificationEnabled = false;
bool probeClassificationNeedsReset = false;

// Probe relocation and probe classification assume probes with more
// than this ratio of backface hits are inside of geometry.
float probeBackfaceThreshold = 0.25f;

// The type of movement the volume supports:
// 0: Default movement
// 1: Infinite scrolling movement
Expand Down Expand Up @@ -242,6 +247,10 @@ namespace rtxgi

void SetProbeBrightnessThreshold(float value) { m_desc.probeBrightnessThreshold = value; }

void SetProbeRandomRayBackfaceThreshold(float value) { m_desc.probeRandomRayBackfaceThreshold = value; }

void SetProbeFixedRayBackfaceThreshold(float value) { m_desc.probeFixedRayBackfaceThreshold = value; }

// Probe Relocation Setters
void SetProbeRelocationEnabled(bool value) { m_desc.probeRelocationEnabled = value; }

Expand All @@ -254,8 +263,6 @@ namespace rtxgi

void SetProbeClassificationNeedsReset(bool value) { m_desc.probeClassificationNeedsReset = value; }

void SetProbeBackfaceThreshold(float value) { m_desc.probeBackfaceThreshold = value; }

//------------------------------------------------------------------------
// Getters
//------------------------------------------------------------------------
Expand Down Expand Up @@ -300,11 +307,15 @@ namespace rtxgi

float GetProbeDistanceExponent() const { return m_desc.probeDistanceExponent; }

float GetProbeIrradianceEncodingGamma() const { return m_desc.probeIrradianceEncodingGamma; }

float GetProbeIrradianceThreshold() const { return m_desc.probeIrradianceThreshold; }

float GetProbeBrightnessThreshold() const { return m_desc.probeBrightnessThreshold; }

float GetProbeIrradianceEncodingGamma() const { return m_desc.probeIrradianceEncodingGamma; }
float GetProbeRandomRayBackfaceThreshold() const { return m_desc.probeRandomRayBackfaceThreshold; }

float GetProbeFixedRayBackfaceThreshold() const { return m_desc.probeFixedRayBackfaceThreshold; }

float3 GetEulerAngles() const { return m_desc.eulerAngles; }

Expand All @@ -326,8 +337,6 @@ namespace rtxgi

bool GetProbeClassificationNeedsReset() const { return m_desc.probeClassificationNeedsReset; }

float GetProbeBackfaceThreshold() const { return m_desc.probeBackfaceThreshold; }

protected:

void ComputeRandomRotation();
Expand Down Expand Up @@ -355,13 +364,14 @@ namespace rtxgi

float3 m_probeScrollAnchor = { 0.f, 0.f, 0.f }; // The anchor position for a scrolling volume to target for it's effective origin
int3 m_probeScrollOffsets = { 0, 0, 0 }; // Grid-space space offsets for scrolling movement
int3 m_probeScrollDirections = { 0, 0, 0 }; // Direction of scrolling movement
bool m_probeScrollClear[3] = { 0, 0, 0 }; // If probes of a plane need to be cleared due to scrolling movement

bool m_insertPerfMarkers = false; // Toggles whether the volume will insert performance markers in the graphics command list.

private:

void ScrollReset(int planeIndex, int direction);
void ScrollReset();

};
}
109 changes: 64 additions & 45 deletions rtxgi-sdk/include/rtxgi/ddgi/DDGIVolumeDescGPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,16 @@ struct DDGIVolumeDescGPUPacked
float probeIrradianceEncodingGamma;
float probeIrradianceThreshold;
float probeBrightnessThreshold;
float probeBackfaceThreshold;
uint packed1; // probeRandomRayBackfaceThreshold (16), probeFixedRayBackfaceThreshold (16)
//------------------------------------------------- 112B
float probeMinFrontfaceDistance;
uint packed1; // probeNumRays (16), probeNumIrradianceTexels (8), probeNumDistanceTexels (8)
uint packed2; // probeScrollOffsets.x (15) sign bit (1), probeScrollOffsets.y (15) sign bit (1)
uint packed3; // probeScrollOffsets.z (15) sign bit (1)
uint packed2; // probeNumRays (16), probeNumIrradianceTexels (8), probeNumDistanceTexels (8)
uint packed3; // probeScrollOffsets.x (15) sign bit (1), probeScrollOffsets.y (15) sign bit (1)
uint packed4; // probeScrollOffsets.z (15) sign bit (1)
// movementType (1), rayDataFormat (1), irradianceFormat (1), probeRelocationEnabled (1), probeClassificationEnabled (1)
// probeScrollClear Y-Z plane (1), probeScrollClear X-Z plane (1), probeScrollClear X-Y plane (1)
// unused (8)
// probeScrollDirection Y-Z plane (1), probeScrollDirection X-Z plane (1), probeScrollDirection X-Y plane (1)
// unused (5)
//------------------------------------------------- 128B
};

Expand Down Expand Up @@ -76,23 +77,26 @@ struct DDGIVolumeDescGPU
float probeNormalBias; // offset along the surface normal, applied during lighting to avoid numerical instabilities when determining visibility
float probeViewBias; // offset along the camera view ray, applied during lighting to avoid numerical instabilities when determining visibility
float probeDistanceExponent; // exponent used during visibility testing. High values react rapidly to depth discontinuities, but may cause banding
float probeIrradianceEncodingGamma; // exponent that perceptually encodes irradiance for faster light-to-dark convergence

float probeIrradianceThreshold; // threshold to identify when large lighting changes occur
float probeBrightnessThreshold; // threshold that specifies the maximum allowed difference in brightness between the previous and current irradiance values
float probeIrradianceEncodingGamma; // exponent that perceptually encodes irradiance for faster light-to-dark convergence
float probeRandomRayBackfaceThreshold; // threshold that specifies the ratio of *random* rays traced for a probe that may hit back facing triangles before the probe is considered inside geometry (used in blending)

// Probe Relocation, Probe Classification
float probeBackfaceThreshold; // ratio of rays traced for a probe that may hit back facing triangles before the probe is considered inside geometry
float probeFixedRayBackfaceThreshold; // threshold that specifies the ratio of *fixed* rays traced for a probe that may hit back facing triangles before the probe is considered inside geometry (used in relocation & classification)
float probeMinFrontfaceDistance; // minimum world-space distance to a front facing triangle allowed before a probe is relocated

// Infinite Scrolling Volumes
int3 probeScrollOffsets; // grid-space offsets used for scrolling movement
bool probeScrollClear[3]; // whether probes of a plane need to be cleared due to scrolling movement
bool probeScrollDirections[3]; // direction of scrolling movement (0: negative, 1: positive)

// Feature Options
uint probeRayDataFormat; // format type of the ray data texture
uint probeIrradianceFormat; // format type of the irradiance texture
bool probeRelocationEnabled; // whether probe relocation is enabled for this volume
bool probeClassificationEnabled; // whether probe classification is enabled for this volume
bool probeScrollClear[3]; // whether probes of a plane need to be cleared due to scrolling movement

#ifndef HLSL
rtxgi::DDGIVolumeDescGPUPacked GetPackedData()
Expand All @@ -111,35 +115,42 @@ struct DDGIVolumeDescGPU
data.packed0 = (uint32_t)probeCounts.x;
data.packed0 |= (uint32_t)probeCounts.y << 8;
data.packed0 |= (uint32_t)probeCounts.z << 16;
//data.packed0 |= unused
//data.packed0 |= 8 bits unused

data.probeIrradianceEncodingGamma = probeIrradianceEncodingGamma;
data.probeIrradianceThreshold = probeIrradianceThreshold;
data.probeBrightnessThreshold = probeBrightnessThreshold;
data.probeBackfaceThreshold = probeBackfaceThreshold;

data.packed1 = (uint32_t)(probeRandomRayBackfaceThreshold * 65535);
data.packed1 |= (uint32_t)(probeFixedRayBackfaceThreshold * 65535) << 16;

data.probeMinFrontfaceDistance = probeMinFrontfaceDistance;

data.packed1 = (uint32_t)probeNumRays;
data.packed1 |= (uint32_t)probeNumIrradianceTexels << 16;
data.packed1 |= (uint32_t)probeNumDistanceTexels << 24;
data.packed2 = (uint32_t)probeNumRays;
data.packed2 |= (uint32_t)probeNumIrradianceTexels << 16;
data.packed2 |= (uint32_t)probeNumDistanceTexels << 24;

// Probe Scroll Offsets
data.packed2 = (uint32_t)abs(probeScrollOffsets.x);
data.packed2 |= ((uint32_t)(probeScrollOffsets.x < 0) << 15);
data.packed2 |= (uint32_t)abs(probeScrollOffsets.y) << 16;
data.packed2 |= ((uint32_t)(probeScrollOffsets.y < 0) << 31);
data.packed3 = (uint32_t)abs(probeScrollOffsets.z);
data.packed3 |= ((uint32_t)(probeScrollOffsets.z < 0) << 15);
data.packed3 = (uint32_t)abs(probeScrollOffsets.x);
data.packed3 |= ((uint32_t)(probeScrollOffsets.x < 0) << 15);
data.packed3 |= (uint32_t)abs(probeScrollOffsets.y) << 16;
data.packed3 |= ((uint32_t)(probeScrollOffsets.y < 0) << 31);
data.packed4 = (uint32_t)abs(probeScrollOffsets.z);
data.packed4 |= ((uint32_t)(probeScrollOffsets.z < 0) << 15);

// Feature Bits
data.packed3 |= movementType << 16;
data.packed3 |= probeRayDataFormat << 17;
data.packed3 |= probeIrradianceFormat << 18;
data.packed3 |= (uint32_t)probeRelocationEnabled << 19;
data.packed3 |= (uint32_t)probeClassificationEnabled << 20;
data.packed3 |= (uint32_t)probeScrollClear[0] << 21;
data.packed3 |= (uint32_t)probeScrollClear[1] << 22;
data.packed3 |= (uint32_t)probeScrollClear[2] << 23;
data.packed4 |= movementType << 16;
data.packed4 |= probeRayDataFormat << 17;
data.packed4 |= probeIrradianceFormat << 18;
data.packed4 |= (uint32_t)probeRelocationEnabled << 19;
data.packed4 |= (uint32_t)probeClassificationEnabled << 20;
data.packed4 |= (uint32_t)probeScrollClear[0] << 21;
data.packed4 |= (uint32_t)probeScrollClear[1] << 22;
data.packed4 |= (uint32_t)probeScrollClear[2] << 23;
data.packed4 |= (uint32_t)(probeScrollDirections[0]) << 24;
data.packed4 |= (uint32_t)(probeScrollDirections[1]) << 25;
data.packed4 |= (uint32_t)(probeScrollDirections[2]) << 26;
//data.packed4 |= 5 bits unused

return data;
}
Expand All @@ -160,37 +171,45 @@ DDGIVolumeDescGPU UnpackDDGIVolumeDescGPU(DDGIVolumeDescGPUPacked input)
output.probeDistanceExponent = input.probeDistanceExponent;
output.probeSpacing = input.probeSpacing;

// Probe Counts
output.probeCounts.x = input.packed0 & 0x000000FF;
output.probeCounts.y = (input.packed0 >> 8) & 0x000000FF;
output.probeCounts.z = (input.packed0 >> 16) & 0x000000FF;

// Thresholds
output.probeIrradianceEncodingGamma = input.probeIrradianceEncodingGamma;
output.probeIrradianceThreshold = input.probeIrradianceThreshold;
output.probeBrightnessThreshold = input.probeBrightnessThreshold;
output.probeBackfaceThreshold = input.probeBackfaceThreshold;

output.probeRandomRayBackfaceThreshold = (float)(input.packed1 & 0x0000FFFF) / 65535.f;
output.probeFixedRayBackfaceThreshold = (float)((input.packed1 >> 16) & 0x0000FFFF) / 65535.f;

output.probeMinFrontfaceDistance = input.probeMinFrontfaceDistance;

output.probeNumRays = input.packed1 & 0x0000FFFF;
output.probeNumIrradianceTexels = (input.packed1 >> 16) & 0x000000FF;
output.probeNumDistanceTexels = (input.packed1 >> 24) & 0x000000FF;
output.probeNumRays = input.packed2 & 0x0000FFFF;
output.probeNumIrradianceTexels = (input.packed2 >> 16) & 0x000000FF;
output.probeNumDistanceTexels = (input.packed2 >> 24) & 0x000000FF;

// Probe Scroll Offsets
output.probeScrollOffsets.x = input.packed2 & 0x00007FFF;
if((input.packed2 >> 15) & 0x00000001) output.probeScrollOffsets.x *= -1;
output.probeScrollOffsets.y = (input.packed2 >> 16) & 0x00007FFF;
if((input.packed2 >> 31) & 0x00000001) output.probeScrollOffsets.y *= -1;
output.probeScrollOffsets.z = (input.packed3) & 0x00007FFF;
if ((input.packed3 >> 15) & 0x00000001) output.probeScrollOffsets.z *= -1;
output.probeScrollOffsets.x = input.packed3 & 0x00007FFF;
if((input.packed3 >> 15) & 0x00000001) output.probeScrollOffsets.x *= -1;
output.probeScrollOffsets.y = (input.packed3 >> 16) & 0x00007FFF;
if((input.packed3 >> 31) & 0x00000001) output.probeScrollOffsets.y *= -1;
output.probeScrollOffsets.z = (input.packed4) & 0x00007FFF;
if ((input.packed4 >> 15) & 0x00000001) output.probeScrollOffsets.z *= -1;

// Feature Bits
output.movementType = (input.packed3 >> 16) & 0x00000001;
output.probeRayDataFormat = (uint)((input.packed3 >> 17) & 0x00000001);
output.probeIrradianceFormat = (uint)((input.packed3 >> 18) & 0x00000001);
output.probeRelocationEnabled = (bool)((input.packed3 >> 19) & 0x00000001);
output.probeClassificationEnabled = (bool)((input.packed3 >> 20) & 0x00000001);
output.probeScrollClear[0] = (bool)((input.packed3 >> 21) & 0x00000001);
output.probeScrollClear[1] = (bool)((input.packed3 >> 22) & 0x00000001);
output.probeScrollClear[2] = (bool)((input.packed3 >> 23) & 0x00000001);
output.movementType = (input.packed4 >> 16) & 0x00000001;
output.probeRayDataFormat = (uint)((input.packed4 >> 17) & 0x00000001);
output.probeIrradianceFormat = (uint)((input.packed4 >> 18) & 0x00000001);
output.probeRelocationEnabled = (bool)((input.packed4 >> 19) & 0x00000001);
output.probeClassificationEnabled = (bool)((input.packed4 >> 20) & 0x00000001);
output.probeScrollClear[0] = (bool)((input.packed4 >> 21) & 0x00000001);
output.probeScrollClear[1] = (bool)((input.packed4 >> 22) & 0x00000001);
output.probeScrollClear[2] = (bool)((input.packed4 >> 23) & 0x00000001);
output.probeScrollDirections[0] = (bool)((input.packed4 >> 24) & 0x00000001);
output.probeScrollDirections[1] = (bool)((input.packed4 >> 25) & 0x00000001);
output.probeScrollDirections[2] = (bool)((input.packed4 >> 26) & 0x00000001);

return output;
}
Expand Down
Loading

0 comments on commit ecff095

Please sign in to comment.