Trait bevy_mod_outline::OutlineMeshExt
source · pub trait OutlineMeshExt {
// Required method
fn generate_outline_normals(
&mut self,
) -> Result<(), GenerateOutlineNormalsError>;
}
Expand description
Extension methods for Mesh
.
Required Methods§
sourcefn generate_outline_normals(
&mut self,
) -> Result<(), GenerateOutlineNormalsError>
fn generate_outline_normals( &mut self, ) -> Result<(), GenerateOutlineNormalsError>
Generates outline normals for the mesh.
Vertex extrusion only works for meshes with smooth surface normals. Hard edges cause visual artefacts. This function generates faux-smooth normals for outlining purposes by grouping vertices by their position and averaging the normals at each point. These outline normals are then inserted as a separate vertex attribute so that the regular normals remain untouched. However, insofar as the outline normals are not perpendicular to the surface of the mesh, this technique may result in non-uniform outline thickness.
This function only supports meshes with TriangleList topology.