This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
创建内容
内容优化
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Fade By Depth 示例

This material graph sample demonstrates how to implement an effect of fading by depth.此材质图表示例演示了如何实现按深度衰减的效果。

The Mesh Transparent PBR material has white albedo color and the emission color controlled via the Parameters panel, the resulting appearance is controlled by opacity.Mesh Transparent PBR 材质具有白色反照率颜色和通过 Parameters 面板控制的发射颜色,生成的外观由opacity控制。

Resulting Opacity is defined by the combination of:结果 Opacity 由以下组合定义:

  • the Fresnel effect (glow in the areas along the edges). Here we find the angle between the mesh’s surface normal and view direction using the Dot Product node, which looks like a “glow” around the edge of the object. We can increase the Fresnel Power input to make this glow thinner and closer to the edges.菲涅耳效应(沿边缘区域发光)。在这里,我们找到了网格表面之间的角度普通的查看方向使用 Dot Product 节点,它看起来像围绕对象边缘的“发光”。我们可以增加 Fresnel Power 输入以使这种辉光更薄且更靠近边缘。
  • data on intersected geometry of the scene (shield contours shall be projected onto intersected geometry). Here we’ll handle the intersection effect with scene geometry. Via the Texture Buffer Depth Opacity node we get Scene Depth and subtract the object's depth (the distance to the Vertex Position in the view space), then we saturate the result in the [0.0f; 1.0f] range and subtract it from 1 to get an inverse intensity. This gives us values close to 1 in the area of intersection with the geometry of other objects. At this point we can add a Power node to be able to control the intensity using a value provided by a Slider node (enabling you to adjust float values via the Parameters panel in UnigineEditor).场景的相交几何数据(屏蔽轮廓应投影到相交几何上)。在这里,我们将使用场景几何处理相交效果。 通过 Texture Buffer Depth Opacity 节点我们得到 Scene Depth 并减去对象的深度(到视图空间中 Vertex Position 的距离),然后我们饱和[0.0f; 1.0f] 范围内的结果和减去它从 1 得到反强度。 这在与其他对象的几何形状相交的区域中为我们提供了接近 1 的值。此时,我们可以添加一个 Power 节点,以便能够使用 Slider 节点提供的值来控制强度(使您能够通过 UnigineEditor 中的 Parameters 面板调整浮点值)。

Both these components are added together and saturated.这两个组件都是添加一起和饱和的.

The result结果
最新更新: 2022-04-06
Build: ()