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.

tonemapping_shared.wgsl

Import path

Constants

LEVEL_MARGIN

#
const LEVEL_MARGIN: f32 = 0.1

LEVEL_MARGIN_DIV

#
const LEVEL_MARGIN_DIV: f32 = 0.5 / LEVEL_MARGIN

TONY_MC_MAPFACE_LUT_DIMS

#
const TONY_MC_MAPFACE_LUT_DIMS: f32 = 48.0

Functions

sample_current_lut

#
fn sample_current_lut ( ) -> vec3<f32>

rgb_to_ycbcr

#
fn rgb_to_ycbcr ( ) -> vec3<f32>

ycbcr_to_rgb

#
fn ycbcr_to_rgb ( ) -> vec3<f32>

tonemap_curve

#
fn tonemap_curve ( ) -> f32

tonemap_curve3_

#
fn tonemap_curve3_ ( ) -> vec3<f32>

somewhat_boring_display_transform

#
fn somewhat_boring_display_transform ( ) -> vec3<f32>

sample_tony_mc_mapface_lut

#
fn sample_tony_mc_mapface_lut (
stimulus: vec3<f32>
) -> vec3<f32>

RRTAndODTFit

#
fn RRTAndODTFit ( ) -> vec3<f32>

ACESFitted

#
fn ACESFitted ( ) -> vec3<f32>

saturation

#

Increase color saturation of the given color data. :param color: expected sRGB primaries input :param saturationAmount: expected 0-1 range with 1=neutral, 0=no saturation. – ref[2] [4]

fn saturation (
saturationAmount: f32
) -> vec3<f32>

convertOpenDomainToNormalizedLog2_

#

Output log domain encoded data. Similar to OCIO lg2 AllocationTransform. ref[0]

fn convertOpenDomainToNormalizedLog2_ (
minimum_ev: f32
maximum_ev: f32
) -> vec3<f32>

convertNormalizedLog2ToOpenDomain

#

Inverse of above

fn convertNormalizedLog2ToOpenDomain (
minimum_ev: f32
maximum_ev: f32
) -> vec3<f32>

applyAgXLog

#

Prepare the data for display encoding. Converted to log domain.

fn applyAgXLog ( ) -> vec3<f32>

applyLUT3D

#
fn applyLUT3D (
block_size: f32
) -> vec3<f32>

sample_blender_filmic_lut

#
fn sample_blender_filmic_lut (
stimulus: vec3<f32>
) -> vec3<f32>

tonemapping_reinhard

#

from https://64.github.io/tonemapping/ reinhard on RGB oversaturates colors

fn tonemapping_reinhard ( ) -> vec3<f32>

tonemapping_reinhard_extended

#
fn tonemapping_reinhard_extended (
max_white: f32
) -> vec3<f32>

tonemapping_luminance

#

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

fn tonemapping_luminance ( ) -> f32

tonemapping_change_luminance

#
fn tonemapping_change_luminance (
l_out: f32
) -> vec3<f32>

tonemapping_reinhard_luminance

#
fn tonemapping_reinhard_luminance ( ) -> vec3<f32>

rgb_to_srgb_simple

#
fn rgb_to_srgb_simple ( ) -> vec3<f32>

screen_space_dither

#

Source: Advanced VR Rendering, GDC 2015, Alex Vlachos, Valve, Slide 49 https://media.steampowered.com/apps/valve/2015/Alex_Vlachos_Advanced_VR_Rendering_GDC2015.pdf

fn screen_space_dither (
frag_coord: vec2<f32>
) -> vec3<f32>

sectional_color_grading

#

Performs the “sectional” color grading: i.e. the color grading that applies individually to shadows, midtones, and highlights.

fn sectional_color_grading ( ) -> vec3<f32>

tone_mapping

#
fn tone_mapping (
in_color_grading: ColorGrading
) -> vec4<f32>

approximate_inverse_tone_mapping

#

This is an incredibly crude approximation of the inverse of the tone mapping function. We assume here that there’s a simple linear relationship between the input and output which is not true at all, but useful to at least preserve the overall luminance of colors when sampling from an already tonemapped image. (e.g. for transmissive materials when HDR is off)

fn approximate_inverse_tone_mapping (
color_grading: ColorGrading
) -> vec4<f32>