This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
Sandworm (Experimental)
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Objects
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
UnigineScript
C++
C#
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

UUSL Parameters

UUSL defines parameters that are passed by the engine to the shader. These parameters can be used in your shader programs to get the necessary data from the engine.

Common Parameters#

UUSL parameter Type Description
s_viewport float4 Viewport sizes: width, height, 1/width, 1/height.
s_depth_range float4 Depth range: near, far, 1/near, 1/far.
s_solid_color float4 Solid color.
s_reflection_color float4 Ambient color.
s_frame int The current frame number.
s_taa float TAA flag.

Clutter/Cluster Parameters#

s_clutter_cluster_offset float3 Clutter/Cluster offset.
s_clutter_cluster_modelview float4x4 Clutter/Cluster modelview matrix.
s_clutter_cluster_old_modelview float4x4 Clutter/Cluster old modelview matrix.

Camera Parameters#

UUSL parameter Type Description
s_projection float4x4 Projection matrix.
s_iprojection float4x4 Inverse projection matrix.
s_oblique_frustum_plane float4 Oblique frustum culling plane.
s_modelview float4x4 Model-View matrix.
s_imodelview float4x4 Inverse Model-View matrix.
s_old_imodelview float4x4 Old inverse Model-View matrix.
s_old_imodelview_delta float4x4 Delta of old inverse Model-View matrix.
s_camera_offset float3 Camera position.
s_camera_position float3 Camera position in world space.
s_camera_direction float3 Camera direction vector.
s_projection_row_0 float3 First row of projection matrix.
s_projection_row_1 float3 Second row of projection matrix.
s_projection_row_2 float3 Third row of projection matrix.
s_camera_projection float4x4 Projection matrix of camera (not renderstate). For example: post have ortographic projection, but camera projection is perspective.
s_camera_iprojection float4x4 Inverse projection matrix of camera (not renderstate). For example: post have ortographic projection, but camera projection is perspective.

Cube Render Parameters#

UUSL parameter Type Description
s_iface_rotation[6] float4x4 Inverted cubemap face rotation parameter.

ModelView Projection Parameters#

UUSL parameter Type Description
s_modelview_projection_x float4 First column of the Model-View projection matrix.
s_modelview_projection_y float4 Second column of the Model-View projection matrix.
s_modelview_projection_w float4 Fourth column of the Model-View projection matrix.
s_modelview_projection_old_x float4 First column of the old Model-View projection matrix.
s_modelview_projection_old_y float4 Second column of the old Model-View projection matrix.
s_modelview_projection_old_z float4 Third column of the old Model-View projection matrix.
s_modelview_untranslated float4x4 Model-View matrix without translate (only rotation).

Polygon Front Parameters#

UUSL parameter Type Description
s_polygon_front float Polygon front.

Transform Parameters#

UUSL parameter Type Description
s_transform[3] float4 Model-View matrix.

Old Transform Parameters#

UUSL parameter Type Description
s_old_transform[3] float4 Old Model-View matrix.

Light Parameters#

UUSL parameter Type Description
s_light_position float3 The position of the Light Source
s_light_direction float3 The light direction.
s_light_color float4 Light color.
s_light_attenuation float4 Light attenuation.
s_light_shape float4 The shape of the light source.
s_light_transform float4x4 Light Model-View matrix.
s_light_projection float4x4 Light projection matrix.
s_light_penumbra float Project light source penumbra parameter.

Light Environment Probe Parameters#

UUSL parameter Type Description
s_light_reflection_color float4 Environment probe's reflection color.
s_light_ambient_color float4 Environment Probe's ambient color.
s_light_ambient_contrast float Environment Probe's ambient contrast.
s_light_mipmaps float Environment Probe's number of mipmaps.
s_light_box_gloss_corners float Environment Probe's Gloss Corners.
s_light_box_gi float Environment Probe's Global Illumination.

Light Environment Probe Parameters for Forward Rendering Pass#

UUSL parameter Type Description
s_light_probe_position float3 Environment probe's position.
s_light_probe_is_box_projection float Environment probe's Box Projection value.
s_light_probe_is_sun_light_color float Environment probe's Use Sun Color value.
s_light_probe_transform float4x4 Environment probe's transform matrix.

Light Voxel Probe Parameters#

UUSL parameter Type Description
s_light_voxel_probe_data float4 Voxel probe's data.

Light Shadow Parameters#

s_light_shadow_depth_bias float3 Light shadow depth bias.
s_light_shadow_depth_range float2 Light shadow depth range.
s_light_shadow_projection float4x4 Light shadow projection matrix.
s_light_shadow_softness float Light shadow softness value.
s_light_shadow_softness_noise float Light shadow softness noise value.
s_light_shadow_sharpness float Light shadow sharpness value.
s_light_shadow_iradius float Light shadow inverse radius.
s_light_shadow_fade float Light shadow fade value.

Light Cascades Parameters#

UUSL parameter Type Description
s_light_cascades_num int World light shadow cascades number.
s_light_cascades_projection[4] float4x4 World light shadow cascades projection matrix.
s_light_cascades_bias[4] float World light shadow cascades bias.

Screen Space Shadows Parameters#

UUSL parameter Type Description
s_shadow_screen_space_num_rays int Screen space shadows num rays value.
s_shadow_screen_space_num_steps int Screen space shadows num steps value.
s_shadow_screen_space_noise_ray float Screen space shadows noise ray value.
s_shadow_screen_space_noise_step float Screen space shadows noise step value.
s_shadow_screen_space_step_size float Screen space shadows step size value.
s_shadow_screen_space_threshold float Screen space shadows threshold value.
s_shadow_screen_space_softness float Screen space shadows softness value.

Scattering Parameters#

UUSL parameter Type Description
s_scattering_sun_dir float3 The direction of the sun scattering.
s_scattering_moon_dir float3 The direction of the moon scattering.

Environment Parameters#

UUSL parameter Type Description
s_environment_ambient_intensity float Environment ambient intensity parameter.
s_environment_reflection_intensity float Environment reflection intensity parameter.

Haze Parameters#

UUSL parameter Type Description
s_haze_color float4 The color of the haze.
s_haze_max_distance float Haze maximum visible distance.
s_haze_density float The haze density.

Sky Parameters#

UUSL parameter Type Description
s_sky_up float3 Sky up vector.
s_sky_altitude float Sky altitude.
s_sky_transform float4x4 Sky transform matrix.
s_moon_rotation float4x4 Moon rotation matrix.
s_sun_rotation float4x4 Sun rotation matrix.

Material Textures Parameters#

UUSL parameter Type Description
s_material_textures[NUM_TEXTURES] float4 Material textures. Each set of vectors contains: width, height, 1/width, 1/height of the texture slot.

Material Tessellation Parameters#

UUSL parameter Type Description
s_material_tessellation_factor float4 Tessellation factor.
s_material_tessellation_distance float3 Tessellation distance.

Material Animation Parameters#

UUSL parameter Type Description
s_material_animation_stem float4 Animation stem.
s_material_old_animation_stem float4 Old animation stem.
s_material_animation_leaf float3 Animation leaf.
s_material_old_animation_leaf float3 Old animation leaf.
s_material_animation_wind float3 Animation wind.

Material Reflection Parameters#

UUSL parameter Type Description
s_material_reflection_transform float4x4 Reflection transformation matrix.

Material Deferred Parameters#

UUSL parameter Type Description
s_material_mask int Material mask.
s_material_backface_mask int Material backface mask.

Surface Parameters#

UUSL parameter Type Description
s_surface_min_bound_sphere float4 Minimum size of the bounding sphere: center (x,y,z), radius(w).
s_surface_max_bound_sphere float4 Maximum size of the bounding sphere: center (x,y,z), radius(w).
s_surface_distances float4 Surface distances: min visible, max visible, imin fade, imax fade

FieldSpacer Parameters#

UUSL parameter Type Description
s_field_spacer_num_spacers int2 Number of FieldSpacer nodes.
s_field_spacer_parameters[RENDER_MAX_FIELD_SPACERS] float4 FieldSpacer parameters.
s_field_spacer_transforms[RENDER_MAX_FIELD_SPACERS*3] float4 FieldSpacer transforms.
Notice
To use these parameters, FIELD_SPACER should be defined.

FieldAnimation Parameters#

UUSL parameter Type Description
s_field_animation_num_animations int2 Number of FieldAnimation nodes.
s_field_animation_parameters[RENDER_MAX_FIELD_ANIMATIONS*3] float4 FieldAnimation parameters.
s_field_animation_transforms[RENDER_MAX_FIELD_ANIMATIONS*3] float4 FieldAnimation transforms.
s_field_animation_old_transforms[RENDER_MAX_FIELD_ANIMATIONS*3] float4 FieldAnimation old transforms.
Notice
To use these parameters, FIELD_ANIMATION should be defined.

FieldHeight Parameters#

UUSL parameter Type Description
s_field_height_num_heights int2 Number of FieldHeight nodes.
s_field_height_projections[RENDER_MAX_FIELD_HEIGHTS] float4x4 FieldHeight projections.
s_field_height_planes[RENDER_MAX_FIELD_HEIGHTS] float4 FieldHeight planes.
s_field_height_parameters[RENDER_MAX_FIELD_HEIGHTS] float4 FieldHeight parameters.
s_field_height_texture_ids[RENDER_MAX_FIELD_HEIGHTS] float FieldHeight texture ids.
Notice
To use these parameters, FIELD_HEIGHT should be defined.

FieldShoreline Parameters#

UUSL parameter Type Description
s_field_shoreline_num_shorelines int2 Number of FieldShoreline nodes.
s_field_shoreline_projections[RENDER_MAX_FIELD_SHORELINES] float4x4 FieldShoreline projections.
s_field_shoreline_planes[RENDER_MAX_FIELD_SHORELINES] float4 FieldShoreline planes.
s_field_shoreline_parameters[RENDER_MAX_FIELD_SHORELINES] float4 FieldShoreline parameters.
s_field_shoreline_texture_ids[RENDER_MAX_FIELD_SHORELINES] float FieldShoreline texture ids.
Notice
To use these parameters, FIELD_SHORELINE should be defined.

Geodetic Pivot Parameters#

UUSL parameter Type Description
s_geodetic_radius double Geodetic radius.
s_geodetic_iradius double Inverse geodetic radius.
s_geodetic_iscale double3 Inverse geodetic scale.
s_geodetic_radius_mul_scale double3 Geodetic radius scale.
s_geodetic_origin_sphere_rotation double4x4 Rotation matrix of geodetic origin sphere.
s_geodetic_pivotview double4x4 Geodetic pivot view.
s_geodetic_ipivotview double4x4 Inverse geodetic pivot view.
s_geodetic_old_ipivotview double4x4 Old inverse geodetic pivot view.
s_geodetic_planetview double4x4 Geodetic planet view.
s_geodetic_iplanetview double4x4 Inverse geodetic planet view.
s_geodetic_old_planetview double4x4 Old geodetic planet view.
s_geodetic_camera_flat_position double3 Geodetic camera flat position.
s_geodetic_camera_flat_height float Geodetic camera flat height.
s_geodetic_position_to_normal float4x4 Geodetic matrix of transform from position to normal.
s_geodetic_pivot_rotation float4x4 View-space rotation matrix.
s_geodetic_camera_flat_rotation float4x4 Geodetic camera flat rotation.
s_geodetic_camera_flat_irotation float4x4 Inverse geodetic camera flat rotation.

Constant Parameters#

UUSL parameter Type Description
s_constant_id int Constant id.
s_constant_data[NUM_DEFERRED_CONSTANTS/4] float Constant data.

Spline Parameters#

UUSL parameter Type Description
s_spline_start_point[RENDER_MESH_NUM_INSTANCES] float4 Spline start point position.
s_spline_start_tangent[RENDER_MESH_NUM_INSTANCES] float4 Spline start point tangent.
s_spline_start_up[RENDER_MESH_NUM_INSTANCES] float4 Spline start point up vector.
s_spline_end_point[RENDER_MESH_NUM_INSTANCES] float4 Spline end point position.
s_spline_end_tangent[RENDER_MESH_NUM_INSTANCES] float4 Spline end point tangent.
s_spline_end_up[RENDER_MESH_NUM_INSTANCES] float4 Spline end point up vector.
s_spline_min_max_up_angle[RENDER_MESH_NUM_INSTANCES] float4 Spline min and max up angle.
s_spline_t_values[RENDER_MESH_NUM_INSTANCES] float2 Spline tag values.
s_spline_forward_axis[RENDER_MESH_NUM_INSTANCES] int Spline forward axis value.
Last update: 2020-11-24
Build: ()