Unity Shader Getting Started Essentials Basic Texture

Recently, I am reading the book Unity Shader Introductory Essentials, and I plan to attack the area of ​​graphics, come on

1. Texture mapping coordinates are also called UV coordinates, and usually the range is normalized to [0,1]. It should be noted that there are differences between OpenGL and DirectX in the two-dimensional space coordinate system, but Unity has already handled it for us. The problem is that it conforms to the tradition of OpenGL, that is, the origin is in the lower left corner, and the DX origin is in the upper left corner.

2. In Unity, the property of declaring a certain texture has a different naming convention, that is, the texture name_ST , for example,
where ST is the abbreviation of scaling (scale) and translation (translation). Texture name _ST. xy stores the zoom , and the texture name _ST.zw stores the offset value.

3. There is an important property Wrap Mode under the texture picture in the Inspector panel.
I am using the 2019.2 version now, so there are a lot of options below. The 2015 version should be just two Repeat and Clamp, both of which have texture coordinates beyond [0,1] The choice after the range, let’s talk about the difference between the two.
Repeat mode is that when the texture coordinate exceeds 1, it will take its decimal place and the integer part will be discarded.
Clamp mode is to limit the range to [0,1] greater than 1. 1, less than 0 takes 0.

Guess you like

Origin blog.csdn.net/Marccco/article/details/105393963