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

NormalBufferPlugin.md 1.1KB

123456789101112131415161718192021222324252627282930313233343536
  1. ---
  2. prev:
  3. text: 'DepthBufferPlugin'
  4. link: './DepthBufferPlugin'
  5. next:
  6. text: 'GBufferPlugin'
  7. link: './GBufferPlugin'
  8. ---
  9. # NormalBufferPlugin
  10. [//]: # (todo: image)
  11. [Example](https://threepipe.org/examples/#normal-buffer-plugin/) —
  12. [Source Code](https://github.com/repalash/threepipe/blob/master/src/plugins/pipeline/NormalBufferPlugin.ts) —
  13. [API Reference](https://threepipe.org/docs/classes/NormalBufferPlugin.html)
  14. Normal Buffer Plugin adds a pre-render pass to the render manager and renders a normal buffer to a target. The render target can be accessed by other plugins throughout the rendering pipeline to create effects like SSAO, SSR, etc.
  15. ::: info NOTE
  16. Use [`GBufferPlugin`](./GBufferPlugin) if using both `DepthBufferPlugin` and `NormalBufferPlugin` to render both depth and normal buffers in a single pass.
  17. :::
  18. ```typescript
  19. import {ThreeViewer, NormalBufferPlugin} from 'threepipe'
  20. const viewer = new ThreeViewer({...})
  21. const normalPlugin = viewer.addPluginSync(new NormalBufferPlugin())
  22. const normalTarget = normalPlugin.target;
  23. // Use the normal target by accessing `normalTarget.texture`.
  24. ```