This page has been translated automatically.
Видеоуроки
Interface
Essentials
Advanced
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Landscape Tool
Sandworm
Использование инструментов редактора для конкретных задач
Extending Editor Functionality
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World Nodes
Звуковые объекты
Объекты поиска пути
Players
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
Унифицированный язык шейдеров UUSL
Плагины
Rebuilding the Engine Tools
GUI
Двойная точность координат
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
Работа с контентом
Оптимизация контента
Материалы
Art Samples
Tutorials

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)
  • wireframe — the wireframe pass
  • visualizer_solid — the visualizer solid pass
  • lightmap_data — the lightmap baking pass
  • deferred — the deferred pass
  • auxiliary — the auxiliary pass
  • emission — the emission pass
  • refraction — the refraction pass
  • reflection — the reflection pass
  • transparent_blur — the transparent blur pass
  • ambient — the ambient pass
  • light_environment_probe — the Environment Probe light pass
  • light_voxel_probe — the Voxel Probe light pass
  • light_omni — the omni-directional light pass
  • light_proj — the projected light pass
  • light_world — the world light pass (called only when there are more than one WorldLight present in the world)
  • light_all — the environment probe, omni-directional light, projected light, world light passes
  • depth_pre_pass — the native depth pre-pass
  • ms_depth — the SRAA pass
  • shadow — the shadows pass
  • post — the post-process pass
  • object_post — the object post-process pass
  • procedural_decals — the procedural decals pass
  • procedural_fields — the procedural 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: 24.08.2021
Build: ()