UE5 Nanite - jgoffeney/Cesium4Unreal GitHub Wiki

Back

C++

EngineTypes.h

FMeshNaniteSettings

  • UPROPERTY
    • bEnabled: if true, Nanite data will be generated
    • PositionPrecision: a power of 2 value to quantize the mesh vertex positions. If you use the max of 64 cm then that is the "grid size" used to position / eliminate vertices. It is a form of compression.
    • PercentTriangles: the percentage of triangles to keep from the original mesh for the low resolution proxy. It will always be at least 2000 triangles (unless the original mesh has less than 2000 triangles).

StaticMesh.h

UStaticMesh

  • UPROPERTY
    • NaniteSettings: an instance of FMeshNaniteSettings
  • Functions
    • HasValidNaniteData: checks the render data for its number of nanite resources page streaming states. If at least one then it is true.

NaniteResources.h

Contains a variety of classes, structs and defines related to the Nanite system.

MeshBuilder.h

FMeshBuilder

This is an abstract class for other MeshBuilder classes.

StaticMeshBuilder.cpp

FStaticMeshBuilder

  • Functions
    • BuildNaniteFromHiResSourceModel: takes a UStaticMesh with FMeshNaniteSettings to apparently run the nanite build on the mesh
    • Build: this build function runs BuildNaniteFromHiResSourceModel. The input UStaticMesh needs to have its property NaniteSettings.bEnabled set to true and its IsHiResMeshDescriptionValid() return true.