Files
filament/web/filament-js/extensions_generated.js
Mathias Agopian 85ebd67a28 feat(taa): Overhaul TAA implementation for improved quality and upscaling (#9573)
This commit introduces a significant rework of the Temporal Anti-Aliasing (TAA) system, focusing on improving reconstruction quality, robustness, and introducing flexible upscaling.

Core TAA Algorithm improvements:
- Replaced the Catmull-Rom filter with a more efficient 5-tap Lanczos filter for history sampling, which includes deringing to reduce artifacts.
- The input color buffer is now properly "unjittered" using a Lanczos reconstruction filter.
- Improved the history rejection algorithm by skipping the expensive accurate clipping when the history sample is already within the neighborhood's color gamut.
- Added a new `hdr` option to properly handle HDR content by tonemapping colors before blending and untonemapping the result.
- Removed the ineffective `VARIANCE` only history rejection method.
- Added protection against negative numbers in `sqrt()` for increased stability.

TAA Upscaling:
- Replaced the boolean `upscaling` flag with a float factor, allowing for variable upscaling ratios (e.g., 1.5x, 2x).
- Upscaling now correctly adjusts viewport and projection settings.
- The TAA shader now receives viewport and resolution information to correctly handle upscaled rendering.

API and Configuration Changes:
- Deprecated the `filterWidth` TAA option as it no longer has an effect.
- Introduced the `upscaling` float property to `TemporalAntiAliasingOptions`.
- Added the `hdr` boolean property to `TemporalAntiAliasingOptions`.

Other Changes:
- Updated UI elements in the viewer and material sandbox to reflect the new TAA options.
- Updated Javascript bindings and TypeScript definitions for the new TAA settings.
- Refactored shader code for clarity and performance.
2026-01-07 15:25:38 -08:00

221 lines
7.2 KiB
JavaScript

// This file has been generated by beamsplitter
Filament.loadGeneratedExtensions = function() {
Filament.View.prototype.setDynamicResolutionOptionsDefaults = function(overrides) {
const options = {
minScale: [0.5, 0.5],
maxScale: [1.0, 1.0],
sharpness: 0.9,
enabled: false,
homogeneousScaling: false,
quality: Filament.View$QualityLevel.LOW,
};
return Object.assign(options, overrides);
};
Filament.View.prototype.setBloomOptionsDefaults = function(overrides) {
const options = {
// JavaScript binding for dirt is not yet supported, must use default value.
// JavaScript binding for dirtStrength is not yet supported, must use default value.
strength: 0.10,
resolution: 384,
levels: 6,
blendMode: Filament.View$BloomOptions$BlendMode.ADD,
threshold: true,
enabled: false,
highlight: 1000.0,
quality: Filament.View$QualityLevel.LOW,
lensFlare: false,
starburst: true,
chromaticAberration: 0.005,
ghostCount: 4,
ghostSpacing: 0.6,
ghostThreshold: 10.0,
haloThickness: 0.1,
haloRadius: 0.4,
haloThreshold: 10.0,
};
return Object.assign(options, overrides);
};
Filament.View.prototype.setFogOptionsDefaults = function(overrides) {
const options = {
distance: 0.0,
cutOffDistance: Infinity,
maximumOpacity: 1.0,
height: 0.0,
heightFalloff: 1.0,
color: [ 1.0, 1.0, 1.0 ],
density: 0.1,
inScatteringStart: 0.0,
inScatteringSize: -1.0,
fogColorFromIbl: false,
// JavaScript binding for skyColor is not yet supported, must use default value.
enabled: false,
};
return Object.assign(options, overrides);
};
Filament.View.prototype.setDepthOfFieldOptionsDefaults = function(overrides) {
const options = {
cocScale: 1.0,
cocAspectRatio: 1.0,
maxApertureDiameter: 0.01,
enabled: false,
filter: Filament.View$DepthOfFieldOptions$Filter.MEDIAN,
nativeResolution: false,
foregroundRingCount: 0,
backgroundRingCount: 0,
fastGatherRingCount: 0,
maxForegroundCOC: 0,
maxBackgroundCOC: 0,
};
return Object.assign(options, overrides);
};
Filament.View.prototype.setVignetteOptionsDefaults = function(overrides) {
const options = {
midPoint: 0.5,
roundness: 0.5,
feather: 0.5,
color: [0.0, 0.0, 0.0, 1.0],
enabled: false,
};
return Object.assign(options, overrides);
};
Filament.View.prototype.setRenderQualityDefaults = function(overrides) {
const options = {
hdrColorBuffer: Filament.View$QualityLevel.HIGH,
};
return Object.assign(options, overrides);
};
Filament.View.prototype.setSsctDefaults = function(overrides) {
const options = {
lightConeRad: 1.0,
shadowDistance: 0.3,
contactDistanceMax: 1.0,
intensity: 0.8,
lightDirection: [ 0, -1, 0 ],
depthBias: 0.01,
depthSlopeBias: 0.01,
sampleCount: 4,
rayCount: 1,
enabled: false,
};
return Object.assign(options, overrides);
};
Filament.View.prototype.setGtaoDefaults = function(overrides) {
const options = {
sampleSliceCount: 4,
sampleStepsPerSlice: 3,
thicknessHeuristic: 0.004,
useVisibilityBitmasks: false,
constThickness: 0.5,
linearThickness: false,
};
return Object.assign(options, overrides);
};
Filament.View.prototype.setAmbientOcclusionOptionsDefaults = function(overrides) {
const options = {
aoType: Filament.View$AmbientOcclusionOptions$AmbientOcclusionType.SAO,
radius: 0.3,
power: 1.0,
bias: 0.0005,
resolution: 0.5,
intensity: 1.0,
bilateralThreshold: 0.05,
quality: Filament.View$QualityLevel.LOW,
lowPassFilter: Filament.View$QualityLevel.MEDIUM,
upsampling: Filament.View$QualityLevel.LOW,
enabled: false,
bentNormals: false,
minHorizonAngleRad: 0.0,
// JavaScript binding for ssct is not yet supported, must use default value.
// JavaScript binding for gtao is not yet supported, must use default value.
};
return Object.assign(options, overrides);
};
Filament.View.prototype.setMultiSampleAntiAliasingOptionsDefaults = function(overrides) {
const options = {
enabled: false,
sampleCount: 4,
customResolve: false,
};
return Object.assign(options, overrides);
};
Filament.View.prototype.setTemporalAntiAliasingOptionsDefaults = function(overrides) {
const options = {
filterWidth: 1.0,
feedback: 0.12,
lodBias: -1.0,
sharpness: 0.0,
enabled: false,
upscaling: 1.0,
filterHistory: true,
filterInput: true,
useYCoCg: false,
hdr: true,
boxType: Filament.View$TemporalAntiAliasingOptions$BoxType.AABB,
boxClipping: Filament.View$TemporalAntiAliasingOptions$BoxClipping.ACCURATE,
jitterPattern: Filament.View$TemporalAntiAliasingOptions$JitterPattern.HALTON_23_X16,
varianceGamma: 1.0,
preventFlickering: false,
historyReprojection: true,
};
return Object.assign(options, overrides);
};
Filament.View.prototype.setScreenSpaceReflectionsOptionsDefaults = function(overrides) {
const options = {
thickness: 0.1,
bias: 0.01,
maxDistance: 3.0,
stride: 2.0,
enabled: false,
};
return Object.assign(options, overrides);
};
Filament.View.prototype.setGuardBandOptionsDefaults = function(overrides) {
const options = {
enabled: false,
};
return Object.assign(options, overrides);
};
Filament.View.prototype.setVsmShadowOptionsDefaults = function(overrides) {
const options = {
anisotropy: 0,
mipmapping: false,
msaaSamples: 1,
highPrecision: false,
minVarianceScale: 0.5,
lightBleedReduction: 0.15,
};
return Object.assign(options, overrides);
};
Filament.View.prototype.setSoftShadowOptionsDefaults = function(overrides) {
const options = {
penumbraScale: 1.0,
penumbraRatioScale: 1.0,
};
return Object.assign(options, overrides);
};
Filament.View.prototype.setStereoscopicOptionsDefaults = function(overrides) {
const options = {
enabled: false,
};
return Object.assign(options, overrides);
};
};