threepipe
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

GBufferPlugin.md 1.0KB

1234567891011121314151617181920212223242526272829303132
  1. ---
  2. prev:
  3. text: 'NormalBufferPlugin'
  4. link: './NormalBufferPlugin'
  5. next:
  6. text: 'SSAOPlugin'
  7. link: './SSAOPlugin'
  8. ---
  9. # GBufferPlugin
  10. [//]: # (todo: image)
  11. [Example](https://threepipe.org/examples/#gbuffer-plugin/) —
  12. [Source Code](https://github.com/repalash/threepipe/blob/master/src/plugins/pipeline/GBufferPlugin.ts) —
  13. [API Reference](https://threepipe.org/docs/classes/GBufferPlugin.html)
  14. GBuffer Plugin adds a pre-render pass to the render manager and renders depth+normals to a target and some customizable flags to another. The multiple render target and textures can be accessed by other plugins throughout the rendering pipeline to create effects like SSAO, SSR, etc.
  15. ```typescript
  16. import {ThreeViewer, GBufferPlugin} from 'threepipe'
  17. const viewer = new ThreeViewer({...})
  18. const gBufferPlugin = viewer.addPluginSync(new GBufferPlugin())
  19. const gBuffer = gBufferPlugin.target;
  20. const normalDepth = gBufferPlugin.normalDepthTexture;
  21. const gBufferFlags = gBufferPlugin.flagsTexture;
  22. ```