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

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.

主站蜘蛛池模板: 吴旗县| 枣庄市| 重庆市| 和平区| 裕民县| 巴里| 库尔勒市| 买车| 建瓯市| 留坝县| 班玛县| 峨山| 金川县| 郸城县| 呼和浩特市| 雅安市| 花莲市| 宁化县| 金沙县| 巴南区| 新沂市| 通辽市| 那坡县| 汨罗市| 禹城市| 肇州县| 扎鲁特旗| 盱眙县| 商城县| 曲阳县| 察雅县| 荆州市| 鄱阳县| 织金县| 丽江市| 常熟市| 木兰县| 旌德县| 明星| 通州市| 新巴尔虎左旗|