3 functions::{direction_world_to_atmosphere, sample_sky_view_lut, get_view_position}, 8@group(0) @binding(13) var output: texture_storage_2d_array<rgba16float, write>; 10@compute @workgroup_size(8, 8, 1) 11fn main(@builtin(global_invocation_id) global_id: vec3<u32>) { 12 let dimensions = textureDimensions(output); 13 let slice_index = global_id.z; 15 if (global_id.x >= dimensions.x || global_id.y >= dimensions.y || slice_index >= 6u) { 21 (f32(global_id.x) + 0.5) / f32(dimensions.x), 22 (f32(global_id.y) + 0.5) / f32(dimensions.y) 25 var ray_dir_ws = sample_cube_dir(uv, slice_index); 28 ray_dir_ws.z = -ray_dir_ws.z; 30 let world_pos = get_view_position(); 31 let r = length(world_pos); 32 let up = normalize(world_pos); 34 let ray_dir_as = direction_world_to_atmosphere(ray_dir_ws.xyz, up); 35 let inscattering = sample_sky_view_lut(r, ray_dir_as); 36 let color = vec4<f32>(inscattering, 1.0); 38 textureStore(output, vec2<i32>(global_id.xy), i32(slice_index), color);