Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gamma correction, quadratic light falloff, and randomness improvements. #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonathanolson
Copy link

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:
webgl-path-tracing-randomness

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.

Adding gamma correction so that samples are blended linearly and then displayed for more accurate colors (adjusted colors to match current behavior). Added quadratic light falloff for realism (a light next to a colored wall will now correctly light the area more with that color). Improved random sampling to minimize banding behavior and prevent artifacts from rendering after it's been left open for a few days.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant