Run-time API
Last updated
Last updated
Using AmazingAssets.LowpolyStyleMeshGenerator directive adds GenerateLowpolyStyleMesh method to the Unity .
Generates new lowpoly style mesh based on the provided parameters. Source mesh is not modified.
solver
Baked vertex color style: AverageColor, CenterColor or FirstVertexColor.
textures
Array of the textures with the same size as the source mesh’s sub-mesh count. Each texture is baked corresponding to its sub-mesh index. In the case of providing only one texture, it is used for all sub-meshes. Passing null value bakes white texture.
uvIndex
Mesh UV index used for texture sampling for baking it inside vertex color. By default it is 0. Can be in the range of [0, 7].
texturesTilingOffset
Baked textures tiling and offset values. Must be the same size as the textures array. Passing null value uses default (1, 1, 0, 0) parameters.
colors
Array of the baked colors with the same size as the source mesh’s sub-mesh count. Each color is baked corresponding to its sub-mesh index. In the case of providing only one color, it is used for all sub-meshes. Passing null value bakes white color.
sourceVertexColor
Combines mesh original vertex color with generated lowpoly color.
alphaType
Saved vertex color's alpha value.
Default value is calculated using: texture Alpha * color Alpha * original vertex color Alpha
saveLowpolyUV0
Calculates lowpoly UV0 and saves it inside XY or ZW channel of the generated mesh's UV0 buffer.
saveFaceCenter
Calculates triangle’s center position and saves it inside one of the vertex attributes.
mergeSubmeshes
Combines sub-meshes in the generated lowpoly style mesh.