Advanced search tips: use spaces to require multiple terms (AND), | for alternatives (OR), wrap phrases in quotes (="a b"), =term for exact match, 'term to include, !term to exclude, ^term to match prefix, !^term to exclude prefix, .ext$ to match suffix, and !.ext$ to exclude suffix.

taa.wgsl

Constants

DEFAULT_HISTORY_BLEND_RATE

#
const DEFAULT_HISTORY_BLEND_RATE: f32 = 0.1

MIN_HISTORY_BLEND_RATE

#
const MIN_HISTORY_BLEND_RATE: f32 = 0.015

Bindings

view_target

#
@group(0)
@binding(0)
var view_target: texture_2d<f32>

history

#
@group(0)
@binding(1)
var history: texture_2d<f32>

motion_vectors

#
@group(0)
@binding(2)
var motion_vectors: texture_2d<f32>

depth

#
@group(0)
@binding(3)
var depth: texture_depth_2d

nearest_sampler

#
@group(0)
@binding(4)
var nearest_sampler: sampler

linear_sampler

#
@group(0)
@binding(5)
var linear_sampler: sampler

Structures

Output

#
struct Output {
@location(0)
view_target: vec4<f32> ,
@location(1)
history: vec4<f32> ,
}

Functions

rcp

#

TAA is ideally applied after tonemapping, but before post processing Post processing wants to go before tonemapping, which conflicts Solution: Put TAA before tonemapping, tonemap TAA input, apply TAA, invert-tonemap TAA output https://advances.realtimerendering.com/s2014/index.html#_HIGH-QUALITY_TEMPORAL_SUPERSAMPLING, slide 20 https://gpuopen.com/learn/optimized-reversible-tonemapper-for-resolve

fn rcp ( ) -> f32

max3

#
fn max3 ( ) -> f32

tonemap

#
fn tonemap ( ) -> vec3<f32>

reverse_tonemap

#
fn reverse_tonemap ( ) -> vec3<f32>

RGB_to_YCoCg

#
fn RGB_to_YCoCg ( ) -> vec3<f32>

YCoCg_to_RGB

#
fn YCoCg_to_RGB ( ) -> vec3<f32>

clip_towards_aabb_center

#
fn clip_towards_aabb_center (
history_color: vec3<f32>
current_color: vec3<f32>
aabb_min: vec3<f32>
aabb_max: vec3<f32>
) -> vec3<f32>

sample_history

#
fn sample_history ( ) -> vec3<f32>

sample_view_target

#
fn sample_view_target ( ) -> vec3<f32>

taa

#
@fragment
Calculates the final color of each pixel on the screen
fn taa (
@location(0)
uv: vec2<f32>
) -> Output