Skip to content

Book 1, chapter 9.6; metal fuzzy reflection #1070

Closed
@VxDxK

Description

@VxDxK
class metal : public material {
    public:
        metal(const color& a, double f) : albedo(a), fuzz(f < 1 ? f : 1) {}

        virtual bool scatter(
            const ray& r_in, const hit_record& rec, color& attenuation, ray& scattered) const override {
            ...
        }

    public:
        color albedo;
        double fuzz;
};

Why we can create metal with negative fuzz? I think we need something like that:
metal(const color& a, double f) : albedo(a), fuzz(abs(f) < 1 ? abs(f) : 1) {}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions