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?