1struct UncompressedVertex { 2 @builtin(instance_index) instance_index: u32, 4 @location(0) position: vec3<f32>, 6 @location(1) normal: vec3<f32>, 8 @location(2) uv: vec2<f32>, 10 @location(3) uv_b: vec2<f32>, 12 @location(4) tangent: vec4<f32>, 14 @location(5) color: vec4<f32>, 16 @location(6) joint_indices: vec4<u32>, 18 @location(7) joint_weights: vec4<f32>, 20 @builtin(vertex_index) index: u32, 24 @builtin(instance_index) instance_index: u32, 25 @if(VERTEX_POSITIONS && VERTEX_POSITIONS_COMPRESSED) 26 @location(0) compressed_position: vec4<f32>, 27 @if(VERTEX_POSITIONS && !VERTEX_POSITIONS_COMPRESSED) 28 @location(0) position: vec3<f32>, 29 @if(VERTEX_NORMALS && VERTEX_NORMALS_COMPRESSED) 30 @location(1) compressed_normal: vec2<f32>, 31 @if(VERTEX_NORMALS && !VERTEX_NORMALS_COMPRESSED) 32 @location(1) normal: vec3<f32>, 33 @if(VERTEX_UVS_A && VERTEX_UVS_A_COMPRESSED) 34 @location(2) compressed_uv: vec2<f32>, 35 @if(VERTEX_UVS_A && !VERTEX_UVS_A_COMPRESSED) 36 @location(2) uv: vec2<f32>, 37 @if(VERTEX_UVS_B && VERTEX_UVS_B_COMPRESSED) 38 @location(3) compressed_uv_b: vec2<f32>, 39 @if(VERTEX_UVS_B && !VERTEX_UVS_B_COMPRESSED) 40 @location(3) uv_b: vec2<f32>, 41 @if(VERTEX_TANGENTS && VERTEX_TANGENTS_COMPRESSED) 42 @location(4) compressed_tangent: vec2<f32>, 43 @if(VERTEX_TANGENTS && !VERTEX_TANGENTS_COMPRESSED) 44 @location(4) tangent: vec4<f32>, 46 @location(5) color: vec4<f32>, 48 @location(6) joint_indices: vec4<u32>, 50 @location(7) joint_weights: vec4<f32>, 52 @builtin(vertex_index) index: u32, 55@if(!MESHLET_MESH_MATERIAL_PASS) 59fn decompress_vertex(vertex_in: Vertex, instance_index: u32) -> UncompressedVertex { 60 let mesh_metadata = package::render::mesh_functions::get_metadata(instance_index); 61 var uncompressed_vertex: UncompressedVertex; 62 uncompressed_vertex.instance_index = instance_index; 63@if(VERTEX_POSITIONS && VERTEX_POSITIONS_COMPRESSED) 64 uncompressed_vertex.position = bevy_render::utils::decompress_vertex_position(vertex_in.compressed_position, mesh_metadata.aabb_center, mesh_metadata.aabb_half_extents); 65@if(VERTEX_POSITIONS && !VERTEX_POSITIONS_COMPRESSED) 66 uncompressed_vertex.position = vertex_in.position; 67@if(VERTEX_NORMALS && VERTEX_NORMALS_COMPRESSED) 68 uncompressed_vertex.normal = bevy_render::utils::decompress_vertex_normal(vertex_in.compressed_normal); 69@if(VERTEX_NORMALS && !VERTEX_NORMALS_COMPRESSED) 70 uncompressed_vertex.normal = vertex_in.normal; 71@if(VERTEX_UVS_A && VERTEX_UVS_A_COMPRESSED) { 72 let uv_min_and_extents_a = mesh_metadata.uv_channels_min_and_extents[0]; 73 uncompressed_vertex.uv = bevy_render::utils::decompress_vertex_uv(vertex_in.compressed_uv, uv_min_and_extents_a); 75@if(VERTEX_UVS_A && !VERTEX_UVS_A_COMPRESSED) 76 uncompressed_vertex.uv = vertex_in.uv; 77@if(VERTEX_UVS_B && VERTEX_UVS_B_COMPRESSED) { 78 let uv_min_and_extents_b = mesh_metadata.uv_channels_min_and_extents[1]; 79 uncompressed_vertex.uv_b = bevy_render::utils::decompress_vertex_uv(vertex_in.compressed_uv_b, uv_min_and_extents_b); 81@if(VERTEX_UVS_B && !VERTEX_UVS_B_COMPRESSED) 82 uncompressed_vertex.uv_b = vertex_in.uv_b; 83@if(VERTEX_TANGENTS && VERTEX_TANGENTS_COMPRESSED) 84 uncompressed_vertex.tangent = bevy_render::utils::decompress_vertex_tangent(vertex_in.compressed_tangent); 85@if(VERTEX_TANGENTS && !VERTEX_TANGENTS_COMPRESSED) 86 uncompressed_vertex.tangent = vertex_in.tangent; 88 uncompressed_vertex.color = vertex_in.color; 90 uncompressed_vertex.joint_indices = vertex_in.joint_indices; 91 uncompressed_vertex.joint_weights = vertex_in.joint_weights; 94 uncompressed_vertex.index = vertex_in.index; 95 return uncompressed_vertex; 101 @builtin(position) position: vec4<f32>, 102 @location(0) world_position: vec4<f32>, 103 @location(1) world_normal: vec3<f32>, 105 @location(2) uv: vec2<f32>, 107 @location(3) uv_b: vec2<f32>, 109 @location(4) world_tangent: vec4<f32>, 111 @location(5) color: vec4<f32>, 112 @if(VERTEX_OUTPUT_INSTANCE_INDEX) 113 @location(6) @interpolate(flat) instance_index: u32, 114 @if(VISIBILITY_RANGE_DITHER) 115 @location(7) @interpolate(flat) visibility_range_dither: i32, 118struct FragmentOutput { 119 @location(0) color: vec4<f32>,