A special type of texture node which represents the data of the current viewport
as a texture. The module extracts data from the current bound framebuffer with
a copy operation so no extra render pass is required to produce the texture data
(which is good for performance). ViewportTextureNode can be used as an input for a
variety of effects like refractive or transmissive materials.
Constructor
new ViewportTextureNode(uvNode?, levelNode?, framebufferTexture?)| Parameter | Type | Default Value |
|---|---|---|
| uvNode? | Node | screenUV |
| levelNode? | null | Node | null |
| framebufferTexture? | any | null |
Constructs a new viewport texture node.
| Accessor | Type | |
|---|---|---|
| get type | string | |
Properties
| Property | Type | Default Value | |
|---|---|---|---|
| generateMipmaps | boolean | — | |
| defaultFramebuffer | FramebufferTexture | — | |
| isOutputTextureNode | boolean | — | |
| _cacheTextures | WeakMap<RenderTarget, FramebufferTexture> | — | |
| Method | Type | |
|---|---|---|
| getTextureForReference | (reference?: any) => Texture | |
| updateReference | (frame: any) => Texture | |
| updateBefore | (frame: any) => void | |
| clone | () => any | |
Extends
TextureNodeTSL function for creating a viewport texture node.
| Parameter | Type | Default Value |
|---|---|---|
| uvNode? | Node | — |
| levelNode? | Node | — |
| framebufferTexture? | Texture | — |
Returns
ViewportTextureNodeTSL function for creating a viewport texture node with enabled mipmap generation.
| Parameter | Type | Default Value |
|---|---|---|
| uvNode? | Node | — |
| levelNode? | Node | — |
| framebufferTexture? | Texture | — |
Returns
ViewportTextureNodeTSL function for creating a viewport texture node with enabled mipmap generation. The texture should only contain the opaque rendering objects.
This should be used just in transparent or transmissive materials.
| Parameter | Type | Default Value |
|---|---|---|
| uv? | null | Node | screenUV |
| level? | null | Node | null |
Returns
ViewportTextureNode