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

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.

主站蜘蛛池模板: 柳江县| 望奎县| 瓦房店市| 丰宁| 永靖县| 广宁县| 普宁市| 杭锦后旗| 渭源县| 栖霞市| 定兴县| 巧家县| 通辽市| 广东省| 丰城市| 巴青县| 前郭尔| 云龙县| 大厂| 浑源县| 胶州市| 丹凤县| 西乡县| 莎车县| 广宗县| 东安县| 北海市| 大埔区| 阿克| 塔河县| 巴林左旗| 壶关县| 酒泉市| 镇巴县| 镇平县| 宁德市| 汨罗市| 陈巴尔虎旗| 奉新县| 达尔| 永胜县|