Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.
1#define_import_path bevy_pbr::mesh_types
3struct Mesh {
4 // Affine 4x3 matrices transposed to 3x4
5 // Use bevy_render::maths::affine3_to_square to unpack
6 world_from_local: mat3x4<f32>,
7 previous_world_from_local: mat3x4<f32>,
8 // 3x3 matrix packed in mat2x4 and f32 as:
9 // [0].xyz, [1].x,
10 // [1].yz, [2].xy
11 // [2].z
12 // Use bevy_pbr::mesh_functions::mat2x4_f32_to_mat3x3_unpack to unpack
13 local_from_world_transpose_a: mat2x4<f32>,
14 local_from_world_transpose_b: f32,
15 // 'flags' is a bit field indicating various options. u32 is 32 bits so we have up to 32 options.
16 flags: u32,
17 lightmap_uv_rect: vec2<u32>,
18 // The index of the mesh's first vertex in the vertex buffer.
19 first_vertex_index: u32,
20 current_skin_index: u32,
21 // Low 16 bits: index of the material inside the bind group data.
22 // High 16 bits: index of the lightmap in the binding array.
23 material_and_lightmap_bind_group_slot: u32,
24 // User supplied index to identify the mesh instance
25 tag: u32,
26 pad: u32,
27};
29#ifdef SKINNED
30struct SkinnedMesh {
31 data: array<mat4x4<f32>, 256u>,
32};
33#endif
35#ifdef MORPH_TARGETS
36struct MorphWeights {
37 weights: array<vec4<f32>, 64u>, // 64 = 256 / 4 (256 = MAX_MORPH_WEIGHTS)
38};
39#endif
41// [2^0, 2^16)
42const MESH_FLAGS_VISIBILITY_RANGE_INDEX_BITS: u32 = (1u << 16u) - 1u;
43const MESH_FLAGS_NO_FRUSTUM_CULLING_BIT: u32 = 1u << 28u;
44const MESH_FLAGS_SHADOW_RECEIVER_BIT: u32 = 1u << 29u;
45const MESH_FLAGS_TRANSMITTED_SHADOW_RECEIVER_BIT: u32 = 1u << 30u;
46// if the flag is set, the sign is positive, else it is negative
47const MESH_FLAGS_SIGN_DETERMINANT_MODEL_3X3_BIT: u32 = 1u << 31u;
Contents