Home Forums Games202-高质量实时渲染 [作业1] 移动物体阴影叠加解决办法

Tagged: 

Viewing 2 reply threads
  • Author
    Posts
    • #8052 Score: 1
      Dan
      Participant
      2 pts

      在实现移动物体阴影的时候,可能会遇到阴影叠加的情况。这是因为 shadowmap 在每帧渲染的时候并没有被清除,新的深度值会被叠加地写到 shadowmap 上。建议在 WebGLRenderer.js 中的 render 函数内,每一个光源的循环开始处加入如下代码,清除 shadowmap 上的数据:

      
      gl.bindFramebuffer(gl.FRAMEBUFFER, this.lights[l].entity.fbo);
      gl.clear(gl.DEPTH_BUFFER_BIT);
      
      This post has received 1 vote up.
      • This topic was modified 1 year, 11 months ago by Dan.
      Attachments:
      You must be logged in to view attached files.
    • #8084 Score: 0
      Zhixiong Ren
      Participant

      非常感谢!

    • #9232 Score: 0
      coli
      Participant

      js白痴请教下如何让模型移动

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