Skip to content
This repository was archived by the owner on Nov 14, 2024. It is now read-only.

2. Conversion Tab

Halil Emre Yildiz edited this page Jan 12, 2024 · 11 revisions

The Conversion tab contains the Scanner, Printer and Mesher tools that allow you to convert a Terrain object into different formats.

Scanner

Scanner is a tool that allows you to create a heightmap of a Terrain object or other objects in the scene. This tool uses physical collision tests to scan the height values of a certain area and saves them as a Texture2D.

Usage

To use the Scanner tool, follow these steps:

  1. Select the Conversion tab and enable the Scanner tool.
  2. Check the Area Heightmapper option to visually adjust the area that you want to scan. This area is determined by the position, rotation and scale of the Scanner object.
  3. In the Scanner Settings section, select the tags or layers that you want to scan. The TagMask option ignores tags if it is Untagged, or scans only objects with selected tags if it is Scans only selected tags. The LayerMask option scans only objects with selected layers.
  4. In the Heightmapper Settings section, adjust the way the heightmap is created. The MappingMode option scans from bottom to top if it is BottomUp, or from top to bottom if it is TopDown. The Radius option determines the radius of the Collision method used for each pixel. The Contrast option determines the number of vertical Collision methods used for each pixel. The Resolution option determines the resolution of the heightmap.
  5. Click on the Generate Heightmap button to create the heightmap. The heightmap is saved in the Assets/_JSG_DATA/Heightmaps folder.

Variables and UI

The variables and UI elements of the Scanner tool are as follows:

public bool AreaHeightmapper; // Check to visually adjust the area that you want to scan
[Header("Scanner Settings")]
public TagMaskEnum TagMask = Untagged; // Select the tags that you want to scan. Untagged = Ignores tags, Scans only selected tags = Scans only objects with selected tags
public LayerMask LayerMask = Mixed; // Select the layers that you want to scan. Scans only objects with selected layers
[Header("Heightmapper Settings")]
public MappingModeEnum = BottomUp; // The way the heightmap is created. BottomUp = Scans from bottom to top, TopDown = Scans from top to bottom
[Range(0.025f, 1f)] public float Radius = 0.05; // The radius of the Collision  method used for each pixel
[Range(100, 10000)] public int Contrast = 2500; // The number of vertical Collision  methods used for each pixel
public Vector2Int Resolution = Vector2Int.One * 513; // The resolution of the heightmap
[Button("Generate Heightmap")] GenerateHeightmap(Path = "Assets/_JSG_DATA/Heightmaps"); // The Generate Heightmap button, which creates the heightmap and saves it to the specified folder

Clone this wiki locally