ebruneton / precomputed_atmospheric_scattering

This project provides a new implementation of our EGSR 2008 paper "Precomputed Atmospheric Scattering".
BSD 3-Clause "New" or "Revised" License
908 stars 120 forks source link

Names of a few variables seem wrong #29

Closed 10110111 closed 5 years ago

10110111 commented 5 years ago

I'm studying the implementation of GetSkyRadiance function, and I'm having some difficulties understanding why the variables r_p and m_p (and m_s_p then too) are named with the _p in them here:

    Length r_p =
        ClampRadius(atmosphere, sqrt(d * d + 2.0 * r * mu * d + r * r));
    Number mu_p = (r * mu + d) / r_p;
    Number mu_s_p = (r * mu_s + d * nu) / r_p;

It seems in the documentation first two of these variables are called rd and μd, since they refer not the the point p, but instead to q (which is at the distance d from p).

Is this intentional? If yes, could you please explain why I'm wrong?

ebruneton commented 5 years ago

No, this is probably a copy paste effect. I agree that _d would be better here, because these variables are related to the point at distance d = shadow_length from the camera.

10110111 commented 5 years ago

OK, thanks.