[Generate terrain] Generate maps based on image textures, use of grayscale images

Distant view effect:

Close-up effect:

Use of grayscale images:

Pictures are composed of pixels. Through the width and height of the picture, we can know how many pixels are used in a picture. Each pixel stores the color information of the picture.
In the Texture2D picture type:
public Color GetPixel(int x, int y); Get the color of the pixel.
In the Color type:
public float grayscale { get;} attribute returns the grayscale value

Note: The picture needs to be set and checked Read/Write Enable

Hang the <setMeshMap> script on the plane and drag and drop the selected image.

 

Guess you like

Origin blog.csdn.net/m0_74022070/article/details/130377961