Gamma correction, quadratic light falloff, and randomness improvements. #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
I saw your impressive demo and skimmed the code (I'm working on a 4D raytracing / global illumination personal project using a similar structure) and noticed a few improvements to make the rendered output more realistic. Please ignore this if they were creative liberties to achieve the current rendering!
First thing I noticed was the light falloff (putting the light next to a colored surface didn't impart more of that color to the box), and after that gamma correction was needed so samples could be blended linearly and map approximately to sRGB (I'm ignoring the sRGB details for dark colors that don't follow the power curve).
Additionally, it seemed to have a bit of banding in the noise on my GPU, and after leaving it open for a few days the large timeSinceStart caused rounding issues in the sin-random approximation seen here:
The area around the light generally saturates fairly easily, and the falloff when the light sample box is placed near a surface causes some bounces to have an extremely high contribution to the image creating significant variance and slower convergence in those cases. Putting a ceiling on the contribution of a sample would fix that, but would introduce bias, so I didn't do that.