标题: [Unity 组件参考手册]组件:资源组件之渲染纹理 [打印本页] 作者: . 时间: 2013-1-25 15:02 标题: [Unity 组件参考手册]组件:资源组件之渲染纹理 Assets are the models, textures, sounds and all other "content" files from which you make your game.资源就是模型,纹理,声音和所有其他"内容",制作游戏所用的文件。This section describes Components for all asset types. For a general overview of assets, see Assets overview page.本部分介绍所有资源类型的组件。想要知道资源的一般概述,请参阅资源概览页面。 下面介绍渲染纹理。Render Textures are special types of Textures that are created and updated at ***ntime. To use them, you first create a new Render Texture and designate one of your Cameras to render into it. Then you can use the Render Texture in a Material just like a regular Texture. The Water prefabs in Unity Standard Assets are an example of real-world use of Render Textures for making real-time reflections and refractions.渲染纹理是一种特殊的纹理类型在运行时产生和更新。要使用他们,你首先要创建一个新的渲染纹理并且要指定一个摄像机进行渲染。然后你可以在材质中使用渲染纹理就像常规的纹理一样。在Unity Standard Assets中的Water的预置体就是一个真实的世界使用渲染纹理来实时进行反射和折射的例子。Render Textures are a Unity Pro feature.渲染纹理是Unity Pro版本的功能。
[Properties 属性]The Render Texture Inspector is different from most Inspectors, but very similar to the Texture Inspector.渲染纹理的监视面板和大多数监视面板不同,但是和纹理监视面板非常相似。
The Render Texture Inspector is almost identical to the Texture Inspector
渲染纹理的监视面板和纹理的监视面板几乎相同。The Render Texture inspector displays the current contents of Render Texture in realtime and can be an invaluable debugging tool for effects that use render textures.渲染纹理的监视面板展示了实时渲染纹理的当前内容,并且有一个可贵的调试工具来调试渲染纹理的效果。----------------------------------------------------------------------------Size 大小
The size of the Render Texture in pixels. Observe that only power-of-two values sizes can be chosen.
渲染纹理的像素大小。观看下只有power-of-two的值大小能被选择。
Aniso Level 各向异性等级
Increases Texture quality when viewing the texture at a steep angle. Good for floor and ground textures
在一个很陡的角度观看纹理时,纹理的质量会提高。这对于地板和地面纹理不错。
Filter Mode 过滤模式
Selects how the Texture is filtered when it gets stretched by 3D transformations:
当进行3D变换时选择什么样的纹理过滤器。
No Filtering 无过滤
The Texture becomes blocky up close
纹理变得斑驳更靠近。
Bilinear 双线性
The Texture becomes blurry up close
纹理变得模糊。
Trilinear 三线性
Like Bilinear, but the Texture also blurs between the different mip levels
和双线一样,但是纹理在不同的纹理层级贴图之间模糊。
Wrap Mode 循环模式
Selects how the Texture behaves when tiled:
选择纹理如果平铺:
Repeat 重复
The Texture repeats (tiles) itself
纹理自身重复。
Clamp 钳制
The Texture's edges get stretched
纹理的边缘得到伸展。----------------------------------------------------------------------------[Example 例子]A very quick way to make a live arena-camera in your game:在你的游戏中创建一个实时的舞台摄像机有一个非常快速的方式: Create a new Render Texture asset using Assets->Create->Render Texture.
通过 Assets->Create->Render Texture.创建一个渲染纹理资源。
Create a new Camera using GameObject->Create Other->Camera.
通过GameObject->Create Other->Camera.创建一个新的摄像机。
Assign the Render Texture to the Target Texture of the new Camera.
给新的摄像机的Target Texture指定渲染纹理。
Create a wide, tall and thin box
创建一个宽的,高的和瘦的框。
Drag the Render Texture onto it to create a Material that uses the render texture.
把渲染纹理拖放给一个新建的材质球,然后使用渲染纹理。
Enter Play Mode, and observe that the box's texture is updated in real-time based on the new Camera's output.
进入播放模式,并观察到框的纹理是实时更新基于相机的输出。
Render Textures are set up as demonstrated above
渲染纹理的设置如上所述
----------------------------------------------------------------------------[Hints 提示] Unity renders everything in the texture assigned to RenderTexture.active.
Unity渲染任何指定了RenderTexture.active的纹理
【来源:互联网】
更多精彩教程,尽在web3D纳金网http://www.narkii.com/college/