Back home 🏡 WGSL Spec Bevy WGSL Functions

pbr_ambient.wgsl

Import path

Functions

ambient_light

#
A precomputed NdotV is provided because it is computed regardless, but world_normal` and the view vector `V are provided separately for more advanced uses.
fn ambient_light(world_position: vec4<f32>, world_normal: vec3<f32>, V: vec3<f32>, NdotV: f32, diffuse_color: vec3<f32>, specular_color: vec3<f32>, perceptual_roughness: f32, occlusion: vec3<f32>) -> vec3<f32>
Parameter Type
world_position vec4<f32>
world_normal vec3<f32>
V vec3<f32>
NdotV f32
diffuse_color vec3<f32>
specular_color vec3<f32>
perceptual_roughness f32
occlusion vec3<f32>
Returns: vec3<f32>