官术网_书友最值得收藏!

Adding properties to a shader

Properties of a shader are very important for the shader pipeline as they are the method that you use to let the artist or user of the shader assign textures and tweak your shader values. Properties allow you to expose GUI elements in a material's Inspector tab without you having to use a separate editor, which provides visual ways to tweak a shader. With your shader opened in your IDE of choice, look at the block of lines two through seven. This is called the Properties block of the script. Currently, it will have one texture property in it called _MainTex.

If you look at your material that has this shader applied to it, you will notice that there is one texture GUI element in the Inspector tab. These lines of code in our shader are creating this GUI element for us. Again, Unity has made this process very efficient in terms of coding and the amount of time it takes to iterate through changing your properties.

主站蜘蛛池模板: 香格里拉县| 屏东县| 湖口县| 甘孜| 昌黎县| 阜新| 河津市| 石楼县| 海门市| 淄博市| 筠连县| 和平区| 肃南| 上思县| 肇东市| 岚皋县| 呼伦贝尔市| 锡林郭勒盟| 玉屏| 广水市| 富民县| 临朐县| 榆树市| 锦屏县| 盐山县| 宜良县| 永吉县| 苏尼特左旗| 大冶市| 新密市| 莱阳市| 昌邑市| 满城县| 华池县| 宜君县| 浮山县| 蓝山县| 池州市| 盐源县| 中阳县| 莎车县|