Home Forums GAMES在线课程(现代计算机图形学入门)讨论区 关于采样后射出光线的交点问题

Viewing 1 reply thread
  • Author
    Posts
    • #5622 Score: 0
      xxrl
      Participant
      1 pt

      在看书时看到这样一句话: 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.
    • #5629 Score: 0
      禹鹏(助教)
      Keymaster
      9 pts

      你光源的origin沿着direction稍微移动一个微小位置不就可以了。

Viewing 1 reply thread
  • You must be logged in to reply to this topic.