File size: 529 Bytes
8194362
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import Pass from './Pass'

export default class RenderPass extends Pass {

  constructor (scene, camera) {
    super()

    this.scene = scene
    this.camera = camera
  }

  render (renderer, writeBuffer, readBuffer) {
    const oldAutoClear = renderer.autoClear
    renderer.autoClear = false

    this.scene.overrideMaterial = this.overrideMaterial
    renderer.render(this.scene, this.camera, this.renderToScreen ? null : readBuffer, true)

    this.scene.overrideMaterial = null
    renderer.autoClear = oldAutoClear
  }

}