1#define_import_path bevy_render::view3struct ColorGrading {4 balance: mat3x3<f32>,5 saturation: vec3<f32>,6 contrast: vec3<f32>,7 gamma: vec3<f32>,8 gain: vec3<f32>,9 lift: vec3<f32>,10 midtone_range: vec2<f32>,11 exposure: f32,12 hue: f32,13 post_saturation: f32,14}16struct View {17 clip_from_world: mat4x4<f32>,18 unjittered_clip_from_world: mat4x4<f32>,19 world_from_clip: mat4x4<f32>,20 world_from_view: mat4x4<f32>,21 view_from_world: mat4x4<f32>,22 // Typically a column-major right-handed projection matrix, one of either:23 //24 // Perspective (infinite reverse z)25 // ```26 // f = 1 / tan(fov_y_radians / 2)27 //28 // ⎡ f / aspect 0 0 0 ⎤29 // ⎢ 0 f 0 0 ⎥30 // ⎢ 0 0 0 near ⎥31 // ⎣ 0 0 -1 0 ⎦32 // ```33 //34 // Orthographic35 // ```36 // w = right - left37 // h = top - bottom38 // d = far - near39 // cw = -right - left40 // ch = -top - bottom41 //42 // ⎡ 2 / w 0 0 cw / w ⎤43 // ⎢ 0 2 / h 0 ch / h ⎥44 // ⎢ 0 0 1 / d far / d ⎥45 // ⎣ 0 0 0 1 ⎦46 // ```47 //48 // `clip_from_view[3][3] == 1.0` is the standard way to check if a projection is orthographic49 //50 // Wgsl matrices are column major, so for example getting the near plane of a perspective projection is `clip_from_view[3][2]`51 // 52 // Custom projections are also possible however.53 clip_from_view: mat4x4<f32>,54 view_from_clip: mat4x4<f32>,55 world_position: vec3<f32>,56 exposure: f32,57 // viewport(x_origin, y_origin, width, height)58 viewport: vec4<f32>,59 // 6 world-space half spaces (normal: vec3, distance: f32) ordered left, right, top, bottom, near, far.60 // The normal vectors point towards the interior of the frustum.61 // A half space contains `p` if `normal.dot(p) + distance > 0.`62 frustum: array<vec4<f32>, 6>,63 color_grading: ColorGrading,64 mip_bias: f32,65 frame_count: u32,66};