threepipe
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

DepthBufferPlugin.md 1.2KB

před 1 rokem
12345678910111213141516171819202122232425262728293031323334
  1. ---
  2. prev:
  3. text: 'SSAAPlugin'
  4. link: './SSAAPlugin'
  5. next:
  6. text: 'NormalBufferPlugin'
  7. link: './NormalBufferPlugin'
  8. ---
  9. # DepthBufferPlugin
  10. [//]: # (todo: image)
  11. [Example](https://threepipe.org/examples/#depth-buffer-plugin/) —
  12. [Source Code](https://github.com/repalash/threepipe/blob/master/src/plugins/pipeline/DepthBufferPlugin.ts) —
  13. [API Reference](https://threepipe.org/docs/classes/DepthBufferPlugin.html)
  14. Depth Buffer Plugin adds a pre-render pass to the render manager and renders a depth buffer to a target. The render target can be accessed by other plugins throughout the rendering pipeline to create effects like depth of field, SSAO, SSR, etc.
  15. ```typescript
  16. import {ThreeViewer, DepthBufferPlugin} from 'threepipe'
  17. const viewer = new ThreeViewer({...})
  18. const depthPlugin = viewer.addPluginSync(new DepthBufferPlugin(HalfFloatType))
  19. const depthTarget = depthPlugin.target;
  20. // Use the depth target by accesing `depthTarget.texture`.
  21. ```
  22. The depth values are based on camera near far values, which are controlled automatically by the viewer. To manually specify near, far values and limits, it can be set in the camera userData. Check the [example](https://threepipe.org/examples/#depth-buffer-plugin/) for more details.