Constraints
The basic configuration of a generator involves setting up tiles, and painting those tiles to show how they can be placed next to each other.
This page documents further configuration you can do to tightly control the generation process.
There are many constraints available in Tessera:
- Scene Constraints
- Pins fix a particular tile in place
- Volume constraints filter a particular area to a subset of tiles
- Generator Constraints
- CountConstraint - ensures the number of tiles in a given set is less than / more than a given number.
- MirrorConstraint - ensures the output remains symmetric.
- PathConstraint - detects contiguous paths between tiles, and ensures various properties about those paths, such as connectedness.
- SeparationConstraint - ensures that the given tiles are spaced at least a certain distance apart
- BorderConstraint - ensures that the given tiles are palced at the border of the generation, similar to skyboxes
- Skyboxes controls how tiles on the boundary of the generation work
- Submesh filters applies per material settings when working with surface meshes.
Scene Constraints
Scene constraints are placed directly in the scene to control specific locations. They are described in more detail here.
Generator Constraints
Generator constraints are Unity components added to the same object as the TesseraGenerator component to control global behaviour of the generator. They are described more here.
Skybox
Setting the skybox property of the generator will automatically constrain all tiles on the boundary of the tile area. The skybox should be a TesseraTile component. Whatever is painted on the top of the skybox, will constrain the top of every tile on the topmost layer of the generator. Similarly for the other sides of the cube.
In this example, the skybox has been used to force the bottom edge to be all paths, and the other edges to have no paths.
Notes
The tile used for a skybox should not be a big tile, this will cause wierd behaviour.
If a pinned tile constraint and the skybox both apply at a particular location, the tile constraint takes precedence.
Note that a given skybox face is repeated as a constraint for all tiles which have a corresponding face on the boundary. This can sometimes cause counter-intuitive results. For example, if you have a 3d example like in this tutoral, then you cannot have a skybox that is "grass" on the sides. Doing so allows surface tiles, but would stop air and solid tiles from touching the boundary, which will cause the boundary to fail.
The solution to this is to make a new palette color just for the skybox. You can then set that color connect with multiple other colors, so that it's possible to place all the tiles that can abut the boundary.
Submesh filters
Note
Submesh filters are only available in Tessera Pro
If you are generating on a mesh surface, and that mesh has multiple submeshes, (i.e. multiple material slots), then you can filter which tiles are appropriate for which part of the submesh, similar to volumes, above.
The Generator inspector will automatically detect this case. Simply turn on "Filter By Submesh" and then select which tiles appear where.