raytracing.github.io icon indicating copy to clipboard operation
raytracing.github.io copied to clipboard

Book 3.5.3 and later: Are the subscripts $i$ and $o$ used inconsistently?

Open Xlucidator opened this issue 5 months ago • 0 comments

Image


In the current context, $\textrm{Color}_i$ represents the result traced from the light side via ray_color(scattered, ...) , meaning the subscript $i$ denotes the incoming direction toward the surface from the light. This usage is consistent with the standard convention in ray tracing.

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

However, from the context and code, it seems that $\theta_o$ actually represents the cosine between the surface normal and the scattered ray pointing toward the light. This implies that the subscript $o$ corresponds to the same light-side direction as $i$ in $\textrm{Color}_i$, which can be quite confusing.

Am I understanding this correctly? Should the notation be revised for clarity?

Xlucidator avatar Aug 17 '25 13:08 Xlucidator