在看书时看到这样一句话: In a naive implementation, the shadow ray will check for t ∈ [0,∞), but because of numerical imprecision, this can result in an intersection with the surface on which p lies. Instead, the usual adjustment to avoid that problem is to test for t ∈ [e,∞) where e is some small positive constant (Figure 4.18).
意思是如果不加t>=e则再从物体的表面射出的光线还是会和物体相交,感觉很有道理,但是实际的代码不加这样的检查也能得到正确的结果(试了起点p沿dir方向偏移一点点,但和不偏移结果差不多).
所以怎么保证从物体表面射出光线不会和物体相交呢
Attachments:
You must be
logged in to view attached files.