ViewportTextureNode

Last modified: Jun 30, 2024

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?)
ParameterTypeDefault Value
uvNode?NodescreenUV
levelNode?null | Nodenull
framebufferTexture?anynull

Constructs a new viewport texture node.

AccessorType

Properties

PropertyTypeDefault Value
generateMipmapsboolean
defaultFramebufferFramebufferTexture
isOutputTextureNodeboolean
_cacheTexturesWeakMap<RenderTarget, FramebufferTexture>
MethodType

Extends

TextureNode

viewportTexture

TSL function for creating a viewport texture node.

ParameterTypeDefault Value
uvNode?Node
levelNode?Node
framebufferTexture?Texture

Returns

ViewportTextureNode

viewportMipTexture

TSL function for creating a viewport texture node with enabled mipmap generation.

ParameterTypeDefault Value
uvNode?Node
levelNode?Node
framebufferTexture?Texture

Returns

ViewportTextureNode

viewportOpaqueMipTexture

TSL 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.

ParameterTypeDefault Value
uv?null | NodescreenUV
level?null | Nodenull

Returns

ViewportTextureNode