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.

pbr_functions.wgsl

Import path

Structures

PbrInput

#
struct PbrInput {
material: PbrTypes ,
occlusion: f32 ,
frag_coord: vec4<f32> ,
world_position: vec4<f32> ,
world_normal: vec3<f32> ,
is_orthographic: bool ,
}

Functions

prepare_normal

#

NOTE: This ensures that the world_normal is normalized and if vertex tangents and normal maps then normal mapping may be applied.

fn prepare_normal (
standard_material_flags: u32
world_normal: vec3<f32>
world_tangent: vec4<f32>
is_front: bool
) -> vec3<f32>

calculate_view

#

NOTE: Correctly calculates the view vector depending on whether the projection is orthographic or perspective.

fn calculate_view (
world_position: vec4<f32>
is_orthographic: bool
) -> vec3<f32>

pbr_input_new

#

Creates a PbrInput with default values

fn pbr_input_new ()

pbr

#
fn pbr ( ) -> vec4<f32>

tone_mapping

#
fn tone_mapping ( ) -> vec4<f32>