Home Forums GAMES在线课程(现代计算机图形学入门)讨论区 当光栅化分辨率提高时三角形出现了奇怪的竖条纹

Viewing 3 reply threads
  • Author
    Posts
    • #4715 Score: 0
      jamlke
      Participant

      初始分辨率为 700*700,提高光栅化窗口分辨率 *2(1400*1400) *4(2800*2800)时输出正常渲染三角形
      但当分辨率提高到 *8(5600*5600)时蓝色三角形右下出现了异样的竖条纹,希望老师和同学们能解答疑惑。

      Attachments:
      You must be logged in to view attached files.
    • #4717 Score: 0
      jamlke
      Participant

      放大看能看到右下是由竖条纹组成

    • #4718 Score: 0
      jamlke
      Participant

      细节如图

      Attachments:
      You must be logged in to view attached files.
    • #4720 Score: 1
      nightwatch
      Participant
      3 pts

      像素增加到一定阈值以后开始出现问题,下面的格子出现了跳格子着色的问题,猜测是浮点数导致的。稍微debug了一下
      框架里的set_pixel传入的是浮点数point
      void rst::rasterizer::set_pixel(const Eigen::Vector3f& point, const Eigen::Vector3f& color)
      {
      auto ind = (height-1-point.y())*width + point.x();
      frame_buf[ind] = color;
      }
      第二行改成
      auto ind = (height-1-int(point.y()))*width + int(point.x());
      就可以了

      This post has received 1 vote up.
      • #4779 Score: 0
        jamlke
        Participant

        感谢,问题解决了,但我还是没能想明白,为何只有右下角那部分出现了问题,如果是随机出现这种状况的话倒是可以理解

Viewing 3 reply threads
  • You must be logged in to reply to this topic.