Skip to content

Incoming ray parameter r_in is not used in any of the scattering_pdf() member functions #975

@TheRayTracer

Description

@TheRayTracer

It seems like the incoming ray is not used in any of the calculations of the scattering_pdf member functions. Although there is no error nor negative side-effects, this parameter could be removed.

double scattering_pdf(
const ray& r_in, const hit_record& rec, const ray& scattered
) const override {
auto cosine = dot(rec.normal, unit_vector(scattered.direction()));
return cosine < 0 ? 0 : cosine/pi;
}

This parameter is in both the current v3 revision and the upcoming v4 revision.

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions