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
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Animations-Related Classes
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
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Displacement 示例

This material graph sample demonstrates how to implement displacement mapping in your materials.此材质图表示例演示了如何在材质中实现置换贴图。

The Sample Texture node samples data from the tangent-space normal map taken from the normal Texture 2D node (enabling you to select a texture asset via the Parameters panel in UnigineEditor) in accordance with the default UV, normal vector components are passed to the Material node.Sample Texture 节点根据默认 UV 从法线 Texture 2D 节点获取的切线空间法线贴图中采样数据(使您可以通过 UnigineEditor 中的 Parameters 面板选择纹理资源),法线向量分量被传递到 Material 节点。

Albedo data for the material is specified directly via a Float node (casting to float3 is performed automatically).材质的反照率数据直接通过 Float 节点指定(自动转换为 float3)。

Data of a single-channel heightmap taken from the Texture 2D node and sampled by the Sample Texture node is passed via the x port adapter to the Add node which applies the displacement offset according the Offset Slider parameter node (enabling you to adjust a float value via the Parameters panel in UnigineEditor). The output is then multiplied (the Multiply node) by the displacement height value provided by the second Slider node and passed to the Tessellation Vertex Offset Tangent Space port of the material node via the 0,0,x port adapter (meaning that the value shall control displacement along the Z axis only, keeping X and Y as they are).Texture 2D 节点获取并由 Sample Texture 节点采样的单通道高度图的数据通过 x 传递端口适配器Add 节点,该节点根据 Offset Slider 参数节点应用位移偏移(使您能够通过 UnigineEditor 中的 Parameters 面板调整浮点值)。然后将输出(Multiply 节点)乘以第二个 Slider 节点提供的位移高度值,并通过 0,0,x 端口适配器传递到材质节点的 Tessellation Vertex Offset Tangent Space 端口(意味着该值应仅控制沿 Z 轴的位移,保持 X 和 Y 不变)。

Tessellation Factor for the material is specified using a Slider parameter node enabling you to adjust the value in the Parameters panel.材质的 Tessellation Factor 使用 Slider 参数节点指定,使您能够调整 Parameters 面板中的值。

The result结果
最新更新: 2024-01-18
Build: ()