This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资源工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
Materials and Shaders
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
创建内容
内容优化
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

纹理

The material texture is an image that maps to object's surfaces to provide color details and more.材质纹理是映射到对象表面以提供颜色细节等的图像。

The syntax is the following:语法如下:

ULON
TextureDimension name = "directory/name.format"  <attributes>
注意
If the name of the texture is not specified, then the name will be equal to the texture source type. The following declarations are equal:
ULON
Texture <source="gbuffer_normal" unit=0>
Texture gbuffer_normal <source="gbuffer_normal" unit=0>
如果未指定纹理的名称,则名称将等于纹理源类型。以下声明是相等的:
ULON
Texture <source="gbuffer_normal" unit=0>
Texture gbuffer_normal <source="gbuffer_normal" unit=0>

Types of Textures纹理类型#

  • Texture (or Texture2D) — a two-dimensional (2D) texture image where each element is a floatTexture (或 Texture2D) — 二维 (2D)质地每个元素都是浮点数的图像
  • TextureRamp — 2D curves in a form of a ramp textureTextureRamp — 纹理形式的 2D 曲线
  • Texture2DArray — a homogeneous array of 2D textures where each texture has the same data format, filtering type, and dimensions (including mipmap levels)Texture2DArray — 2D 纹理的同构数组,其中每个纹理具有相同的数据格式、过滤类型和维度(包括 mipmap 级别)
  • Texture2DUint — a two-dimensional texture image where each element is an unsigned intTexture2DUint — 一个二维纹理图像,其中每个元素都是一个无符号整数
  • Texture2DInt — a two-dimensional texture image where each element is an intTexture2DInt — 一个二维纹理图像,其中每个元素都是一个int
  • Texture3D — is a volume texture that contains 3D texelsTexture3D — 是包含 3D 纹素的体积纹理
  • TextureCube — an array of 2D textures with 6 elements for each face of the cubeTextureCube — 2D 纹理数组,立方体的每个面都有 6 元素
  • TextureCubeArray — an array of TextureCubeTextureCubeArrayTextureCube 的数组

Usage Examples使用示例#

ULON
BaseMaterial
{
	Texture diffuse = "core/textures/common/white.dds" <unit=0 auto_init=true>
}
UUSL
float4 texture_color = TEXTURE(tex_diffuse, IN_UV);

If auto_init is set to true, the texture will be declared automatically in the shader the following way:如果 auto_init 设置为 true,纹理将通过以下方式在着色器中自动声明:

UUSL
INIT_TEXTURE(0, tex_diffuse)

The texture can now be accessed in the shader via the tex_diffuse name. You don’t need to initialize it separately.现在可以通过 tex_diffuse 名称在着色器中访问纹理。您不需要单独初始化它。

The engine has some default textures. You can use shortcuts to reference them (instead of specifying the full path).引擎有一些默认纹理。您可以使用快捷方式来引用它们(而不是指定完整路径)。

Shortcut Full directory path
white core/textures/common/white.dds
black core/textures/common/black.dds
noise core/textures/common/noise.dds
normal core/textures/common/normal.dds
red core/textures/common/red.dds
grain core/textures/common/grain.dds
cube_white core/textures/common/environment_white.dds
environment_default core/textures/common/environment_default.dds

Arguments论据#

unitunit#

Integer

The texture slot to be used by this texture.此纹理要使用的纹理槽。

Available values:可用值:

  • 0..63. Only the first 16 slots can use textures with filters. If the unit argument is not specified, then the slot is assigned automatically according on the number of textures defined before:0..63。只有前 16 插槽可以使用纹理过滤器.如果未指定 unit 参数,则根据之前定义的纹理数量自动分配槽:

    ULON
    Texture2D // unit = 0 assigned by default
    Texture2D <unit=5> // unit = 5 assigned by user
    Texture3D  // unit = 2 assigned by default, because it is the third defined texture in the material

auto_initauto_init#

Boolean

Determines whether the texture should be automatically declared to the shader.确定是否应将纹理自动声明给着色器。

Available values:可用值:

  • false — not auto initialized, requires manual initializationfalse — 不自动初始化,需要手动初始化
  • true — auto initialized (by default)true — 自动初始化(默认

shader_nameshader_name#

String

Texture name in the shader. If specified the provided texture name is used, otherwise default naming logic is used.着色器中的纹理名称。如果指定,则使用提供的纹理名称,否则默认命名逻辑用来。

filterfilter#

String

The type of the filter for the texture sampler.纹理采样器的过滤器类型。

Available values:可用值:

  • point — point texture filtering (by default)point — 点纹理过滤(默认
  • linear — linear texture filteringlinear — 线性纹理过滤
  • bilinear — bilinear texture filteringbilinear — 双线性纹理过滤

sourcesource#

String

Defines the type of the source this texture comes from.定义此纹理的来源类型。

Available values:可用值:

  • asset — a standard image texture that is loaded from a disk (by default).asset — 从磁盘加载的标准图像纹理(默认情况下)。
  • custom — a custom type of texture that can be created via API methods.custom — 一种自定义类型的纹理,可以通过API 方法.
  • procedural — a texture of unknown format that is set manually.procedural — 手动设置的未知格式的纹理。
  • gbuffer_albedo — a texture that uses the G-buffer to store albedo values.gbuffer_albedo — 使用的纹理用于存储反照率值的 G 缓冲区.
  • gbuffer_shading — a texture that uses the G-buffer to store shading data.gbuffer_shading — 使用的纹理用于存储着色数据的 G 缓冲区.
  • gbuffer_normal — a texture that uses the G-buffer to store normal values.gbuffer_normal — 使用的纹理用于存储正常值的 G 缓冲区.
  • gbuffer_velocity — a texture that uses the G-buffer to store velocity values.gbuffer_velocity — 使用的纹理用于存储速度值的 G 缓冲区.
  • gbuffer_features — a texture that uses the G-buffer to store specific feature values.gbuffer_features — 使用的纹理用于存储特定特征值的 G 缓冲区.
  • auxiliary — an auxiliary texture that is used for different post effects (an auxiliary pass).auxiliary — 使用的辅助纹理用于不同的后期效果(辅助通道) .
  • refraction — a texture that stores refraction data.refraction — 一个纹理存储折射数据.
  • refraction_mask — a texture storing the refraction mask.refraction_mask — 纹理存储折射蒙版.
  • transparent_blur — a 1-channel R16F mask that stores intensity of blurring for transparent materials. The mask specifies where to blur the material.transparent_blur — 一个 1 通道 R16F 蒙版,用于存储透明材质的模糊强度。蒙版指定模糊材质的位置。
  • lights — a 2D array texture of the RG11B10F format that stores diffuse light in the first layer (RGB) and specular light in the second layer (RGB).lightsRG11B10F 格式的 2D 阵列纹理,在第一层 (RGB) 中存储漫反射光,在第二层 (RGB) 中存储镜面光。
  • gbuffer_material_mask — a texture that uses the G-buffer to store material mask data.gbuffer_material_mask — 使用的纹理用于存储材质遮罩数据的 G 缓冲区.
  • gbuffer_lightmap — a texture that uses the G-buffer to store lightmap values.gbuffer_lightmap — 使用的纹理用于存储光照贴图值的 G 缓冲区.
  • gbuffer_geodetic_flat_position — a texture that uses the G-buffer to store flat plane coordinates.gbuffer_geodetic_flat_position — 使用 G 缓冲区存储平面坐标的纹理。
  • bent_normal — an RG11B10F texture that stores bent normals (RGB) used for smooth ambient lighting.bent_normal — 一个 RG11B10F 纹理,存储用于平滑环境照明的弯曲法线 (RGB)。
  • ssao — a texture that stores SSAO (Screen Space Ambient Occlusion) data.ssao — 一个纹理存储 SSAO(Screen Space Ambient Occlusion)数据.
  • ssgi — a texture that stores SSGI (Screen Space Global Illumination) data.ssgi — 一个纹理存储 SSGI(屏幕空间全局照明)数据.
  • ssr — a texture that stores SSR (Screen Space Reflections) data.ssr — 一个纹理存储 SSR(屏幕空间反射)数据.
  • curvature — a texture that is used for the Screen-Space dirt effect (SSDirt).curvature — 用于的纹理屏幕空间污垢效果 (SSDirt) .
  • dof_mask — a texture that stores a DoF (Depth of Field) mask.dof_mask — 一个纹理存储一个 DoF(景深)掩码.
  • auto_exposure — an RG16F texture that stores intensity of the exposure (R) and luminance (G).auto_exposure — 存储曝光强度 (R) 和亮度 (G) 的 RG16F 纹理。
  • screen_color — a texture that stores screen color data and can be used for post effects.screen_color — 一个纹理存储屏幕颜色数据并可用于后期效果。
  • screen_color_old — a texture that stores Color Old (previous frame) data.screen_color_old — 一个纹理存储颜色旧(上一帧)数据.
  • screen_color_old_reprojection — a texture that stores Color Old (previous frame) reprojection data.screen_color_old_reprojection — 一个纹理存储旧颜色(上一帧)重投影数据.
  • normal_unpack — a texture that stores unpacked normals. Available for the following post-effects: SSR, SSGI, SSRTGI, Shadows screen space.normal_unpack — 存储的纹理解压法线.可用于以下后期效果:SSR、SSGI、SSRTGI、阴影屏幕空间。
  • current_depth — a texture that stores current depth data for all geometry on the scene.current_depth — 存储的纹理当前深度数据对于场景中的所有几何体。
  • opacity_depth — a texture that stores opacity depth data for opacity geometry and can be used for soft particles and volumetrics.opacity_depth — 存储的纹理不透明度几何的不透明度深度数据并可用于软粒子和体积。
  • linear_depth — a texture that stores linear depth data.linear_depth — 存储的纹理线性深度数据.
  • opacity_screen — a texture that stores the deferred composite and emission data.opacity_screen — 存储延迟复合排放数据。
  • light_image — a texture storing the light values provided by projected light sources.light_image — 存储投影光源提供的光值的纹理。
  • light_shadow_depth — a texture storing depth values (used to render shadows).light_shadow_depth — 存储深度值的纹理(用于渲染阴影)。
  • light_shadow_color — a texture used to render translucent shadows: G-channel stores depth values, R-channel - transparency values.light_shadow_color — 用于渲染半透明阴影的纹理:G 通道存储深度值,R 通道 - 透明度值。
  • transparent_environment_probes — a texture that stores environment probes rendered on transparent objects. Available only when the Multiple environment probes option is enabled.transparent_environment_probes — 存储的纹理在透明对象上渲染的环境探测器.仅在启用多个环境探测选项时可用。
  • reflection_2d — a texture storing reflection values (used to render 2D reflections).reflection_2d — 存储反射值的纹理(用于渲染 2D 反射)。
  • reflection_cube — a texture storing reflection values (used to render cube-mapped reflections).reflection_cube — 存储反射值的纹理(用于渲染立方体映射反射)。
  • scattering_sky_lut — a texture that stores sky scattering LUT data.scattering_sky_lut — 存储的纹理天空散射LUT数据.
  • wbuffer_constant_id — a constant texture, R32U. A texture of this type stores the ID value of the water mesh which is used to load the corresponding textures and parameters for it.wbuffer_constant_id — 一个常量纹理,R32U。这种类型的纹理存储的 ID 值水网它用于为其加载相应的纹理和参数。
  • wbuffer_diffuse — a diffuse texture. The diffuse color of the water is black, and diffuse texture is necessary for decals that will be displayed over the water surface.wbuffer_diffuse——一个漫反射纹理.水的漫反射颜色为黑色,而漫反射纹理对于将显示在水面上的贴花来说是必需的。
  • wbuffer_normal — a normal texture stores normal data for lighting, alpha channel stores mesh transparency values (can be used for soft intersections with water geometry).wbuffer_normal——一个正常纹理存储照明的法线数据,alpha 通道存储网格透明度值(可用于与水几何体的软交叉)。
  • wbuffer_water — a water texture, RG8. It is used to create the procedural foam mask. The mask shows where the foam will be depictedwbuffer_water——一个水纹理, RG8。它用于创建程序泡沫蒙版。面罩显示了将描绘泡沫的位置
  • wbuffer_ss_environment — an RGBA16 underwater fog texture that stores water bottom coloring values (RGB) and fog transparency (A).wbuffer_ss_environment — 一个 RGBA16水下雾纹理存储水底着色值 (RGB) 和雾透明度 (A)。
  • wbuffer_wu_mask — an underwater mask texture, RGB8. The underwater mask is used only for Global Water, since water mesh doesn't have an underwater modewbuffer_wu_mask — 一个水下面具纹理, RGB8。水下遮罩仅用于 Global Water,因为水网格没有水下模式
  • wbuffer_planar_reflection — a water gbuffer texture for the planar reflection.wbuffer_planar_reflection — 用于平面反射的水 gbuffer 纹理。
  • clouds_static_coverage — a texture that stores clouds static coverage data.clouds_static_coverage — 存储云静态覆盖数据的纹理。
  • clouds_dynamic_coverage — a texture that stores clouds dynamic coverage data.clouds_dynamic_coverage — 存储云动态覆盖数据的纹理。
  • clouds_screen — an RGBA16F texture into which clouds are rendered.clouds_screen — 渲染云的 RGBA16F 纹理。
  • terrain_global_depth — a texture that stores depth data for terrain global.terrain_global_depth — 存储地形全局深度数据的纹理。
  • terrain_global_flat_position — a texture that stores the flat position for terrain global.terrain_global_flat_position — 存储地形全局平面位置的纹理。
  • field_height_array — a heightmap texture that is used to create an additional height displacement for the water surface.field_height_array — 一个高度贴图纹理,用于为水面创建额外的高度位移。
  • field_shoreline_array — a field shoreline texture.field_shoreline_array——一个场海岸线纹理.
  • decal_depth — a texture that stores depth data for decals.decal_depth — 存储贴花深度数据的纹理。
  • decal_albedo — a texture that stores albedo color data for decals.decal_albedo — 存储贴花反照率颜色数据的纹理。
  • decal_normal — a texture that stores normal data for decals.decal_normal — 存储的纹理贴花的正常数据.
  • decal_shading — a texture that stores shading data for decals.decal_shading — 存储贴花着色数据的纹理。
  • curve — 2d curves stored in a form of a texture.curve — 以纹理形式存储的 2d 曲线。

    For this type of textures one or more two-dimensional curves (Curve2d) with some keys (CurveKey) must be specified.对于这种类型的纹理,必须指定一个或多个带有一些键 (CurveKey) 的二维曲线 (Curve2d)。

    Usage Example:使用示例:

    ULON
    TextureCurve emission_color if[emission_color_type == 1]  <unit=8>
    {
    	Curve2d red <repeat_mode_end=clamp repeat_mode_start=clamp>
    	{
    		CurveKey key <point=[0.0 1.0] left_tangent=[0 0] right_tangent=[0 0]>
    		CurveKey key <point=[1.0 1.0] left_tangent=[0 0] right_tangent=[0 0]>
    	}
    	Curve2d green <repeat_mode_end=clamp repeat_mode_start=clamp>
    	{
    		CurveKey key <point=[0.0 1.0] left_tangent=[0 0] right_tangent=[0 0]>
    		CurveKey key <point=[1.0 1.0] left_tangent=[0 0] right_tangent=[0 0]>
    	}
    	Curve2d blue <repeat_mode_end=clamp repeat_mode_start=clamp>
    	{
    		CurveKey key <point=[0.0 1.0] left_tangent=[0 0] right_tangent=[0 0]>
    		CurveKey key <point=[1.0 1.0] left_tangent=[0 0] right_tangent=[0 0]>
    	}
    }

    The syntax of Curve2d:Curve2d 的语法:

    ULON
    Curve2d name <arguments>

    Arguments:论据:

    • repeat_mode_end (string) — the mode for the beginning of the curve to be used for repeating the sequence defined by the key points of the curve (tiling curves).repeat_mode_end ( string ) — 曲线起点的模式,用于重复曲线关键点定义的序列(平铺曲线)。
    • repeat_mode_start (string) — the mode for the end of the curve to be used for repeating the sequence defined by the key points of the curve (tiling curves).repeat_mode_start ( string ) — 曲线末端的模式,用于重复曲线关键点定义的序列(平铺曲线)。

      Available values:可用值:

      • clamp — the value of the start or the end key is retained. Use this option if you don't want any changes before or after the effect created by the curve (by default).clamp — 保留开始或结束键的值。如果您不希望在曲线创建的效果之前或之后进行任何更改(默认情况下),请使用此选项。
      • loop — the curve is tiled. The created effect is repeated cyclically. If the values of the first and the last key are different, the transition between the curves will be abrupt.loop — 曲线平铺。创建的效果会循环重复。如果第一个键和最后一个键的值不同,则曲线之间的过渡会很突然。
      • ping_pong — every next curve section is a reflection of the previous curve section. The created effect is repeated in the forward-and-backward manner.ping_pong — 每个下一个曲线部分都是前一个曲线部分的反映。所产生的效果以前后方式重复。

    The syntaxis of CurveKey:CurveKey的语法:

    ULON
    CurveKey name <arguments>

    Arguments:论据:

    • point (float) — a new key point with the specified coordinates.point (float) — 具有指定坐标的新关键点。
    • left_tangent (float) — coordinates for the left tangent at the specified key point of the curve.left_tangent (float) — 曲线指定关键点的左切线坐标。
    • right_tangent (float) — coordinates for the right tangent at the specified key point of the curve.right_tangent (float) — 曲线指定关键点的右切线坐标。

anisotropyanisotropy#

Boolean

Enables the anisotropic filtering (works alongside with other types of texture filtering). By default 2x anisotropy is used.启用各向异性过滤(与其他类型的纹理过滤一起使用)。默认情况下使用 2x 各向异性。

Available values:可用值:

  • false — disablefalse — 禁用
  • true — enable (by default)true — 启用(默认

shadershader#

String

The type of shader to which this texture will be passed.此纹理将传递到的着色器类型。

Available values:可用值:

  • all — pass the texture to all shaders (by default)all — 将纹理传递给所有着色器(默认情况下
  • fragment — pass the texture to the fragment (pixel) shader onlyfragment — 仅将纹理传递给片段(像素)着色器

sharedshared#

Boolean

Enables the texture passing and binding to shaders.启用纹理传递和绑定到着色器。

Available values:可用值:

  • false — disablefalse — 禁用
  • true — enabletrue — 启用

internalinternal#

Boolean

Enables the mode when texture values are not saved for the inherited materials. Also, hides the texture in the Editor.未为继承的材质保存纹理值时启用该模式。此外,在编辑器中隐藏纹理。

Available values:可用值:

  • false — disable mode (by default)false — 禁用模式(默认
  • true — enable modetrue — 启用模式

editableeditable#

Boolean

A flag indicating if texture can be changed in the Parameters window or via API.指示纹理是否可以在 Parameters 窗口或通过API .

Available values:可用值:

  • false — unchangeablefalse — 不可更改
  • true — changeable (by default)true — 可更改(默认)

hiddenhidden#

Boolean布尔值

Hides the texture in the Editor. The default value is the same as the value of internal argument.在编辑器中隐藏纹理。默认值与内部的争论。

Available values:可用值:

  • false — show the texturefalse — 显示纹理
  • true — hide the texturetrue — 隐藏纹理

force_streamingforce_streaming#

Boolean

Disables the asynchronous streaming and loads the texture immediately as soon as it is required (rendering sequence stops until the texture is loaded).禁用异步流并在需要时立即加载纹理(渲染序列停止,直到加载纹理)。

Available values:可用值:

  • false — use the standard asynchronous streaming (by default)false — 使用标准异步流(默认
  • true — disable the asynchronous streaming and load the texture immediatelytrue — 禁用异步流并立即加载纹理

passpass#

Array of Strings

The set of passes to which the texture is passed. By default the texture is passed to all passes.纹理传递到的一组通道。默认情况下,纹理被传递到所有通道。

Available values:可用值:

注意

To make one or more passes use this state, write passes in square brackets and separate them with spaces. For example:要使一个或多个传递使用此状态,请将传递写在方括号中并用空格分隔它们。例如:

ULON
State wireframe_antialiasing <pass=[wireframe post custom_pass_name]>

wrapwrap#

String

The type of texture wrapping when the coordinate in the specified dimension [U V W] is out of the limits range [0..1].当指定维度 [U V W] 中的坐标超出限制范围 [0..1] 时的纹理环绕类型。

Available values:可用值:

  • clamp - clamps the coordinates [U V W] between 0 and 1 (the values higher than 1 are clamped to the edge resulting in a stretched edge pattern)clamp - 将坐标 [U V W] 夹在 01 之间(高于 1 的值被夹在边缘上,导致边缘图案拉伸)
  • clamp_x - clamps the U coordinate between 0 and 1 (the value higher than 1 are clamped to the edge resulting in a stretched edge pattern)clamp_x - 钳制 01 之间的 U 坐标(高于 1 的值被钳制到边缘,从而产生拉伸的边缘图案)
  • сlamp_y - clamps the W coordinate between 0 and 1 (the value higher than 1 are clamped to the edge resulting in a stretched edge pattern)сlamp_y - 将 W 坐标钳制在 01 之间(高于 1 的值被钳制到边缘,从而产生拉伸的边缘图案)
  • clamp_z - clamps the V coordinate between 0 and 1 (the value higher than 1 are clamped to the edge resulting in a stretched edge pattern)clamp_z - 将 V 坐标钳制在 01 之间(高于 1 的值会被钳制到边缘,从而产生拉伸的边缘图案)
  • border - returns the white color for UVW coordinates outside the [0..1] range border - 返回 [0..1] 范围之外的 UVW 坐标的白色
  • border_x - returns the color for the U coordinate outside the [0..1] range (color by default - black)border_x - 返回 [0..1] 范围外 U 坐标的颜色(默认颜色 - 黑色)
  • border_y - returns the color for the V coordinate outside the [0..1] range (color by default - black)border_y - 返回 [0..1] 范围之外的 V 坐标的颜色(默认颜色 - 黑色)
  • border_z - returns the color for the W coordinate outside the [0..1] range (color by default - black)border_z - 返回 [0..1] 范围外 W 坐标的颜色(默认颜色 - 黑色)
  • border_one - if specified, the return color is set to white for the border_x, border_y, and border_z modesborder_one - 如果指定,返回颜色设置为白色border_x ,border_y , 和border_z模式
  • repeat - repeats the texture image when coordinates are outside of the range [0..1] (by default)repeat - 当坐标超出范围 [0..1] 时重复纹理图像(默认

Usage Example:使用示例:

ULON
wrap = [clamp_x border_y clamp_z]

titletitle#

String

Specifies the texture title to be displayed in the Editor.指定要在编辑器中显示的纹理标题。

tooltiptooltip#

String

Specifies the tooltip for the texture to be displayed in the Editor.指定要在编辑器中显示的纹理的工具提示。

最新更新: 2022-10-10
Build: ()