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.

bloom.wgsl

Bindings

input_texture

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

s

#
@group(0)
@binding(1)
var s: sampler

uniforms

#
@group(0)
@binding(2)
var<uniform> uniforms: BloomUniforms

Structures

BloomUniforms

#
struct BloomUniforms {
threshold_precomputations: vec4<f32> ,
viewport: vec4<f32> ,
scale: vec2<f32> ,
aspect: f32 ,
}

Functions

soft_threshold

#

Shader defs requirments:

🟢 FIRST_DOWNSAMPLE

fn soft_threshold ( ) -> vec3<f32>

tonemapping_luminance

#

luminance coefficients from Rec. 709. https://en.wikipedia.org/wiki/Rec._709

fn tonemapping_luminance ( ) -> f32

rgb_to_srgb_simple

#
fn rgb_to_srgb_simple ( ) -> vec3<f32>

karis_average

#
fn karis_average ( ) -> f32

sample_input_13_tap

#

[COD] slide 153

fn sample_input_13_tap ( ) -> vec3<f32>

sample_input_3x3_tent

#

[COD] slide 162

fn sample_input_3x3_tent ( ) -> vec3<f32>

downsample_first

#
@fragment
Calculates the final color of each pixel on the screen

Shader defs requirments:

🟢 FIRST_DOWNSAMPLE

fn downsample_first (
@location(0)
output_uv: vec2<f32>
) ->
@location(0)
vec4<f32>

downsample

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

upsample

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