Capítulo 478 de 859

Chapter 478: SSAAPassNode

Core Idea

A special render pass node that renders the scene with SSAA (Supersampling Anti-Aliasing). This manual SSAA approach re-renders the scene ones for each sample with camera jitter and accumulates the results.

This node produces a high-quality anti-aliased output but is also extremely expensive because of its brute-force approach of re-rendering the entire scene multiple times.

Reference: https://en.wikipedia.org/wiki/Supersampling

Key Concepts

  • isSSAAPassNode : boolean (readonly): This flag can be used for type testing.
  • sampleLevel : number: The sample level specified as n, where the number of samples is 2^n, so sampleLevel = 4, is 2^4 samples, 16.
  • sampleWeight : UniformNode.<float>: A uniform node representing the sample weight.
  • unbiased : boolean: Whether rounding errors should be mitigated or not.

Code Examples

import { ssaaPass } from 'three/addons/tsl/display/SSAAPassNode.js';
  • What it demonstrates: Typical usage of SSAAPassNode.

Reference Tables

Constructor

Signature
new SSAAPassNode( scene : Scene, camera : Camera )

Properties

PropertyDescription
.isSSAAPassNode : boolean (readonly)This flag can be used for type testing.
.sampleLevel : numberThe sample level specified as n, where the number of samples is 2^n, so sampleLevel = 4, is 2^4 samples, 16.
.sampleWeight : UniformNode.<float>A uniform node representing the sample weight.
.unbiased : booleanWhether rounding errors should be mitigated or not.

Methods

MethodDescription
.dispose()Frees internal resources. This method should be called when the pass is no longer required.
.setup( builder : NodeBuilder ) : PassTextureNodeThis method is used to setup the effect's MRT configuration and quad mesh.
.updateBefore( frame : NodeFrame )This method is used to render the SSAA effect once per frame.

Key Takeaways

  1. SSAAPassNode extends: EventDispatcher → Node → TempNode → PassNode
  2. Most relevant properties: isSSAAPassNode, sampleLevel, sampleWeight, unbiased.
  3. Key methods: dispose, setup, updateBefore.

Connects To