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

Lighting Oversaturation Problem #93

Closed
pkudva opened this issue Mar 18, 2019 · 4 comments
Closed

Lighting Oversaturation Problem #93

pkudva opened this issue Mar 18, 2019 · 4 comments

Comments

@pkudva
Copy link

pkudva commented Mar 18, 2019

After working on the Cornell box, I noticed some trouble with the lighting, especially when I had a large light, which in the book said would help with the noise. I replaced one of the boxes with a glass sphere and noticed the obvious problem with the light of my image. Even with 1000 secondary rays, it didn't fix it.

HQ_with_light_artifact

I eventually figured out that there needed to be a value cap on the colors, so it wouldn't oversaturate. This might have been covered in the next book "Ray Tracing the Rest of Your Life", but with the final image of this book having a glass sphere and a very bright light, I figured it might be useful to mention it.
Here's my final image with that color cap:
HQ_final_product

@pnadon
Copy link

pnadon commented Jun 23, 2019

After working on the Cornell box, I noticed some trouble with the lighting, especially when I had a large light, which in the book said would help with the noise. I replaced one of the boxes with a glass sphere and noticed the obvious problem with the light of my image. Even with 1000 secondary rays, it didn't fix it.

HQ_with_light_artifact

I eventually figured out that there needed to be a value cap on the colors, so it wouldn't oversaturate. This might have been covered in the next book "Ray Tracing the Rest of Your Life", but with the final image of this book having a glass sphere and a very bright light, I figured it might be useful to mention it.
Here's my final image with that color cap:
HQ_final_product

Would you mind sharing the changes you made in your code? I am running into the same issue, and would greatly appreciate the help!

@pnadon
Copy link

pnadon commented Jun 23, 2019

fixed it, here is my change:

in main.cc, change the last line from std::cout << ir << " " .... to std::cout << ir > 255 ? 255 : ir << ...

@hollasch hollasch transferred this issue from RayTracing/TheNextWeek Aug 30, 2019
@hollasch hollasch added this to the post-v2 milestone Aug 30, 2019
@hollasch hollasch mentioned this issue Aug 30, 2019
@hollasch
Copy link
Collaborator

See pull request RayTracing/TheRestOfYourLife#5

This isn't the solution, but contains valuable information. I have a solution sketched out in the original book repo, and will resurface it here after the v2 release to web.

@hollasch hollasch self-assigned this Aug 30, 2019
hollasch added a commit that referenced this issue Oct 21, 2019
There are still many places in the code where we're using `vec3` for
color data, but this change fixes the lighting oversaturation problem,
and also replaces colors with NaN components with a signalling color
(pure cyan).

Resolves #93
@hollasch hollasch mentioned this issue Oct 21, 2019
hollasch added a commit that referenced this issue Oct 21, 2019
There are still many places in the code where we're using `vec3` for
color data, but this change fixes the lighting oversaturation problem,
and also replaces colors with NaN components with a signalling color
(pure cyan).

Resolves #93
@hollasch
Copy link
Collaborator

hollasch commented Oct 21, 2019

Resolved in #226, changes in development branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants