This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

UUSL Parameters

UUSL defines parameters that 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 parameterTypeDescription
s_viewportfloat4Viewport sizes: width, height, 1/width, 1/height.
s_depth_rangefloat4Depth range: near, far, 1/near, 1/far.
s_solid_colorfloat4Solid color.
s_reflection_colorfloat4Ambient color.
s_frameintThe current frame number.
s_taa_offsetfloat2TAA jittering

Camera Parameters

UUSL parameterTypeDescription
s_projectionfloat4x4Projection matrix.
s_imodelviewfloat4x4Inverse Model-View matrix.
s_old_imodelviewfloat4x4Old inverse Model-View matrix.
s_perspectivefloat4Perspective parameters: s_projection.m00, s_projection.m11, s_projection.m02 ,s_projection.m12
s_orthographicfloat4Orthographic parameters: s_projection.m00, s_projection.m11, s_projection.m03, s_projection.m13.
s_camera_positionfloat3Camera position.
s_camera_heightfloatz-component of the camera position.

ModelView Projection Parameters

UUSL parameterTypeDescription
s_modelview_projection_xfloat4First column of the Model-View projection matrix.
s_modelview_projection_yfloat4Second column of the Model-View projection matrix.
s_modelview_projection_wfloat4Fourth column of the Model-View projection matrix.

Polygon Front Parameters

UUSL parameterTypeDescription
s_polygon_frontfloatPolygon front.

Transform Parameters

UUSL parameterTypeDescription
s_transform[3]float4Transformation matrix.

Old Transform Parameters

UUSL parameterTypeDescription
s_old_transform[3]float4Old transformation matrix.

Light Parameters

UUSL parameterTypeDescription
s_light_positionfloat3The position of the Light Source
s_light_directionfloat3The light direction.
s_light_colorfloat4Light color.
s_light_iradiusfloat4The light inverse radius.
s_light_transformfloat4x4Light transformation matrix.
s_light_projectionfloat4x4Light projection matrix.
s_light_shadow_offsetfloat3Light shadow offset.
s_light_shadow_iradiusfloat4Light shadow inverse radius.
s_light_shadow_depth_biasfloat3Light shadow depth bias.
s_light_shadow_depth_rangefloat2Light shadow depth range.
s_light_shadow_projectionfloat4x4Light shadow projection matrix.

Light World Parameters

UUSL parameterTypeDescription
s_light_shadow_offsets[4]float4World light shadow offsets.
s_light_shadow_projections[4]float4x4World light shadow projection matrix.
s_light_shadow_splitsintWorld light shadow splits.

Scattering Parameters

UUSL parameterTypeDescription
s_scattering_sun_dirfloat3The direction of the sun scattering.
s_scattering_moon_dirfloat3The direction of the moon scattering.

Haze Parameters

UUSL parameterTypeDescription
s_haze_colorfloat4The color of the haze.
s_haze_max_distancefloatHaze maximum visible distance.
s_haze_densityfloatThe haze density.

Material Textures Parameters

UUSL parameterTypeDescription
s_material_textures[16]float4Material textures. Each 16 vectors contains: width, height, 1/width, 1/height of the texture slot.

Material Tessellation Parameters

UUSL parameterTypeDescription
s_material_tessellation_factorfloat4Tessellation factor.
s_material_tessellation_distancefloat3Tessellation distance.

Material Animation Parameters

UUSL parameterTypeDescription
s_material_animation_stemfloat4Animation stem.
s_material_old_animation_stemfloat4Old animation stem.
s_material_animation_leaffloat3Animation leaf.
s_material_old_animation_leaffloat3Old animation leaf.
s_material_animation_windfloat3Animation wind.

Material Ambient Parameters

UUSL parameterTypeDescription
s_material_reflection_transformfloat4x4Ambient transformation matrix.
s_material_reflection_centerfloat3Ambient center.
s_material_reflection_colorfloat3Ambient color.
s_material_reflection_radiusfloatAmbient radius.

Surface Parameters

UUSL parameterTypeDescription
s_surface_min_bound_spherefloat4Minimum size of the bounding sphere: center (x,y,z), radius(w).
s_surface_max_bound_spherefloat4Maximum size of the bounding sphere: center (x,y,z), radius(w).
s_surface_distancesfloat4Surface distances: min visible, max visible, imin fade, imax fade

FieldSpacer Parameters

UUSL parameterTypeDescription
s_field_spacer_num_spacersint2Number of FieldSpacer nodes.
s_field_spacer_parameters[24]float4FieldSpacer parameters.
s_field_spacer_transforms[24]float4FieldSpacer transforms.

FieldAnimation Parameters

UUSL parameterTypeDescription
s_field_animation_num_animationsint2Number of FieldAnimation nodes.
s_field_animation_parameters[24]float4FieldAnimation parameters.
s_field_animation_transforms[24]float4FieldAnimation transforms.
Last update: 2017-07-03
Build: ()