Namespace Mapbox.Unity.MeshGeneration.Modifiers
Classes
AddMonoBehavioursModifier
AddMonoBehavioursModifierType
AddToCollectionModifier
ChamferHeightModifier
ColliderModifier
ColliderModifier.BoxColliderStrategy
ColliderModifier.MeshColliderStrategy
ColliderModifier.SphereColliderStrategy
DisableMeshRendererModifier
FeatureBehaviourModifier
FeatureBundle
GameObjectModifier
GameObject Modifiers Game object modifiers ran after the mesh modifiers and game object creation.Their main purpose is to work on game object and decorate/improve them in their own ways.They ran for each game object individually. It's possible to do lots of different things with GameObject Modifiers.A simple example would be MaterialModifier, which simply sets random materials to gameobject and submeshes.A more complicated example would be SpawnInside Modifier which instantiates prefabs in a polygon, like trees in a park. Any operation, you want to perform on generated entity, that would require a game object is a good candidate for game object modifiers. For example, things like adding a collider or animation would require a gameobject hence cannot be done in mesh modifier. Game object modifiers is the suggested way of customizing generated game object and we expect developers to fully utilize this by creating their own custom game object modifiers.
HeightModifier
Height Modifier is responsible for the y axis placement of the feature. It pushes the original vertices upwards by "height" value and creates side walls around that new polygon down to "min_height" value. It also checkes for "ele" (elevation) value used for contour lines in Mapbox Terrain data. Height Modifier also creates a continuous UV mapping for side walls.
LayerModifier
LineMeshModifier
Line Mesh Modifier creates line polygons from a list of vertices. It offsets the original vertices to both sides using Width parameter and triangulates them manually. It also creates tiled UV mapping using the line length.
LoftModifier
MapboxStylesColorModifier
MaterialList
MaterialModifier
Texture Modifier is a basic modifier which simply adds a TextureSelector script to the features. Logic is all pushed into this TextureSelector mono behaviour to make it's easier to change it in runtime.
MergedModifierStack
MeshModifier
Mesh Data class and Mesh Modifier MeshData class is used to keep data required for a mesh.Mesh modifiers recieve raw feature data and a mesh modifier, generate their data and keep it inside MeshData. i.e.PolygonMeshModifier is responsible for triangulating the polygon, so it calculates the triangle indices using the vertices and save it into MeshData.Triangles list.There's no control over which field a mesh modifier fills or overrides but some of the basic mesh modifier goes like this; Polygon mesh modifier - Vertices and triangles Line Mesh modifier - Vertices, triangles and uvs UV modifier - uvs(only used with polygon mesh modifier) height modifier - vertices(adds new points), triangles(for side walls), uvs(for side walls) After running all mesh modifiers, mesh data is expected to have at least vertices and triangles set as they are the bare minimum to create a unity mesh object. So the main purpose of the mesh modifiers is to fill up the mesh data class but they aren't limited to that either. You can always create gameobjects and debug lines/spheres inside them for debugging purposes whenever you have a problem. MeshData class also has some extra fields inside for data transfer purposes(between modifiers). i.e.Edges list inside mesh data isn't used for mesh itself, but it's calculated by PolygonMeshModifier and used by HeightModifier so to avoid calculating it twice, we're keeping it in the mesh data object. You can also extend mesh data like this if you ever need to save data or share information between mesh modifiers. We fully expect developers to create their own mesh modifiers to customize the look of their world.It would probably take a little experience with mesh generation to be able to do this but it's the suggested way to create custom world objects, like blobly toonish buildings, or wobbly roads.
MinMaxPair
ModifierBase
ModifierProperties
ModifierStack
Modifier Stacks Modifier Stack can be thought as styles as as they contain all the data/settings for how the feature will be visualized. They also create the game objects in default implementations in the sdk. Currently there's two implementations of this; Modifier Stack and Merged Modifier Stack.They work almost exactly same (logically) with one difference; modifier stacks creates a game object for each feature while merged modifier stack, merges them up as the name suggest and create one game object for multiple(as many as possible) features.Both have their advantages but the main factor here is the performance.Regular modifier stack creates individual game object so it's easier to interact, move, animate etc features.But if you want to visualize whole San Francisco, that would mean just 200k-300k buildings which would hit performance really hard. In such a case, especially if you don't need individual interaction or something, you can use merged modifier stack, which will probably be able to create whole SF around a few hundred game objects. They contain two lists; mesh modifier list and game object modifier list.These modifiers are used to create and decorate game objects. Mesh modifiers generate data required for the game objects mesh. I.e.polygon mesh modifier triangulates the polygn, height modifier extrudes the polygon and adds volume etc, uv modifier changes UV mapping etc. Game object modifiers decorate created game objects, like settings material, interaction scripts, animations etc. i.e.Material modifier sets materials to mesh and submeshes, highlight modifier adds mouse highlight to features, feature behaviour adds a script to keep feature data on game objects etc. So the idea here is; run all mesh modifiers first, generate all the data required for mesh.Create game object using that mesh data.Run all game object modifiers to decorate that game object.
ModifierStackBase
NoiseOffsetModifier
PolygonMeshModifier
PrefabModifier
ReplaceFeatureCollectionModifier
ReplaceFeatureCollectionModifier aggregates multiple ReplaceFeatureModifier objects into one modifier.
ReplaceFeatureModifier
ReplaceBuildingFeatureModifier takes in POIs and checks if the feature layer has those points and deletes them
SmoothLineModifier
SnapTerrainModifier
SnapTerrainRaycastModifier
SpawnInsideModifier
TagModifier
TextureModifier
Texture Modifier is a basic modifier which simply adds a TextureSelector script to the features. Logic is all pushed into this TextureSelector mono behaviour to make it's easier to change it in runtime.
TextureMonoBehaviourModifier
Texture Modifier is a basic modifier which simply adds a TextureSelector script to the features. Logic is all pushed into this TextureSelector mono behaviour to make it's easier to change it in runtime.
TextureSideWallModifier
UvModifier
UV Modifier works only with (and right after) Polygon Modifier and not with Line Mesh Modifier. If UseSatelliteRoof parameter is false, it creates a tiled UV map, otherwise it creates a stretched UV map.