通行证
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:语法如下:
Pass render_pass_name
{
Vertex = deferred_shader
Fragment = deferred_shader
}
You can check the current pass in the shader using the following defines:您可以使用以下定义检查着色器中的当前通道:
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 自定义通道)
- wireframe — wireframe passwireframe - wireframe 通行证
- visualizer_solid — visualizer solid passvisualizer_solid — visualizer 实心传球
- lightmap_data — lightmap baking passlightmap_data - lightmap baking 通行证
- deferred — deferred passdeferred - deferred 通行证
- auxiliary — auxiliary passauxiliary - auxiliary 通行证
- emission — emission passemission - emission 通行证
- refraction — refraction passrefraction - refraction 通行证
- reflection — reflection passreflection - reflection 通行证
- transparent_blur — transparent blur passtransparent_blur - transparent blur 通行证
- ambient — ambient passambient - ambient 通行证
- light_environment_probe — Environment Probe light passlight_environment_probe - Environment Probe 光通
- light_voxel_probe — Voxel Probe light passlight_voxel_probe - Voxel Probe 光通
- light_omni — omni-directional light passlight_omni - omni-directional 光通
- light_proj — projected light passlight_proj - projected light 通行证
- light_world — world light pass (called only when there are more than one WorldLight present in the world)light_world — world light pass(仅当世界上存在多个 WorldLight 时才调用)
- light_all — environment probe, omni-directional light, projected light, world light passeslight_all - environment probe, omni-directional light, projected light, world light 通过
- depth_pre_pass — native depth pre-passdepth_pre_pass-native depth 预通
- ms_depth — SRAA passms_depth - SRAA 通行证
- shadow — shadows passshadow - shadows 通行证
- post — post-process passpost - post-process 通行证
- object_post — object post-process passobject_post - object post-process 通行证
- procedural_decals — procedural decals passprocedural_decals - procedural decals 通行证
- procedural_fields — procedural fields passprocedural_fields - procedural fields 通行证
Usage Examples使用示例#
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
}
Besides the shader node you can specify the relative path (as a string) to the file containing shader code in UUSL:除了着色器节点,您还可以在 UUSL 中指定包含着色器代码的文件的相对路径(作为字符串):
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节点内编写内联着色器(将它们放在 #{ … }# 构造中):
Pass name
{
Geometry =
#{
// UUSL code
}#
}
Arguments论据#
definesdefines#
String
Definitions that will be passed to the shader.将传递给着色器的定义。
Usage Example:使用示例:
defines="MY_DEFINE=32,MY_DEFINE_2"
nodenode#
String
Specifies the type of a node for which this pass will be used (by default - all node types).指定将使用此通道的节点的类型(默认情况下 - 所有节点类型)。
Available values:可用值:
- DecalProj — projected decal
- DecalOrtho — orthographic decal
- DecalMesh — mesh decal
- LandscapeLayerMap — landscape layer map
- ObjectDummy — Dummy object
- ObjectDynamic — dynamic object
- ObjectMeshStatic — static mesh
- ObjectMeshCluster — mesh cluster
- ObjectMeshClutter — mesh clutter
- ObjectMeshSkinned — Skinned Mesh
- ObjectMeshDynamic — Dynamic Mesh
- ObjectMeshSplineCluster — mesh spline cluster
- ObjectLandscapeTerrain — Landscape Terrain
- ObjectTerrainGlobal — Global Terrain
- ObjectGrass — Grass
- ObjectParticles — particles
- ObjectBillboards — billboards
- ObjectVolumeBox — Volume Box
- ObjectVolumeSphere — Volume Sphere
- ObjectVolumeOmni — Volume Omni
- ObjectVolumeProj — Volume Projected
- ObjectGui — GUI object
- ObjectGuiMesh — GUI mesh
- ObjectWaterGlobal — Global Water
Usage Example使用示例#
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
}