Kanda Graphics 0.6.0
Loading...
Searching...
No Matches
OutlineUtils Class Reference

Utility methods for processing meshes used in outline rendering. More...

Static Public Member Functions

static NativeArray< Vector3 > ComputeSmoothNormals (Mesh mesh)
 Computes smooth normals for a mesh by averaging normals of vertices at the same position.
 
static void CombineSubMeshes (Mesh mesh)
 Combines all submeshes of a mesh into a single submesh appended at the end.
 

Detailed Description

Utility methods for processing meshes used in outline rendering.

Member Function Documentation

◆ CombineSubMeshes()

static void CombineSubMeshes ( Mesh mesh)
inlinestatic

Combines all submeshes of a mesh into a single submesh appended at the end.

Parameters
meshThe mesh to process. Must have Read/Write enabled.

The original submeshes are preserved, with the combined submesh added as a new one. If the mesh already has only one submesh, this operation is skipped.

◆ ComputeSmoothNormals()

static NativeArray< Vector3 > ComputeSmoothNormals ( Mesh mesh)
inlinestatic

Computes smooth normals for a mesh by averaging normals of vertices at the same position.

Parameters
meshThe mesh to compute smooth normals for. Must have Read/Write enabled.
Returns
A NativeArray containing smoothed normals corresponding to each vertex. The caller is responsible for disposal.

This method is optimized for performance using native collections:

  1. First pass accumulates normals by vertex position
  2. Second pass normalizes the accumulated normals Temporary allocations are cleaned up automatically via Allocator.Temp

The documentation for this class was generated from the following file: