Viewing 3 reply threads
  • Author
    Posts
    • #5003 Score: 0
      Bear
      Participant
      -11 pt

      结果如下图

      我原以为是三角形相交测试返回值必须有相交点的 Normal,但实际上 Normal 最后也会被赋值为该相交点所在三角形的 Normal 所以应该不是这个问题。。。不知道这是相交有问题还是着色有问题。。。

      • This topic was modified 4 years, 7 months ago by Bear.
      Attachments:
      You must be logged in to view attached files.
    • #5006 Score: 0
      Bear
      Participant
      -11 pt

      好吧,踩坑发现框架的三角形相交代码有问题,全部重写就好了(之前我看着有就没改)。。。

    • #5007 Score: 0
      cmc233
      Participant
      6 pts

      三角形相交代码是指Triangle.hpp里的rayTriangleIntersect()?我没改得到了正确的着色orz,不过我倒是把main里的scene.buildBVH()改了

    • #5008 Score: 0
      陆游
      Participant
      1 pt

      我也得到了同样的错误图片,具体是框架的哪里出的问题呢?

      • #5009 Score: 1
        陆游
        Participant
        1 pt

        额我在框架下面加上if(t_tmp<0)return inter;就正常了

        This post has received 1 vote up.
        • #5013 Score: 1
          cmc233
          Participant
          6 pts

          发现自己理解错了,scene.buildBVH()不用改orz,不过我没在框架加if(t_tmp<0)return inter也得到了正常图片,但我发现实现包围盒求交(Bounds3::IntersectP)的时候,如果不加判断t_exit>0就会得到黑黑的结果

          This post has received 1 vote up.
        • #5014 Score: 1
          cmc233
          Participant
          6 pts

          ps,在包围盒那步判断比在Triangle::getIntersection里判断,渲染时间更短

          This post has received 1 vote up.
Viewing 3 reply threads
  • You must be logged in to reply to this topic.