Home Forums Games202-高质量实时渲染 局部基函数(TBN空间的构建)是如何推导的

Viewing 0 reply threads
  • Author
    Posts
    • #16110 Score: 0
      shuaigougou5545
      Participant
      1 pt
      
      void LocalBasis(vec3 n, out vec3 b1, out vec3 b2) {
        float sign_ = sign(n.z);
        if (n.z == 0.0) {
          sign_ = 1.0;
        }
        float a = -1.0 / (sign_ + n.z);
        float b = n.x * n.y * a;
        b1 = vec3(1.0 + sign_ * n.x * n.x * a, sign_ * b, -sign_ * n.x);
        b2 = vec3(b, sign_ + n.y * n.y * a, -n.y);
      }
      

      这是作业3中的函数,有人知道这个函数是怎么推导的吗?

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