Adding an Import mask node

This node creates a mask from an image file. The operation is the same as for importing a terrain and the same file formats are supported. The mask is filled directly from the image gray scale (no scaling).

To add a node, right-click in the Graph Editor and select Create Node  > Import  > Import mask from file.

Double click on the node to open its parameters:

Importing a mask from a file

To import a mask from a file:

Either:
  • Drag and drop the file into the File name field, click on the folder button and browse to the file you want to import, or type the directory of the file to import.
  • Drag and drop the image directly into the Graph editor. A pop-up dialog appears. Click whether you want to import the image file as a terrain, mask, or color map.

If you have already saved your project, type just a file name or sub-directory and file name to import it from the same directory as your project. There is no need to type the file directory.

File names with Unicode characters are supported.

The following image formats are supported:

Extension Format Comments
.bmp Windows or OS/2 Bitmap file 8/16/24/32 bits allowed
.gif Graphics Interchange Format  
.jpg, .jpeg Independent JPEG Group  
.png Portable Network Graphics 8/16 bits per channel with 1/3/4 channels (gray scale/RGB/RGBA) allowed
.ico Windows Icon  
.tif, .tiff Tagged Image File Format 8/16/32 bits allowed
.tga Truevision Targa File  
.psd Adobe Photoshop  
.pgm Portable Graymap  
.pfm Portable Floatmap  
.exr ILM openEXR  
.raw RAW binary data  

Every colored image is transformed into a gray scale texture. The alpha channel is discard and converted to black.

Only nodes with a single channel, 8 bits, 16 bits, or 32 bits, are supported.
- For 8 bits, the values are between 0 and 255.
- For 16 bits, the values are between 0 and 65'535.
- For 32 bits, the values are floating values: this is the mask value between 0 and 1. Values less than 0 are converted to 0. Values greater than 1 are converted to 1.
Note: If a mask is all white, it is probably because it contains values that are too high, typically greater than 1, which are converted to 1, which leads to an all white mask.

  • Import as Raw: Check the box to import the image file as raw.
  • File information: Sets the Width, Height, and Bits of the terrain. The Skipped bytes option provides the number of bytes to be skipped at the beginning of the raster file to obtain to the first row of pixels.
  • Quad size: Sets the size of the terrain quads.
  • Height: Sets the minimum and maximum height of the terrain.
  • Flip Y axis: Check the box to flip the terrain around the Y axis.

Parameters

Parameter Use
File name Name of the file to load
Quad size Size of the mask quads
File information Sets the width, height, and bits of the mask
Flip Y axis Flips the mask around the Y axis

Copyright © 2021 · All Rights Reserved · Wysilab