Lowpoly Style Mesh Generator
  • Lowpoly Style Mesh Generator
  • Quick Start
  • Editor Window Settings
    • Solver
    • Generate
    • Save
  • Run-time API
  • Help & Contact
Powered by GitBook
On this page

Run-time API

PreviousSaveNextHelp & Contact

Last updated 15 days ago

using AmazingAssets.LowpolyStyleMeshGenerator;

Using AmazingAssets.LowpolyStyleMeshGenerator directive adds GenerateLowpolyStyleMesh method to the Unity .

Mesh GenerateLowpolyStyleMesh(LowpolyStyleMeshGeneratorEnum.Solver solver,
                              Texture2D[] textures,
                              int uvIndex,
                              Vector4[] texturesTilingOffset,
                              Color[] colors,
                              LowpolyStyleMeshGeneratorEnum.SourceVertexColor sourceVertexColor = LowpolyStyleMeshGeneratorEnum.SourceVertexColor.None,
                              LowpolyStyleMeshGeneratorEnum.AlphaType alphaType = LowpolyStyleMeshGeneratorEnum.AlphaType.DefaultValue,
                              LowpolyStyleMeshGeneratorEnum.LowpolyUV lowpolyUV0 = LowpolyStyleMeshGeneratorEnum.LowpolyUV.None,
                              LowpolyStyleMeshGeneratorEnum.VertexAttribute saveFaceCenter = LowpolyStyleMeshGeneratorEnum.VertexAttribute.None,
                              bool mergeSubmeshes = false)

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.

Mesh