NVIDIAGameWorks / RTXGI-DDGI

RTX Global Illumination (RTXGI)
https://developer.nvidia.com/rtxgi
Other
689 stars 55 forks source link

farthestFrontfaceDistance usage in ProbeRelocationCS.hlsl #78

Closed TLeonardUK closed 11 months ago

TLeonardUK commented 11 months ago

I notice on line 211 of ProbeRelocationCS.hlsl, you scale farthestFrontfaceDistance but do nothing further with it, the line below also sets the fullOffset to the offset plus the direction unit vector.

        if (dot(closestFrontfaceDirection, farthestFrontfaceDirection) <= 0.f)
        {
            // Ensures the probe never moves through the farthest frontface
            farthestFrontfaceDistance *= min(farthestFrontfaceDistance, 1.f);
            fullOffset = offset + farthestFrontfaceDirection;
        }

Should this not be taking the distance into account when calculating the fullOffset (and presumably the min frontface distance)?

jukim-nv commented 11 months ago

@TLeonardUK I believe you are correct. I probably made a mistake when writing this and meant to scale farthestFrontfaceDirection by the min() result instead.

acmarrs-nvidia commented 11 months ago

I've pushed @jukim-nv's fix to main. It is available here.