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.

environment_map.wgsl

Import path

Constants

FLOAT_MAX

#
const FLOAT_MAX: f32 = 3.40282347e+38

Structures

EnvironmentMapLight

#
struct EnvironmentMapLight {
diffuse: vec3<f32> ,
specular: vec3<f32> ,
}

EnvironmentMapRadiances

#
struct EnvironmentMapRadiances {
irradiance: vec3<f32> ,
radiance: vec3<f32> ,
}

MultiscatterResult

#
struct MultiscatterResult {
FssEss: vec3<f32> ,
FmsEms: vec3<f32> ,
Edss: vec3<f32> ,
}

Functions

compute_cubemap_sample_dir

#
  • parallax_correct is true if parallax correction is to be applied and false otherwise.
fn compute_cubemap_sample_dir (
world_ray_origin: vec3<f32>
world_ray_direction: vec3<f32>
light_from_world: mat4x4<f32>
parallax_correction_bounds: vec3<f32>
parallax_correct: bool
view_rotation: vec4<f32>
) -> vec3<f32>

compute_radiances

#

Shader defs requirments:

🟢 MULTIPLE_LIGHT_PROBES_IN_ARRAY

fn compute_radiances (
clusterable_object_index_ranges: ptr<function, ClusterableObjectIndexRanges>
world_position: vec3<f32>
found_diffuse_indirect: bool
) -> EnvironmentMapRadiances

compute_radiances

#

Shader defs requirments:

šŸ”“ MULTIPLE_LIGHT_PROBES_IN_ARRAY

fn compute_radiances (
clusterable_object_index_ranges: ptr<function, ClusterableObjectIndexRanges>
world_position: vec3<f32>
found_diffuse_indirect: bool
) -> EnvironmentMapRadiances

environment_map_light_clearcoat

#

Shader defs requirments:

🟢 STANDARD_MATERIAL_CLEARCOAT

Adds the environment map light from the clearcoat layer to that of the base layer.

fn environment_map_light_clearcoat (
clusterable_object_index_ranges: ptr<function, ClusterableObjectIndexRanges>
found_diffuse_indirect: bool
)

compute_multiscatter

#

We initially used this (https://bruop.github.io/ibl) reference with Roughness Dependent Fresnel, but it made fresnel very bright so we reverted to the “typical” fresnel term.

fn compute_multiscatter (
Ems: f32
specular_occlusion: f32
) -> MultiscatterResult

environment_map_light

#
fn environment_map_light (
clusterable_object_index_ranges: ptr<function, ClusterableObjectIndexRanges>
found_diffuse_indirect: bool
) -> EnvironmentMapLight

radiance_sample_direction

#
fn radiance_sample_direction (
roughness: f32
) -> vec3<f32>

quat_rotate

#
fn quat_rotate ( ) -> vec3<f32>