Passes
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 specify various types of shaders in the pass (see the list of available shaders in UNIGINE).
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)
- wireframe — wireframe pass
- visualizer_solid — visualizer solid pass
- lightmap_data — lightmap baking pass
- deferred — deferred pass
- auxiliary — auxiliary pass
- emission — emission pass
- refraction — refraction pass
- reflection — reflection pass
- transparent_blur — transparent blur pass
- ambient — ambient pass
- light_environment_probe — Environment Probe light pass
- light_voxel_probe — Voxel Probe light pass
- light_omni — omni-directional light pass
- light_proj — projected light pass
- light_world — world light pass (called only when there are more than one WorldLight present in the world)
- light_all — environment probe, omni-directional light, projected light, world light passes
- depth_pre_pass — native depth pre-pass
- ms_depth — SRAA pass
- shadow — shadows pass
- post — post-process pass
- object_post — object post-process pass
- procedural_decals — procedural decals pass
- procedural_fields — procedural fields pass
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
}
If the vertex shader isn't specified, the default core/shaders/common/empty.vert shader will be used.
Besides the shader node you can specify the relative path (as a string) to the file containing shader code in 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 name
{
Geometry =
#{
// UUSL code
}#
}
Arguments#
defines#
String
Definitions that will be passed to the shader.
Usage Example:
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#
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
}
Last update:
2024-04-19
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)