Unity Shader - Textures Texture

Contents: Unity Shader - knowledge catalog (first placeholder, follow continuously updated)
original: Textures
version: 2019.1

Textures

After a usually the Mesh (mesh) object as a rough external shape, to be texture, appearance details appear to be provided. Mesh texture image for use in the surface. You can think of a texture is useful as a rubber skin, and the vertex position coordinates of the texture is provided with a good location, the texture coordinates will be stretched to ensure that the position is provided with. Position Texture is done by 3D modeling software, the software used to create a grid.
Cylder with tree bark - Bark texture cylinder
Unity can import most common image file formats.

Textures for use on 3D models

Using textures in the 3D model

A texture applied to the object Materials (material). Materials used in the program is called the image Shaders , for rendering the mesh surface. Shaders can achieve the effect of light and colored to simulate a smooth or uneven surface. Shader also simultaneously use a plurality of textures to be used in combination to achieve a more flexible and variable results.

Texture size (width and height) should be a power of 2 (such as: 32x32,64x64,128x128,256x256, etc.). As long as the texture on the Unity project Assets folder on it, then these resources will be displayed in the Project view.

After importing the texture, you can set it to Material used in. Material can be applied to the grid, particle system, GUI or texture. By Import Settings (import setting), or can be converted into Cubemap Normalmap for use in different types of requirements. More relevant import texture information, please refer to the Texture the Component Page .

2D graphics

2D graphics
in 2D game, Sprites (Elf) is planar texture grid to simulate the appearance of the object shape.
Sprite from a 3D viewport
A 2D game objects may take many pictures to present a set of animation frames. This method can easily design and rendering. Check the manual page for more Sprite Editor information.

GUI

We also called UI GUI generally referred to

What is the GUI, game graphic user interface (GUI: graphical user interface user interface) is generally a non-interactive scene content, but allows the user to select or view the information. For example, the standings show, or UI menu options menu interface in the game. These visual pattern on the mesh surface in the scene is very different, but they are also treated with the texture and presentation. Consult the manual GUI Scripting Guide for more information on the Unity GUI System.

Particles

The grid is a good way to opaque objects for display, but treatments such as: fire, smoke and left after casting magic stars like not for you. Dealing with such words with Particle System will be better (particle system). Particle appears generally display process for presenting a fluid or gas (fluid or gas with a very small particle presenting, in order to render the whole more), such as: smoke. After particle creation, and sets the motion, the random parameter option, it can reveal amazing results. For example, you can emit particles with flame texture, at great speed from a launch point out to present the effects of the explosion. Waterfall acceleration effect may be a water particle texture in the end of a scene from a high drop point is achieved.
Star particle system
Unity particle system for creating a wide range of fluid effect is very suitable. Consult the manual Particle System to learn more.

Terrain Heightmaps

Terrain (topography) height map

You can not see the texture even for a place to implement many functions. A grayscale image, each pixel is a value which corresponds to the gradation value may be used when shader processing an image (the value range of 0.0 to 1.0, 0 black rgb: 0,0,0,1 white rgb: 1,1,1). Although the texture, but also can be used for other purposes, especially Terrain Heightmaps (terrain height map) is particularly suitable.

terrain surface is rendered grids, each surface point has a specific height. A terrain height values are significant survival Grid terrain (terrain mesh) with sample height, the height of each of the pixel gray values in the figure corresponds to the grid coordinates. This figure is not used for display, but for terrain topography into the grid coordinate values and to use.

Interestingly, no height map for display, but they are common language image processing techniques applied to highly value used. For example, with a noise (noise, is worth a difference between the relatively large height of adjacent pixels) of the height map to create such rocky terrain, the height FIG smooth blur can create smooth transitions topography, resulting in softer, undulating landscape.

More about Unity terrians terrain, consult the manual Script-Terrain .

Guess you like

Origin blog.csdn.net/linjf520/article/details/91042502