Skip to content

Book 1.10.6: Dark edge around hittables with Metal material #1285

@0xCache

Description

@0xCache

Hi, I'm following the first book's guide and noticed some parts around the fuzzy metal hittable sphere are darker than the center. I suspected it's because when the reflected vector is closer to the surface, where dot(hit.normal, reflected) is closer to 0, a random unit vector multiplied by a big fuzz will make the final scattered ray point inside the sphere. I added a dot check, multiplied the fuzz vector by the dot product, and solved the problem.
Before:
image
After:
image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions