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

How it works...

Even though we've used masks extensively in this recipe, we haven't had a chance to properly look at how they are set up until now, that is!

In essence, the textures that we've used as masks are images that contain a black and white picture stored in each of the image's RGB channels. As you probably already know, if you were to open up any image in your default photography editing software you would have the chance to take a look at the three individual image channels the picture is composed of the red, green, and blue ones, specifically. There might be an extra one, known as the Alpha, depending on the type of file that you are using. 

The composition of those file formats is actually beneficial to us, as we can use the separate channels as masks—just like we did in this recipe. The Lerp node, as we saw, blends between two inputs according to the values that we provide it. Since those values can be anything from 0 to 1, or black to white, that means that we have a perfect match in each of the image's RGB (and possibly Alpha) channels, since they are each a black and white image if taken separately:

In any case, using masks to drive the appearance of a material is often preferable to using multiple materials per mesh. This is because of the way the rendering pipeline works on the background. Without getting too technical, we could say that each new material makes the whole graphic operation more expensive, and even though we won't start noticing the effects until we have lots of different shaders in the scene, this is something that will eventually happen for almost any project bigger than a small example. 

主站蜘蛛池模板: 辉县市| 洛宁县| 平南县| 东阿县| 长泰县| 阳原县| 资中县| 瓦房店市| 伽师县| 浙江省| 伽师县| 富宁县| 门源| 余姚市| 兴和县| 桐庐县| 武定县| 泸西县| 东乡族自治县| 牟定县| 宁波市| 修文县| 城口县| 泽州县| 都兰县| 霞浦县| 全州县| 遵义市| 嘉定区| 南开区| 阆中市| 晋宁县| 阿克陶县| 湛江市| 佛冈县| 牙克石市| 德昌县| 玉田县| 乐安县| 天水市| 霸州市|