Last updated
Combines grass objects into one or several meshes.
Returned dictionary key is the grass index inside array and value holds the combined meshes associated to that index.
grassCombineType - Grass meshes combine type:
GrassCombineType.ByTexture - Grass meshes are combined based on the used grass texture.
GrassCombineType.ByTextureWithAtlas - Grass meshes are combined based on the used grass texture and mesh UV is generated based on the provided GrassAtlasTexture.
GrassCombineType.Everything - Combines all grass meshes into one file and for each mesh UV is generated based on the provided GrassAtlasTexture.
grassMeshTexcoord2 - Allows baking additional data inside combed meshes UV channel #2:
GrassMeshTexcoord2.None - Nothing is baked.
GrassMeshTexcoord2.PivotPoint - Bakes current grass quad mesh's pivot point's local position.
GrassMeshTexcoord2.BaseUV - Bakes current grass quad mesh's initial UV coordinates that will be overwritten in the case of using GrassAtlasTexture.
Dictionary<Texture2D, Rect> atlasRect - In the case of using GrassAtlasTexture, this property should provide collection of GrassTextures and UV coordinates associated with this texture inside GrassAtlasTexture.
exportPercentage - Percentage of the combined grass objects in the range of [0.01, 100]
maxVertexCountPerCombinedMesh - Defines how much vertices combined mesh(es) will contain.
int grassMeshSidesCount, float grassMeshDistortion - Specifies how much sides each grass quad mesh will contain and how much offset distortion they will have.
calculateHealthAndDryColor - Bakes prototype's and colors.
Theoretically Unity can create mesh with 4 billion vertices, but for run-time use it is better to use more logical values. Based on the used vertex count, generated meshes will be in 16 or 32 bits .