Commit Graph

11 Commits

Author SHA1 Message Date
chris kulla
a42b669d3c Add light culling for path tracer
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]
2021-04-15 12:22:28 -04:00
chris kulla
bc7de50b75 Remove unused variance tree and ray count code from path tracer
#rb Patrick.Kelly

[CL 15504766 by chris kulla in ue5-main branch]
2021-02-23 15:48:28 -04:00
chris kulla
39780ff76b Replace box filter kernel with a gaussian in the path tracer
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]
2021-01-26 12:51:29 -04:00
chris kulla
9950a4088e Remove Adaptive sampler from path tracer in preparation for porting to RDG
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]
2020-11-05 18:37:37 -04:00
chris kulla
26a39a6c6a Remove dummy variable from RandomSequence_GenerateSample
#rb Patrick.Kelly

[CL 14636613 by chris kulla in ue5-main branch]
2020-11-02 17:25:32 -04:00
chris kulla
8b1dde4d95 Fix adaptive sampling in path tracer
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]
2020-11-02 13:53:09 -04:00
chris kulla
78f7bdd496 Select the random sequence in the path tracer at compile time instead of at runtime
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]
2020-10-28 11:42:12 -04:00
Marc Audy
360d078ca3 Second batch of remaining Engine copyright updates.
#rnx
#rb none

[CL 10871248 by Marc Audy in Main branch]
2019-12-27 09:26:59 -05:00
juan canada
4bd453b951 Cherry-pick 7076124: Integrate with CreatePrimaryRay
#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]
2019-06-20 17:29:04 -04:00
Marcus Wassmer
676f390512 Local copyright updates
#rb none

[CL 4681318 by Marcus Wassmer in Dev-Rendering branch]
2019-01-04 10:13:23 -05:00
Marcus Wassmer
4cc088f35c Copying //UE4/Dev-Rendering-HLR@4669539 to Dev-Rendering (//UE4/Dev-Rendering)
#rb none
#lockdown rolando.caloca

[CL 4669551 by Marcus Wassmer in Dev-Rendering branch]
2018-12-18 21:41:17 -05:00