3.1.3 Texture Units

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 16

3.1.

3 Texture Units

Here are the attributes you can use in a 'texture_unit' section of a .material script:

Available Texture Layer Attributes


 texture
 anim_texture
 cubic_texture
 tex_coord_set
 tex_address_mode
 filtering
 max_anisotropy
 colour_op
 alpha_rejection
 colour_op_ex
 colour_op_multipass_fallback
 alpha_op_ex
 env_map
 scroll
 scroll_anim
 rotate
 rotate_anim
 scale
 wave_xform

You can also use a nested 'texture_source' section in order to use a special add-in as a source of
texture data, See section 6. External Texture Sources for details.

你可以使用内嵌的'texture_source'段,为了使用特定的附加项作为纹理数据的来源,详见 6.
External Texture Sources。

Attribute Descriptions
texture

Sets the name of the static texture image this layer will use.
这个层用于设定静态纹理图像名。

Format: texture <texturename> [<type>]

Example: texture funkywall.jpg


This setting is mutually exclusive with the anim_texture attribute. Note that the texture file cannot
include spaces. Those of you Windows users who like spaces in filenames, please get over it and
use underscores instead.

这个设置同 anim_texture 属性互助的独占。注意:纹理文件不能包括空格。那些喜欢使用空


格做文件名的,请去掉他们,使用下划线来代替。

The 'type' parameter allows you to specify a the type of texture to create - the default is '2d', but
you can override this; here's the full list:

'type'参数允许你确定创建纹理的类型――缺省是’2d’,但你可以重载它;下面是完全的链
表:

1d
A 1-dimensional texture; that is, a texture which is only 1 pixel high. These kinds of
textures can be useful when you need to encode a function in a texture and use it as a
simple lookup, perhaps in a fragment program. It is important that you use this setting
when you use a fragment program which uses 1-dimensional texture coordinates, since
GL requires you to use a texture type that matches (D3D will let you get away with it, but
you ought to plan for cross-compatibility). Your texture widths should still be a power of
2 for best compatibility and performance.

1 维纹理;它是只使用 1 个像素高度的纹理。当你需要在纹理中给功能编码和用它
作为一个简单的查找时,这种纹理会很有帮助。当你使用 1 维纹理逻辑的段编程时,
使用这个设置是很重要的,因为 GL 需要你使用纹理类型来匹配(D3D 不需要你使
用它,但你也应该为跨平台的兼容性考虑)。你的纹理宽度应该是 2 的幂指数,这
样会有比较好的兼容性和性能。

2d
The default type which is assumed if you omit it, your texture has a width and a height,
both of which should preferably be powers of 2, and if you can, make them square
because this will look best on the most hardware. These can be addressed with 2D texture
coordinates.

如果你忽略它,这就是缺省的类型,你的纹理会有宽度和高度,它们都应该是 2 的
幂指数,并且如果可能就使它们平方,因为这样会在大部分硬件中表现更好。可以
通过 2D 纹理坐标定位。

cubic
This texture is made up of 6 2D textures which are pasted around the inside of a cube.
Can be addressed with 3D texture coordinates and are useful for cubic reflection maps
and normal maps.
这个纹理是由 6 个粘贴在立方体内表面的 2D 纹理组成的。可以使用 3D 纹理坐标定
位并对立方体反射映射和法线映射很有用。
Default: none

anim_texture

Sets the images to be used in an animated texture layer. In this case an animated texture layer
means one which has multiple frames, each of which is a separate image file. There are 2 formats,
one for implicitly determined image names, one for explicitly named images.

设置一个用于动画纹理层的图像。在这种情况下,一个动画纹理层意味着含多帧,并且每
一帧都是一个独立的图像文件。有两种格式:一种是隐式的决定图像名,另一种式显示的
命名图像。

Format1 (short): anim_texture <base_name> <num_frames> <duration>

Example: anim_texture flame.jpg 5 2.5

This sets up an animated texture layer made up of 5 frames named flame_0.jpg, flame_1.jpg,
flame_2.jpg etc, with an animation length of 2.5 seconds (2fps). If duration is set to 0, then no
automatic transition takes place and frames must be changed manually in code.

这建立了一个由 flame_0.jpg, flame_1.jpg, flame_2.jpg 等命名的 5 帧组成的动画纹理层,动


画长度是 2.5 秒(2fps)。如果持续时间设置为 0,那将没有自动变换发生并且只能在代码
中手动改变帧。

Format2 (long): anim_texture <frame1> <frame2> ... <duration>

Example: anim_texture flamestart.jpg flamemore.png flameagain.jpg moreflame.jpg lastflame.tga


2.5

This sets up the same duration animation but from 5 separately named image files. The first format
is more concise, but the second is provided if you cannot make your images conform to the
naming standard required for it.

这建立了相同持续时间的动画,但是由 5 个独立的命名的图像文件组成。第一种格式更简介,
但如果你不能使你的图像遵循命名标准请求,第二种可以提供。

Default: none

cubic_texture

Sets the images used in a cubic texture, i.e. one made up of 6 individual images making up the
faces of a cube. These kinds of textures are used for reflection maps (if hardware supports cubic
reflection maps) or skyboxes. There are 2 formats, a brief format expecting image names of a
particular format and a more flexible but longer format for arbitrarily named textures.
设置在立法体纹理中使用的图像,例如,一个由 6 个独立图像组成的立方体。这种纹理用于
反射映射(如果硬件支持立方体反射映射)或天空盒。有两种格式,一种更简单,期望特
定格式的图像名字,另一种更灵活,但相对于任意命名纹理格式较长。

Format1 (short): cubic_texture <base_name> <combinedUVW|separateUV>

The base_name in this format is something like 'skybox.jpg', and the system will expect you to
provide skybox_fr.jpg, skybox_bk.jpg, skybox_up.jpg, skybox_dn.jpg, skybox_lf.jpg, and
skybox_rt.jpg for the individual faces.

这种格式的基本名字类似于'skybox.jpg',系统将会期望你提供 skybox_fr.jpg, skybox_bk.jpg,


skybox_up.jpg, skybox_dn.jpg, skybox_lf.jpg, and skybox_rt.jpg 用于独立的面。

Format2 (long): cubic_texture <front> <back> <left> <right> <up> <down> <combinedUVW|
separateUV>

In this case each face is specified explicitly, incase you don't want to conform to the image naming
standards above.

这种情况下每一个面是显示的确认,你不用遵循上面的标准图像命名。

In both cases the final parameter means the following:


combinedUVW
The 6 textures are combined into a single 'cubic' texture map which is then addressed
using 3D texture coordinates with U, V and W components. Necessary for reflection maps
since you never know which face of the box you are going to need. Note that not all cards
support cubic environment mapping.

6 个纹理被组合到一个单独的立方体纹理映射中,它使用 3D 纹理坐标 U、V、W 来


定位。对于反射映射是必需的,因为你不知道你要用盒子的哪个面。注意:不是所
有的图形卡都支持立方体环境映射。

separateUV
The 6 textures are kept separate but are all referenced by this single texture layer. One
texture at a time is active (they are actually stored as 6 frames), and they are addressed
using standard 2D UV coordinates. This type is good for skyboxes since only one face is
rendered at one time and this has more guaranteed hardware support on older cards.

6 个纹理保持独立,但都被一个单独的纹理图层引用。一次一个纹理激活(他们可
能当成 6 个帧存储的),并使用标准 2D UV 坐标定位。这种类型很适合天空盒,因
为一次只有一个面被渲染,并且这种方法在大部分老式图形卡上也有支持。

Default: none
tex_coord_set

Sets which texture coordinate set is to be used for this texture layer. A mesh can define multiple
sets of texture coordinates, this sets which one this material uses.

设置纹理层使用的纹理坐标集合。一个 mesh 可以定义多个纹理坐标集合,材质也可以使用


这些集合。

Format: tex_coord_set <set_num>

Example: tex_coord_set 2

Default: tex_coord_set 0

tex_address_mode

Defines what happens when texture coordinates exceed 1.0 for this texture layer.

定义当纹理层的纹理坐标超过 1.0 时做什么。

Format: tex_address_mode <wrap|clamp|mirror>

wrap
Any value beyond 1.0 wraps back to 0.0. Texture is repeated.
任何超出 1.0 的值回到 0.0。纹理将被重复。

clamp
Values beyond 1.0 are clamped to 1.0. Texture 'streaks' beyond 1.0 since last line of pixels
is used across the rest of the address space. Useful for textures which need exact coverage
from 0.0 to 1.0 without the 'fuzzy edge' wrap gives when combined with filtering.
超过 1.0 的值将被锁定到 1.0。纹理'streaks'超过 1.0,因为上一行的像素被用于穿过
地址空间的剩余部分。当带过虑的合成时,对于需要确切从 0.0 到 1.0 覆盖的但没
有'fuzzy edge'包装的纹理很有用。

mirror
Texture flips every boundary, meaning texture is mirrored every 1.0 u or v
遇到边界纹理反转,意味着 U 或 V 到 1.0 时纹理要被镜像。

Default: tex_address_mode wrap

filtering

Sets the type of texture filtering used when magnifying or minifying a texture. There are 2 formats
to this attribute, the simple format where you simply specify the name of a predefined set of
filtering options, and the complex format, where you individually set the minification,
magnification, and mip filters yourself.

设置当放大或缩小纹理时哪种纹理过虑类型被使用。这个属性有两种格式,简单的格式是
当你完全确认过虑选项的预定义集合的名字时用,另一种复杂的格式是当你独立的设置放
大、缩小和自定义过滤器时用。

Simple Format
Format: filtering <none|bilinear|trilinear|anisotropic>
Default: filtering bilinear

With this format, you only need to provide a single parameter which is one of the following:
none
No filtering or mipmapping is used. This is equivalent to the complex format 'filtering
point point none'.
没有过虑或 mipmapping 被使用。这等价于复杂的'filtering point point none'格式。

bilinear
2x2 box filtering is performed when magnifying or reducing a texture, and a mipmap is
picked from the list but no filtering is done between the levels of the mipmaps. This is
equivalent to the complex format 'filtering linear linear point'.
当放到或减小纹理时 2*2 盒过虑将起作用,一个 mipmap 从列表中被选取,但
mipmap 等级间没有过虑。这样等价于复杂的格式'filtering linear linear point'。

trilinear
2x2 box filtering is performed when magnifying and reducing a texture, and the closest 2
mipmaps are filtered together. This is equivalent to the complex format 'filtering linear
linear linear'.
当放到或减小纹理时 2*2 盒过虑将起作用,最近的 2 个 mipmap 一同被过虑。这等价
于复杂格式'filtering linear linear linear'。

anisotropic
This is the same as 'trilinear', except the filtering algorithm takes account of the slope of
the triangle in relation to the camera rather than simply doing a 2x2 pixel filter in all
cases. This makes triangles at acute angles look less fuzzy. Equivalent to the complex
format 'filtering anisotropic anisotropic linear'. Note that in order for this to make any
difference, you must also set the max_anisotropy attribute too.
这个类似于'trilinear',除了过虑算法考虑同照相机相关而不是在任何情况下都简单
的处理 2*2 像素过虑的三角斜面。这样时三角形仔细看起来有点失真。等价于复杂的
格式'filtering anisotropic anisotropic linear'。注意:对于本选项产生的差别,你也必须
设置 max_anisotropy 属性。

Complex Format
Format: filtering <minification> <magnification> <mip>
Default: filtering linear linear point

This format gives you complete control over the minification, magnification, and mip filters. Each
parameter can be one of the following:
这种格式让你完全控制放大、缩小和 mip 筛选。参数可以是下面的一种:

none
Nothing - only a valid option for the 'mip' filter , since this turns mipmapping off
completely. The lowest setting for min and mag is 'point'.
无――只要对 mip 筛选是合法的操作,因为这样会将 mipmapping 完全关闭。对放大
和缩小的最低设置是’点’。

point
Pick the closet pixel in min or mag modes. In mip mode, this picks the closet matching
mipmap.
在放大或缩小模式中拾取封闭像素。在 mip 模式下,它拾取封闭的 mipmap 匹配。

linear
Filter a 2x2 box of pixels around the closest one. In the 'mip' filter this enables filtering
between mipmap levels.
过滤一个封闭的 2*2 像素盒。在 mip 过虑下,它会打开 mipmap 等级间的过虑。

anisotropic
Only valid for min and mag modes, makes the filter compensate for camera-space slope
of the triangles. Note that in order for this to make any difference, you must also set the
max_anisotropy attribute too.
只要对放大和缩小模式合法,使过滤器对摄像空间的三角斜面补偿。注意:为了产
生不同的效果,你也必须设置 max_anisotropy 属性。

max_anisotropy

Sets the maximum degree of anisotropy that the renderer will try to compensate for when filtering
textures. The degree of anisotropy is the ratio between the height of the texture segment visible in
a screen space region versus the width - so for example a floor plane, which stretches on into the
distance and thus the vertical texture coordinates change much faster than the horizontal ones, has
a higher anisotropy than a wall which is facing you head on (which has an anisotropy of 1 if your
line of sight is perfectly perpendicular to it). You should set the max_anisotropy value to
something greater than 1 to begin compensating; higher values can compensate for more acute
angles.

设置各向异性的最大度数,这样渲染时会对过虑纹理时尝试进行补偿。各向异性的程度是
场景空间区域的可视纹理段的高度和宽度的比值――例如,一个延伸到远处的地板平面,
它的垂直的纹理坐标比水平的改变的快,这个平面比你面对的墙(如果你的视线完全垂直
于它,那只有一个各向异性)有更高的各向异性。你应该设置 max_anisotropy 的值比一大来
进行补偿;补偿的越多,角度变换越大。

In order for this to be used, you have to set the minification and/or the magnification filtering
option on this texture to anisotropic. Format: max_anisotropy <value>
要使它能够被使用,你不得不在这个纹理的各向异性上设置放大和/或缩小的过虑选项。

Default: max_anisotropy 1

colour_op

Determines how the colour of this texture layer is combined with the one below it (or the lighting
effect on the geometry if this is the first layer).
该属性用于决定纹理层的颜色同它下面的(或如果这是第一层,几何体的光效)是如何合
成的。

Format: colour_op <replace|add|modulate|alpha_blend>

This method is the simplest way to blend texture layers, because it requires only one parameter,
gives you the most common blending types, and automatically sets up 2 blending methods: one for
if single-pass multitexturing hardware is available, and another for if it is not and the blending
must be achieved through multiple rendering passes. It is, however, quite limited and does not
expose the more flexible multitexturing operations, simply because these can't be automatically
supported in multipass fallback mode. If want to use the fancier options, use colour_op_ex, but
you'll either have to be sure that enough multitexturing units will be available, or you should
explicitly set a fallback using colour_op_multipass_fallback.

这个方法是混和纹理层的最简单的方法,因为它只需要一个参数,给你最通用的混和类型
自动建立两个混和方法:一个是为单 pass 多纹理硬件可用的情况,另一个是为硬件不支持
但可以用多渲染 pass 来完成混和。然而,那是相对受限的并且也不是多么灵活的纹理操作,
只 是 因 为 在 多 pass 降 级 模 式 下 不 能 自 动 支 持 。 如 果 想 使 用 fancier 选 项 , 使 用
colour_op_ex , 但 你 要 么 必 须 确 保 有 足 够 的 纹 理 单 元 可 用 , 要 么 你 显 示 的 使 用
colour_op_multipass_fallback 降级设置。

replace
Replace all colour with texture with no adjustment.
add
Add colour components together.
modulate
Multiply colour components together.
alpha_blend
Blend based on texture alpha.

Default: colour_op modulate


alpha_rejection

Sets the way the layer will have use alpha to totally reject pixels from the pipeline.

设置层使用 alpha 来完全从 pipiline 中拒绝像素的方法。

Format: alpha_rejection <function> <value>

Example: alpha_rejection greater_equal 128

The function parameter can be any of the options listed in the material depth_function attribute.
The value parameter can theoretically be any value between 0 and 255, but is best limited to 0 or
128 for hardware compatibility.

函数参数可以是材质深度函数属性列表中的任意选项。参数值理论上可以是 0 到 255 间的任


何值,但是考虑到硬件能力最好限制在 0 到 128 间。

Default: alpha_rejection always_pass

colour_op_ex

This is an extended version of the colour_op attribute which allows extremely detailed control
over the blending applied between this and earlier layers. Multitexturing hardware can apply more
complex blending operations that multipass blendind, but you are limited to the number of texture
units which are available in hardware.

是 colour_op 属性的扩展版本,允许相当详细的控制它和前面层的应用混和。多纹理硬件可
以应用更复杂的混和操作――多 pass 混和,但你受限于硬件可应用的纹理单元数量。

Format: colour_op_ex <operation> <source1> <source2> [<manual_factor>] [<manual_colour1>]


[<manual_colour2>]

Example colour_op_ex add_signed src_manual src_current 0.5

See the IMPORTANT note below about the issues between mulitpass and multitexturing that
using this method can create. Texture colour operations determine how the final colour of the
surface appears when rendered. Texture units are used to combine colour values from various
sources (e.g. the diffuse colour of the surface from lighting calculations, combined with the colour
of the texture). This method allows you to specify the 'operation' to be used, i.e. the calculation
such as adds or multiplies, and which values to use as arguments, such as a fixed value or a value
from a previous calculation.

下面是关于使用本方法来创建多纹理和多 pass 间的问题的重要注意点。纹理颜色操作决定


怎样在渲染时应用表面最终颜色(例如,对光照计算、纹理颜色合成的表面颜色扩散)。本
方法允许你指定要是用的操作,例如,用加或乘计算,哪个值用作参数,例如一个混和值
或先前计算的一个值。

Operation options
source1
Use source1 without modification
source2
Use source2 without modification
modulate
Multiply source1 and source2 together.
modulate_x2
Multiply source1 and source2 together, then by 2 (brightening).
modulate_x4
Multiply source1 and source2 together, then by 4 (brightening).
add
Add source1 and source2 together.
add_signed
Add source1 and source2 then subtract 0.5.
add_smooth
Add source1 and source2, subtract the product
subtract
Subtract source2 from source1
blend_diffuse_alpha
Use interpolated alpha value from vertices to scale source1, then add source2 scaled by
(1-alpha).
blend_texture_alpha
As blend_diffuse_alpha but use alpha from texture
blend_current_alpha
As blend_diffuse_alpha but use current alpha from previous stages (same as
blend_diffuse_alpha for first layer)
blend_manual
As blend_diffuse_alpha but use a constant manual alpha value specified in <manual>
Source1 and source2 options
src_current
The colour as built up from previous stages.
src_texture
The colour derived from the texture assigned to this layer.
src_diffuse
The interpolated diffuse colour from the vertices (same as 'src_current' for first layer).
src_specular
The interpolated specular colour from the vertices.
src_manual
The manual colour specified at the end of the command.

For example 'modulate' takes the colour results of the previous layer, and multiplies them with the
new texture being applied. Bear in mind that colours are RGB values from 0.0-1.0 so multiplying
them together will result in values in the same range, 'tinted' by the multiply. Note however that a
straight multiply normally has the effect of darkening the textures - for this reason there are
brightening operations like modulate_x2. Note that because of the limitations on some underlying
APIs (Direct3D included) the 'texture' argument can only be used as the first argument, not the
second.

举个例子,'modulate'使用上一级层的颜色结果,使用被应用的新纹理来乘他们。留意从 0.0
到 1.0 的 RGB 颜色值,所以一同乘他们将会导致相同范围的值,'tinted'使用乘。然而,注意:
通常一直乘会使纹理有变黑的效果――处于这个原因有像 modulate_x2 的变亮操作。注意:
因为很多底层 APIs(包括 Direct3D)的限制,纹理参数只能被用作第一个参数,不能事第
二个。

Note that the last parameter is only required if you decide to pass a value manually into the
operation. Hence you only need to fill these in if you use the 'blend_manual' operation.
注意:如果你决定手工传递操作的值,仅需要最后的参数。因此,如果你使
用'blend_manual'操作,你只需要填充这些。

IMPORTANT: Ogre tries to use multitexturing hardware to blend texture layers together.
However, if it runs out of texturing units (e.g. 2 of a GeForce2, 4 on a GeForce3) it has to fall back
on multipass rendering, i.e. rendering the same object multiple times with different textures. This
is both less efficient and there is a smaller range of blending operations which can be performed.
For this reason, if you use this method you really should set the colour_op_multipass_fallback
attribute to specify which effect you want to fall back on if sufficient hardware is not available
(the default is just 'modulate' which is unlikely to be what you want if you're doing swanky
blending here). If you wish to avoid having to do this, use the simpler colour_op attribute which
allows less flexible blending options but sets up the multipass fallback automatically, since it only
allows operations which have direct multipass equivalents.

重点:Ogre 试着使用多纹理硬件来一同混和纹理层。然而,如果它用光了纹理单元(例如 ,
GeForce2 有两个,GeForce3 有 4 个)它不得不降到多纹理渲染,例如,使用不同的纹理渲染
相同的对象多次。这都是很低效的,并且有要执行的混和操作的较小的范围。出于这个原因,
如果硬件不可用了(如果你做漂亮的混和,缺省的'modulate'不可能是你想要的)并且你使
用这个方法,你应该设置 colour_op_multipass_fallback attribute 属性来确认你想要降低的效
果。如果你希望不使用这个,使用简单的缺乏灵活但自动建立多 pass 降级的 colour_op 属性,
因为它只允许等价的多 pass 操作。

Default: none (colour_op modulate)

colour_op_multipass_fallback

Sets the multipass fallback operation for this layer, if you used colour_op_ex and not enough
multitexturing hardware is available.
为这个层设置多 pass 降低操作,如果你使用 colour_op_ex 但没有足够的多纹理硬件可用。

Format: colour_op_multipass_fallback <src_factor> <dest_factor>

Example: colour_op_mulitpass_fallback one one_minus_dest_alpha

Because some of the effects you can create using colour_op_ex are only supported under
multitexturing hardware, if the hardware is lacking the system must fallback on multipass
rendering, which unfortunately doesn't support as many effects. This attribute is for you to specify
the fallback operation which most suits you.

因为你使用 colour_op_ex 创建的很多效果必须要有多纹理硬件的支持,如果很多效果硬件


不支持,系统必须使用多 pass 渲染,这个属性为你确认最适合你的降级操作。

The parameters are the same as in the scene_blend attribute; this is because multipass rendering IS
effectively scene blending, since each layer is rendered on top of the last using the same
mechanism as making an object transparent, it's just being rendered in the same place repeatedly
to get the multitexture effect. If you use the simpler (and less flexible) colour_op attribute you
don't need to call this as the system sets up the fallback for you.

这个参数同 scene_blend 属性一样;这是因为多 pass 渲染是有效的场景混和,因此每个层都


被渲染到使用同制造透明物体一样的机制的上一个的顶部,

alpha_op_ex

Behaves in exactly the same away as colour_op_ex except that it determines how alpha values are
combined between texture layers rather than colour values.The only difference is that the 2 manual
colours at the end of colour_op_ex are just single floating-point values in alpha_op_ex.
行为同 colour_op_ex 的一样,除了它决定的是纹理层间的而不是颜色值的 alpha 值如何合成。
唯一的不同是在 colour_op_ex 最后的两个手工颜色在 alpha_op_ex 上只是单浮点值。

env_map

Turns on/off texture coordinate effect that makes this layer an environment map.
开/关产生环境映射的纹理坐标效果。

Format: env_map <off|spherical|planar|cubic>

Environment maps make an object look reflective by using automatic texture coordinate
generation depending on the relationship between the objects vertices or normals and the eye.

环境映射通过使用自动纹理坐标产生对象顶点间或法线和眼睛间的依赖关系来使对象看起
来反射。

spherical
A spherical environment map. Requires a single texture which is either a fish-eye lens
view of the reflected scene, or some other texture which looks good as a spherical map (a
texture of glossy highlights is popular especially in car sims). This effect is based on the
relationship between the eye direction and the vertex normals of the object, so works best
when there are a lot of gradually changing normals, i.e. curved objects.

一个球形的环境映射。需要单个纹理,纹理要么是反射场景的鱼眼透镜观察,要么
是一些其他的看起来像球形映射的纹理(一个有光泽的高亮度的纹理是很流行的,
特别是在车型模拟)。这个效果是基于眼睛的方向和对象的顶点法线间的关系,所
以当有大量的逐渐的正交改变时会最好的工作,例如曲线形对象。

planar
Similar to the spherical environment map, but the effect is based on the position of the
vertices in the viewport rather than vertex normals. This effect is therefore useful for
planar geometry (where a spherical env_map would not look good because the normals
are all the same) or objects without normals.

类似于球形环境映射,但是效果基于视口内顶点的位置而不是顶点法线。因此效果
对平坦的几何(一个球形的 env_map 看起来不会很好因为所有的相同的都是正交
的)或非正交的对象是有用的

cubic_reflection
A more advanced form of reflection mapping which uses a group of 6 textures making up
the inside of a cube, each of which is a view if the scene down each axis. Works
extremely well in all cases but has a higher technical requirement from the card than
spherical mapping. Requires that you bind a cubic_texture to this texture unit and use the
'combinedUVW' option.

一个更高级的使用由六个纹理组成的一个立方体内部一组的反射映射形式,如果场
景沿每个轴下降,他们每一个都是一个风景。在很多情况下工作的相当好,但比球
形映射对图形卡有较高的技术需求。需要你绑定 cubic_texture 到纹理单元并使
用'combinedUVW'选项。

cubic_normal
Generates 3D texture coordinates containing the camera space normal vector from the
normal information held in the vertex data. Again, full use of this feature requires a
cubic_texture with the 'combinedUVW' option.

一般包含 camera 空间法向量的 3D 纹理坐标拥有顶点数据。再次,完全使用这个特


点需要带'combinedUVW'选项的 cubic_texture。
Default: env_map off

scroll
Sets a fixed scroll offset for the texture.

Format: scroll <x> <y>

This method offsets the texture in this layer by a fixed amount. Useful for small adjustments
without altering texture coordinates in models. However if you wish to have an animated scroll
effect, see the scroll_anim attribute.

本方法通过在本层中固定数量的纹理偏移量。模型中不改变纹理坐标对于小的调整是很有
用的。然而如果你希望有动画滚动效果,详见 scroll_anim 属性。

scroll_anim

Sets up an animated scroll for the texture layer. Useful for creating fixed-speed scrolling effects on
a texture layer (for varying scroll speeds, see wave_xform).

建立纹理层的动画滚动。对在纹理层上创建固定速度的滚动效果很有用(可以是各种滚动
速度,详见 wave_xform)。

Format: scroll_anim <xspeed> <yspeed>

rotate

Rotates a texture to a fixed angle. This attribute changes the rotational orientation of a texture to a
fixed angle, useful for fixed adjustments. If you wish to animate the rotation, see rotate_anim.

旋转纹理一定的角度。这个属性按一定的方向改变纹理固定的角度,对于定量调整很有用。
如果你希望旋转动画,详见 rotate_anim。

Format: rotate <angle>

The parameter is a anticlockwise angle in degrees.

这个参数是逆时针的度数。

rotate_anim

Sets up an animated rotation effect of this layer. Useful for creating fixed-speed rotation
animations (for varying speeds, see wave_xform).

在本层上建立旋转动画效果。对于创建固定速度的旋转动画很有用(可设定速度,详见
wave_xform)。

Format: rotate_anim <revs_per_second>

The parameter is a number of anticlockwise revolutions per second.


这个参数是一秒钟逆时针旋转的数量。

scale

Adjusts the scaling factor applied to this texture layer. Useful for adjusting the size of textures
without making changes to geometry. This is a fixed scaling factor, if you wish to animate this see
wave_xform.

调整应用到纹理层的放缩因素。不改变几何体的情况下调整纹理大小很有用。这是个固定的
放缩因素,如果你希望有动画效果,详见 wave_xform。

Format: scale <x_scale> <y_scale>

Valid scale values are greater than 0, with a scale factor of 2 making the texture twice as big in
that dimension etc.

合法的放缩值是大于 0,放缩因素为 2 表示纹理比原来大一倍。

wave_xform

Sets up a transformation animation based on a wave function. Useful for more advanced texture
layer transform effects. You can add multiple instances of this attribute to a single texture layer if
you wish.

建立基于波浪功能的平移动画。对很高级的纹理层平移效果很有用。如果你希望,你可以添
加本属性的多个实例到单个纹理层中。

Format: wave_xform <xform_type> <wave_type> <base> <frequency> <phase> <amplitude>

Example: wave_xform scale_x sine 1.0 0.2 0.0 5.0

xform_type
scroll_x
Animate the x scroll value
scroll_y
Animate the y scroll value
rotate
Animate the rotate value
scale_x
Animate the x scale value
scale_y
Animate the y scale value
wave_type
sine
A typical sine wave which smoothly loops between min and max values
triangle
An angled wave which increases & decreases at constant speed, changing instantly at the
extremes
square
Max for half the wavelength, min for the rest with instant transition between
sawtooth
Gradual steady increase from min to max over the period with an instant return to min at
the end.
inverse_sawtooth
Gradual steady decrease from max to min over the period, with an instant return to max at
the end.
base
The base value, the minimum if amplitude > 0, the maximum if amplitdue < 0
frequency
The number of wave iterations per second, i.e. speed
phase
Offset of the wave start
amplitude
The size of the wave

The range of the output of the wave will be {base, base+amplitude}. So the example above scales
the texture in the x direction between 1 (normal size) and 5 along a sine wave at one cycle every 5
second (0.2 waves per second).

输出波形的范围是{base, base+amplitude}。所以上面放缩纹理的例子,x 方向的纹理在 1 到 5


之间的正弦波,每 5 秒循环一次(每秒 0.2 个波)。

You might also like