User:Jbakker/projects/CyclesOpenCL2019/ProRender

Render loop
ProRender has an Adaptive renderer and a Monte carlo based renderer. We focus on the Monte Carlo based renderer.


 * 1) for each tile
 * 2) generate tile domain (`GenerateTileDomain`; updates a list of indices (every output pixels gets a number), this index is used to reduce the work-group/item lookup in other kernels)
 * 3) generate prim rays; Based on the type of camera the primary rays are generated. Every type of camera has its own Kernel (`PerspectiveCamera_GeneratePaths`, `PerspectiveCameraDof_GeneratePaths`, `OrthographicCamera_GeneratePaths`)
 * 4) estimate
 * 5) InitPathData `InitPathData`
 * 6) for each pass
 * 7) Clear ray hit buffer
 * 8) Query intersection: provided by RadeonRays
 * 9) Sample volume `SampleVolume`; Applies volume effects (absorbtion, emission) and scattering, also happens for missed rays.
 * 10) Shade miss (environment) `ShadeMiss` Illuminate missing rays
 * 11) Filter path stream `FilterPathStream`; convert intersections to predicates (Kill, Alive)
 * 12) Gather Opacity (optional) `GatherOpacity`; Gather opacity information and store it in opacity buffer
 * 13) Compact batch: provided by RadeonRays
 * 14) Advance indices to keep pixel indices up to date `RestorePixelIndices`;
 * 15) Shade miss primary ray (background) `ShadeBackgroundEnvMap`; Illuminate missing rays
 * 16) Shade volume `ShadeVolumeUberV2`; It applies direct illumination and generates (only scattered paths)
 * 17) Shade surface `ShadeSurfaceUberV2`; Handle ray-surface interaction possibly generating path continuation
 * 18) for each transmission step
 * 19) QueryIntersection
 * 20) Apply volume transmission `ApplyVolumeTransmissionUberV2`; Handle light samples and visibility info and add contribution to final buffer
 * 21) Query occlusion (shadow rays): provided by RadeonRays
 * 22) Gather light samples `GatherLightSamples`; Handle light samples and visibility info and add contribution to final buffer
 * 23) Gather visibility (optional) `GatherVisibility`; Handle light samples and visibility info and add contribution to final buffer
 * 24) Gather opacity `GatherOpacity`; Gather opacity information and store it in opacity buffer
 * 25) Fill AOV's `GenerateTileDomain`, `GeneratePrimaryRays`, `FillAOVsUberV2`

Note: Source code of shaders is generated from the materials. Data of the shaders are passed along. So perhaps only a recompilation if the material is restructured?