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

NormalBufferPlugin.md 1.1KB


prev:

text: 'DepthBufferPlugin'
link: './DepthBufferPlugin'

next:

text: 'GBufferPlugin'
link: './GBufferPlugin'

NormalBufferPlugin

ExampleSource CodeAPI Reference

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.
::: info NOTE Use GBufferPlugin if using both DepthBufferPlugin and NormalBufferPlugin to render both depth and normal buffers in a single pass. :::
import {ThreeViewer, NormalBufferPlugin} from 'threepipe'

const viewer = new ThreeViewer({...})

const normalPlugin = viewer.addPluginSync(new NormalBufferPlugin())

const normalTarget = normalPlugin.target;

// Use the normal target by accessing `normalTarget.texture`.