NVIDIAGameWorks / RayTracingDenoiser

NVIDIA Ray Tracing Denoiser
Other
494 stars 44 forks source link

[Q] RELAX: "historyLength" in History Clamping #77

Closed k-payl closed 1 month ago

k-payl commented 1 month ago

Hello! I'd like to thank for your coding. It's spectacular, absolutely brilliant, gorgeous way of programming. I'm writing now, 'cause I'm interested in your approach. Could you describe me the meaning of gHistoryLength and gOutHistoryLength buffers in RELAX_HistoryClamping.hlsli? This question appeared from the point, that we read historyLength: https://github.com/NVIDIAGameWorks/RayTracingDenoiser/blob/1ebb3ce6b5e00c2ee6c5f9597858830aca306262/Shaders/Include/RELAX_HistoryClamping.hlsli#L56-L57 We always do nothing with historyLength. And at the end we write historyLength: https://github.com/NVIDIAGameWorks/RayTracingDenoiser/blob/1ebb3ce6b5e00c2ee6c5f9597858830aca306262/Shaders/Include/RELAX_HistoryClamping.hlsli#L328 Thus, aren't these buffers redundand? 'cause it's seems so for me. And I can't understand your idea properly. Shouldn't we somehow modify historyLength before writing? Wish you the best results in your coding. Thanks in advance!

dzhdanNV commented 1 month ago

historyLength is used in the shader logic, plus, it is copied to another texture. We copy from Transient::HISTORY_LENGTH to Permanent::HISTORY_LENGTH_PREV. The latter is needed to be used in the next frame to compute Transient::HISTORY_LENGTH. It's state propagation.

k-payl commented 1 month ago

I see thanks