Function meshopt_rs::index::generator::generate_shadow_index_buffer
source · [−]pub fn generate_shadow_index_buffer(
destination: &mut [u32],
indices: &[u32],
vertices: &Stream<'_>
)
Expand description
Generates index buffer that can be used for more efficient rendering when only a subset of the vertex attributes is necessary.
All vertices that are binary equivalent map to the first vertex in the original vertex buffer. This makes it possible to use the index buffer for Z pre-pass or shadowmap rendering, while using the original index buffer for regular rendering.
Note that binary equivalence considers all Stream::subset
bytes, including padding which should be zero-initialized.
Arguments
destination
: must contain enough space for the resulting index buffer (indices.len()
elements)