Split the light list info finite (point, spot, rect) and infinite (skydome, directional) sets. Build a 2d grid of which finite lights overlap particular regions. The grid is aligned to the bounding box of all lights and collapsed along the shortext axis so that memory usage scales quadratically with resolution instead of cubically. The light list per cell is currently pre-allocated up to a maximum count per cell (overflow is simply cut and lights are dropped as they were prior to this change). In most scenes I have tried so far this maximum is never reached with the current defaults of 256^2 resolution and 128 max lights per cluster.
#rb Patrick.Kelly
#preflight 60785d289e2d7a00016e3032
[CL 16022731 by chris kulla in ue5-main branch]
Expose a filter width setting for users to adjust the softness/aliasing tradeoff. Default width of 3.0 maps to stddev=1/2 pixel.
#rb Juan.Canada
[CL 15208847 by chris kulla in ue5-main branch]
This reduces the number of stages involved to just two: one for the actual path tracing and one for display to SceneColor which should help port the code to RDG as well as make it easier to add new buffers required for denoising.
As a side effect of this change, the path tracing samples are accumulated in full floating point which fixes the "washed out" appearrance on scenes with very bright lights that came from the fixed point accumulation required by the adaptive sampling path compaction pass.
#jira UE-89547
#rb Patrick.Kelly
[CL 14672146 by chris kulla in ue5-main branch]
There were a number of issues that resulted in NaNs creeping up to the top level of the hierarchy. This in turn led to the adaptive codepath being consistently disabled. I also fixed the incremental calculation of variance (we want to measure variance of the mean) although it doesn't seem to be possible to compute an exact variance when we have more than one sample per pixel from a single pass (in other words, when adaptive has started focusing on some pixels).
I switched the gaussian blur to a simple max dilation to be a bit more robust to outlier pixels.
Despite the adaptive sampler working fairly well on high error regions, I found it generally slows down rendering significantly, so I opted to disable it by default.
#rb Patrick.Kelly
[CL 14629658 by chris kulla in ue5-main branch]
The random sequence can still be chosen by defining the RANDSEQ pre-processor variable
#rb Patrick.Kelly
[CL 14599869 by chris kulla in ue5-main branch]
#jira UE-76669
#rb patrick.kelly, juan.canada
#ROBOMERGE-SOURCE: CL 7112577 in //UE4/Release-4.23/...
#ROBOMERGE-BOT: RELEASE (Release-4.23 -> Main) (v367-6836689)
[CL 7112578 by juan canada in Main branch]