Capítulo 514 de 859

Chapter 514: ViewportTextureNode

Core Idea

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.

Key Concepts

  • defaultFramebuffer : FramebufferTexture: The reference framebuffer texture. This is used to store the framebuffer texture for the current render target. If the render target change…
  • generateMipmaps : boolean: Whether to generate mipmaps or not.
  • isOutputTextureNode : boolean (readonly): This flag can be used for type testing.
  • updateBeforeType : string: The updateBeforeType is set to NodeUpdateType.RENDER since the node should extract the current contents of the bound framebuffer for ea…

Reference Tables

Constructor

Signature
new ViewportTextureNode( uvNode : Node, levelNode : Node, framebufferTexture : Texture )

Properties

PropertyDescription
.defaultFramebuffer : FramebufferTextureThe reference framebuffer texture. This is used to store the framebuffer texture for the current render target. If the render target changes, a new framebuffer texture is created automatically.
.generateMipmaps : booleanWhether to generate mipmaps or not.
.isOutputTextureNode : boolean (readonly)This flag can be used for type testing.
.updateBeforeType : stringThe updateBeforeType is set to NodeUpdateType.RENDER since the node should extract the current contents of the bound framebuffer for each render call.

Methods

MethodDescription
`.getTextureForReference( reference : RenderTargetCanvasTarget ) : Texture`

Key Takeaways

  1. ViewportTextureNode extends: EventDispatcher → Node → InputNode → UniformNode → TextureNode
  2. Most relevant properties: defaultFramebuffer, generateMipmaps, isOutputTextureNode, updateBeforeType.
  3. Key methods: getTextureForReference.

Connects To