Idea: Convergence Forecast Priority Sampling

Discussion related to the LuxCore functionality, implementations and API.
Post Reply
User avatar
FarbigeWelt
Donor
Donor
Posts: 1046
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Idea: Convergence Forecast Priority Sampling

Post by FarbigeWelt »

Convergence Forecast Priority Sampling
Given
Fast quality pseudo random number generator (PRNG) like e.g. xoshiro256**
Simple random sampler
Searched
Noise level optimized render
Idea
Render a low resolution image, e.g. 256*144 pixels (16:9)
Evaluate convergence of all 16*16 pixels areas after 16, 32, 64, 128 and 256 number of samples
Evaluate noise reduction trend of all areas.
Estimate min number of samples to fall below noise threshold in all areas and report the value.
Generate a probability map (values 0.0000 to 0.9999) based on each trend (probability to reach noise threshold after n samples, e.g. n=128, 256, 512, 1024, ...)
Generate a path start map with density meeting probability map (means the higher probability the more pseudo random number based start conditions)
Put path start map on stack sequentially, layer by layer (descending, means layer with less entries first; last element put on stack will be get from stack first).
Start full resolution rendering with values from stack (each token stack element reduces stack by one element).
After stack is emptied get first convergence of multiple same size areas depending on image and probability map resolution.
Refine probability map, areas below noise threshold get probability 0.0, the map is normalized to get values between 0.0000 and 0.9999.
Fill stack with next series of probability based path start conditions.
Repeat steps until all areas fell below noise threshold.

This convergence forecast priority sampling can be performed from camera and any light source.
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
MacBook Air with M1
User avatar
FarbigeWelt
Donor
Donor
Posts: 1046
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

Second part of Convergence Forecast Priority Sampling

Post by FarbigeWelt »

Given
Light path tracker
Unbiased fast pseudo random number generator PRG
Convergence test (for noise level)
Searched
Improved path tracking efficiency
Background
Light sources emit many rays never reaching the camera (eye). Some light sources emit parallel rays only like lasers or simplified very distant very large lights. What were if lights emitted rays mostly hit camera?

Idea
(Note, provided is reading of first part of Convergence Forecast Priority Sampling CFPS.)
Like described in CFPS, rendering is performed with a lower resolution but this time each start condition (position, direction) is stored and combined with probability of hitting result image as hight at vectors start position.
With the number of pre-render sample count reached, heights can be used to draw a 3D surface from height end to height end, interpolating with a certain resolution using 3 to 5 height end positions for surface shaping. Interpolated heights are second generation.
The difficult step comes with the question: What is the vector from interpolated height surface point?

Probably different approaches are reasonable and their quality have to be evaluated in experiments.

A first approach might be:
To select a point on the height surface and to select its closest first generation neighbors.
With each related vector (with its start at neighbor height’s start) an average direction can be calculated weighted by the distance from height end to neighbor height end.
A straight of this direction intersects through height start with all vectors’ start plane (containing all source positions of rays which hit the result image).
Finally these calculations lead to a second generation vector with the data start position, direction and height (as probability).

For final image rendering, positions on height surface, starting from max height, are randomly picked (number of positions increasing with height of picking level), their vector calculated and put on an inverse stack (first put, first get).

This procedure is intended to be repeated until convergence of result image is below a certain noise level or max sample count is reached.

First iteration includes all first generation height positions.
Level means one of many cuboids of a certain height in a way level‘s top height equals one or less and its bottom equals 0 or more.
If these cuboids were stacked they would not overlap but touch.
Randomly picked position means pick a position with x,y randomly generated and selected position if its height end is in the level (cuboid) and if not then next position is randomly generated and tested.
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
MacBook Air with M1
Post Reply