- Unreal Engine 4 Shaders and Effects Cookbook
- Brais Brenlla Ramos John P. Doran
- 432字
- 2021-06-24 14:12:06
How it works...
Translucent materials are really tricky to tackle in real-time renderers—and we are starting to see why. One hint that you might have been able to spot is that we aren't using a different shading model to create glasses. Instead, we are just using a different blend mode. So what are the differences between both of these concepts, and how is driving translucent materials through the latter indicative of their render complexity?
First of all, a shading model is a combination of mathematical expressions and logic that determines how models are shaded or painted with light. One such model will describe how light behaves when it comes into contact with a material that uses said shading method. We use as many different models as we need in order to describe the different materials we see on our daily lives—for example, the way light scatters through our skin or the way it does the same on a wooden surface. We need to be able to describe that situation in a way that our computer programs can tackle that problem.
With that in mind, you could think that we should have a different shading model to describe translucent materials. However, things are a bit more complex in real-time renderers as the calculations that we would need to have to realistically simulate that model are too expensive performance-wise. Being always on the lookout for efficiency and speed, the way that Unreal has decided to tackle this issue is by creating a different blend mode. But what is that?
You can think of blend modes as the way that the renderer combines the material that we have applied to a model on the foreground over what is happening on the background. Up until now, we've seen two different types— opaque and the translucent ones.
The opaque blend mode is the easiest one to comprehend: having an object in front of another will hide the second one. This is what happens with opaque materials in real life— wood, concrete, bricks, and so on. The translucent mode, however, lets the previously hidden object to be partially visible according to the opacity value that we feed into the appropriate slot.
This is a neat way of implementing translucency, but there are some caveats that the system introduces we have to be aware of. One such issue is that this blend mode doesn't support specularity, meaning that seeing reflections across the surface is a tricky effect that we will have to overcome later on. But don't worry, we'll definitely get there!
- Node.js Design Patterns
- 兩周自制腳本語(yǔ)言
- Learning SQLite for iOS
- Data Analysis with IBM SPSS Statistics
- OpenCV 4計(jì)算機(jī)視覺(jué)項(xiàng)目實(shí)戰(zhàn)(原書(shū)第2版)
- Babylon.js Essentials
- 軟件供應(yīng)鏈安全:源代碼缺陷實(shí)例剖析
- Kotlin開(kāi)發(fā)教程(全2冊(cè))
- Scala編程(第5版)
- FPGA嵌入式項(xiàng)目開(kāi)發(fā)實(shí)戰(zhàn)
- 從零開(kāi)始學(xué)Android開(kāi)發(fā)
- C語(yǔ)言程序設(shè)計(jì)
- R的極客理想:量化投資篇
- H5+移動(dòng)營(yíng)銷設(shè)計(jì)寶典
- Learning iOS Penetration Testing