Home Forums Games202-高质量实时渲染 vPositionFromLight.z 恒为 0

Viewing 3 reply threads
  • Author
    Posts
    • #8094 Score: 0
      wangshengyang
      Participant
      -2 pt

      实现硬阴影失败,完全没有阴影。发现 vPositionFromLight.z 恒为0,因为把它当作 gl_FragColor 的 r 通道输出,屏幕是黑的。

      不知道怎么回事。
      附上我的mvp矩阵

      Attachments:
      You must be logged in to view attached files.
    • #8096 Score: 0
      wangshengyang
      Participant
      -2 pt

      发现不是0,是负值

    • #8099 Score: 0
      wangshengyang
      Participant
      -2 pt

      原因:z坐标忘了转到0到1

    • #8103 Score: -1
      青麈
      Participant
      -2 pt

      let left = -100
      let right = 100
      let bottom = -60
      let top = 100
      let near = -420
      let far = -40
      正交矩阵的参数,仅供参考。
      调了半天、、、

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