Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.
Star

Functions

ior_corrected_roughness

#
Active when
VIEW_TRANSMISSION_TEXTURE

The IOR impacts how much a single microfacet refracts incoming light. In turn this changes how “wide” the distribution of output ray directions is and how rough the BRDF should be. This function scales the roughness toward 0.0 as IOR tends towards 1.0, while leaving the default roughness for IOR = 1.5. Adapted from Khronos gltf-Sample-Renderer (https://github.com/KhronosGroup/glTF-Sample-Renderer/blob/bec106e53da4a6a398aa3205f0f96563519a657e/source/Renderer/shaders/functions.glsl#L84-L89)

fn ior_corrected_roughness (
roughness: f32,
ior: f32
) -> f32

specular_transmissive_light

#
Active when
VIEW_TRANSMISSION_TEXTURE
fn specular_transmissive_light (
world_position: vec4<f32>,
frag_coord: vec3<f32>,
view_z: f32,
N: vec3<f32>,
V: vec3<f32>,
F0: vec3<f32>,
ior: f32,
thickness: f32,
perceptual_roughness: f32,
specular_transmissive_color: vec3<f32>,
transmitted_environment_light_specular: vec3<f32>
) -> vec3<f32>

fetch_transmissive_background_non_rough

#
Active when
VIEW_TRANSMISSION_TEXTURE
fn fetch_transmissive_background_non_rough (
offset_position: vec2<f32>,
frag_coord: vec3<f32>
) -> vec4<f32>

fetch_transmissive_background

#
Active when
VIEW_TRANSMISSION_TEXTURE
fn fetch_transmissive_background (
offset_position: vec2<f32>,
frag_coord: vec3<f32>,
view_z: f32,
transmission_roughness: f32
) -> vec4<f32>
Contents