Gorilla.Controller.Passes.FXAA

Overview

This unit implements Fast Approximate Anti-Aliasing (FXAA) for the Gorilla3D rendering pipeline. FXAA is a post-processing technique that smooths jagged edges by detecting and blending high-contrast boundaries using luminance analysis.

Architecture

FXAA operates as a post-pass using RectToFBO rendering with blending disabled. It runs in a single iteration and is marked as an internal render pass (IsInternalRenderPass = True), meaning it is typically managed automatically by the deferred composite system.

Core Classes

TGorillaRenderPassFXAA

Inherits from: TGorillaRenderPassController

Public Methods

Method Signature Description
Create constructor Create(AOwner: TComponent) Creates the FXAA pass and compiles the FXAA shader.
Destroy destructor Destroy() Cleans up resources.
SetCompositeInputTexture Method Assigns the input texture from the composite pass to be anti-aliased.
GetFinalOutputTexture Function Returns the resulting anti-aliased texture for use by subsequent passes or final display.

Runtime Setup

uses
  Gorilla.Controller.Passes.FXAA;

var
  LFXAAPass: TGorillaRenderPassFXAA;
begin
  LFXAAPass := TGorillaRenderPassFXAA.Create(nil);
  LFXAAPass.Viewport := GorillaViewport1;
  LFXAAPass.Enabled := True;
end;

Technical Details

  • Pass type: Post-pass (TRenderPassType.Post)
  • Render method: RectToFBO (full-screen quad)
  • Blending: Disabled during FXAA rendering
  • Iterations: 1
  • FXAA detects edges based on luminance contrast between neighboring pixels. Where contrast exceeds a threshold, the shader blends the pixel with its neighbors along the detected edge direction.
  • This pass is typically activated automatically when using the deferred rendering pipeline. Manual creation is rarely needed.