You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, the refractive index transitions from $\eta_i$ to $\eta_t$.
In the implementation, the variable ri represents etai_over_etat, or $\eta_i / \eta_t$. Given this, the function should ideally be called as reflectance(cos_theta, 1 / ri) rather than reflectance(cos_theta, ri). However, because of the squared term in the formula:
the original implementation reflectance(cos_theta, ri) also produces the correct result.
That said, this implementation might be confusing for beginners (I must admit, I initially misinterpreted it myself XD). Since the book does not explicitly include the Fresnel reflection equation or Schlick’s approximation, it would be helpful to provide a brief introduction beforehand. Alternatively, the implementation could be made clearer by explicitly passing both refractive indices, like this:
Also, I think it would be more helpful to briefly introduce the formulas for Fresnel reflection coefficients $R_s$ and $R_p$, and then explain that $R_0$ is an approximation taken at normal incidence.
The text was updated successfully, but these errors were encountered:
The issue is related to the reflectance function in the dielectric class (material.h, line 86).
Schlick’s approximation for Fresnel reflection is given by:
where:
Here, the refractive index transitions from$\eta_i$ to $\eta_t$ .
In the implementation, the variable$\eta_i / \eta_t$ . Given this, the function should ideally be called as
ri
representsetai_over_etat
, orreflectance(cos_theta, 1 / ri)
rather thanreflectance(cos_theta, ri)
. However, because of the squared term in the formula:the original implementation
reflectance(cos_theta, ri)
also produces the correct result.That said, this implementation might be confusing for beginners (I must admit, I initially misinterpreted it myself XD). Since the book does not explicitly include the Fresnel reflection equation or Schlick’s approximation, it would be helpful to provide a brief introduction beforehand. Alternatively, the implementation could be made clearer by explicitly passing both refractive indices, like this:
Also, I think it would be more helpful to briefly introduce the formulas for Fresnel reflection coefficients$R_s$ and $R_p$ , and then explain that $R_0$ is an approximation taken at normal incidence.
The text was updated successfully, but these errors were encountered: