threepipe
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

DepthBufferPlugin.md 1.2KB

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.