This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
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
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

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:

ULON
Pass render_pass_name
{
	Vertex = deferred_shader
	Fragment = deferred_shader
}
Notice
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:

UUSL
PASS_<pass name>

Types of Passes#

  • custom_pass_name (string) — name of a custom rendering pass (up to 32 custom passes are supported)
  • wireframewireframe pass
  • visualizer_solidvisualizer solid pass
  • lightmap_datalightmap baking pass
  • deferreddeferred pass
  • auxiliaryauxiliary pass
  • emissionemission pass
  • refractionrefraction pass
  • reflectionreflection pass
  • transparent_blurtransparent blur pass
  • ambientambient pass
  • light_environment_probeEnvironment Probe light pass
  • light_voxel_probeVoxel Probe light pass
  • light_omniomni-directional light pass
  • light_projprojected light pass
  • light_worldworld light pass (called only when there are more than one WorldLight present in the world)
  • light_allenvironment probe, omni-directional light, projected light, world light passes
  • depth_pre_passnative depth pre-pass
  • ms_depthSRAA pass
  • shadowshadows pass
  • postpost-process pass
  • object_postobject post-process pass
  • procedural_decalsprocedural decals pass
  • procedural_fieldsprocedural fields pass

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
}
Notice
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:

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):

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

Arguments#

defines#

String

Definitions that will be passed to the shader.

Usage Example:

ULON
defines="MY_DEFINE=32,MY_DEFINE_2"
Notice
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:

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
}
Last update: 2022-12-14
Build: ()