- Unreal Engine 4 Shaders and Effects Cookbook
- Brais Brenlla Ramos John P. Doran
- 301字
- 2021-06-24 14:12:19
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.
- Practical Data Analysis Cookbook
- Learning Java Functional Programming
- C語(yǔ)言程序設(shè)計(jì)案例式教程
- Python貝葉斯分析(第2版)
- 琢石成器:Windows環(huán)境下32位匯編語(yǔ)言程序設(shè)計(jì)
- 單片機(jī)應(yīng)用與調(diào)試項(xiàng)目教程(C語(yǔ)言版)
- 軟件測(cè)試技術(shù)指南
- 一本書(shū)講透Java線(xiàn)程:原理與實(shí)踐
- C# and .NET Core Test Driven Development
- Scratch趣味編程:陪孩子像搭積木一樣學(xué)編程
- MySQL 8從零開(kāi)始學(xué)(視頻教學(xué)版)
- Mastering JavaScript
- Learn Linux Quickly
- JSP應(yīng)用與開(kāi)發(fā)技術(shù)(第3版)
- Mastering Unity Scripting