This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
Version Control
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
统一的Unigine着色器语言 UUSL (Unified UNIGINE Shader Language)
Plugins
材质和着色器
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

通行证

Specifies shaders and their defines to be used during the specific pass. The shaders are compiled for the specified render pass using the defines specified in attributes.指定要在特定通道期间使用的着色器及其定义。使用属性中指定的定义为指定的渲染通道编译着色器。

The syntax is the following:语法如下:

ULON
Pass render_pass_name
{
	Vertex = deferred_shader
	Fragment = deferred_shader
}
注意
You can specify various types of shaders in the pass (see the list of available shaders in UNIGINE).您可以在通道中指定各种类型的着色器 (见清单UNIGINE 中可用的着色器)。

You can check the current pass in the shader using the following defines:您可以使用以下定义检查着色器中的当前通道:

UUSL
PASS_<pass name>

Types of Passes
通行证类型#

  • custom_pass_name (string) — name of a custom rendering pass (up to 32 custom passes are supported)custom_pass_name ( string ) — 自定义渲染通道的名称(最多支持 32 自定义通道)
  • wireframewireframe passwireframe - wireframe 通行证
  • visualizer_solidvisualizer solid passvisualizer_solidvisualizer 实心传球
  • lightmap_datalightmap baking passlightmap_data - lightmap baking 通行证
  • deferreddeferred passdeferred - deferred 通行证
  • auxiliaryauxiliary passauxiliary - auxiliary 通行证
  • emissionemission passemission - emission 通行证
  • refractionrefraction passrefraction - refraction 通行证
  • reflectionreflection passreflection - reflection 通行证
  • transparent_blurtransparent blur passtransparent_blur - transparent blur 通行证
  • ambientambient passambient - ambient 通行证
  • light_environment_probeEnvironment Probe light passlight_environment_probe - Environment Probe 光通
  • light_voxel_probeVoxel Probe light passlight_voxel_probe - Voxel Probe 光通
  • light_omniomni-directional light passlight_omni - omni-directional 光通
  • light_projprojected light passlight_proj - projected light 通行证
  • light_worldworld light pass (called only when there are more than one WorldLight present in the world)light_worldworld light pass(仅当世界上存在多个 WorldLight 时才调用)
  • light_allenvironment probe, omni-directional light, projected light, world light passeslight_all - environment probe, omni-directional light, projected light, world light 通过
  • depth_pre_passnative depth pre-passdepth_pre_pass-native depth 预通
  • ms_depthSRAA passms_depth - SRAA 通行证
  • shadowshadows passshadow - shadows 通行证
  • postpost-process passpost - post-process 通行证
  • object_postobject post-process passobject_post - object post-process 通行证
  • procedural_decalsprocedural decals passprocedural_decals - procedural decals 通行证
  • procedural_fieldsprocedural fields passprocedural_fields - procedural fields 通行证

Usage Examples
使用示例#

ULON
Pass deferred 
{
	Vertex = deferred_shader
	Fragment = deferred_shader
}
	
Pass shadow 
{
	Vertex = deferred_shader
	Fragment = deferred_shader
}

Pass depth_pre_pass 
{
	Vertex = depth_pre_pass_shader
	Fragment = depth_pre_pass_shader
}
	
Pass ms_depth 
{
	Vertex = depth_pre_pass_shader
	Fragment = depth_pre_pass_shader
}
注意
If the vertex shader isn't specified, the default core/shaders/common/empty.vert shader will be used.如果未指定顶点着色器,将使用默认的 core/shaders/common/empty.vert 着色器。

Besides the shader node you can specify the relative path (as a string) to the file containing shader code in UUSL:除了着色器节点,您还可以在 UUSL 中指定包含着色器代码的文件的相对路径(作为字符串):

ULON
Pass lightmap_data
{
	Vertex = "core/shaders/mesh/lightmap_data.shader"
	Fragment = "core/shaders/mesh/lightmap_data.shader"
}

It is also possible to write inline shaders inside the Pass node (put them inside the #{ … }# construct):也可以在Pass节点内编写内联着色器(将它们放在 #{ … }# 构造中):

ULON
Pass name
{
	Geometry = 
	#{
		// UUSL code
	}#
}

Arguments
论据#

defines
defines#

String

Definitions that will be passed to the shader.将传递给着色器的定义。

Usage Example:使用示例:

ULON
defines="MY_DEFINE=32,MY_DEFINE_2"
注意
You can list multiple defines separated by a comma without any space. To specify a value for a define, write the value after the equals sign symbol.您可以列出多个用逗号分隔的定义,不带任何空格。要为定义指定一个值,请将值写在等号符号之后。

node
node#

String

Specifies the type of a node for which this pass will be used (by default - all node types).指定将使用此通道的节点的类型(默认情况下 - 所有节点类型)。

Available values:可用值:

Usage Example
使用示例#

ULON
Pass ambient <defines="BOX,HEIGHT" node=ObjectVolumeBox>
{
	Vertex = volume_shader
	Fragment = volume_shader
}

Pass ambient <defines="SPHERE,HEIGHT" node=ObjectVolumeSphere>
{
	Vertex = volume_shader
	Fragment = volume_shader
}
最新更新: 2024-08-16
Build: ()