A Cubemap Texture is a collection of six separate square Textures that are put onto the faces of an imaginary cube. Most often they are used to display infinitely faraway reflections on objects, similar to how Skybox displays faraway scenery in the background. The Reflective built-in shaders in Unity use Cubemaps to display reflection.
一个立方图纹理(Cubemap Texture)六个独立的正方形纹理的一个集合,这些纹理会用在一个虚构的立方体上。通常用来显示无限遥远的物体上的反射效果。类似的,天空盒(Skybox )如何在背景显示遥远的风景。内置的反射(Reflective )着色器在Unity使用立方图(Cubemap),以显示反射。
A mountain scene Cubemap displayed as a reflection on this sphere
一个山区场景立方图显示为在这个球上的反射
You create Cubemap in one of several ways:
您可以用这几种方式创建立方图:
- Use Assets->Create->Cubemap, set its properties, and drag six Texture assets onto corresponding Cubemap "faces". Note that the textures must be re-applied if changed because the textures are baked into the Cubemap Asset and are in no way linked to the textures.
用资源>创建 - > 立方图(Assets->Create->Cubemap),设置其属性,并拖6个纹理资源到相应立方图的"面"。注意纹理如果改变了,必须重新指派,因为纹理烘焙成立方图资源就与纹理没有关系了。 - Use the Texture Import Settings to create a Cubemap from a single imported texture asset.
使用纹理导入设置(Texture Import Settings)从一个单独导入的纹理资源创建立方图。 - Render your scene into a cubemap from script. Code example in Camera.RenderToCubemap page contains a script for rendering cubemaps straight from the editor.
用脚本把你的场景渲染成立方图(cubemap)。 Camera.RenderToCubemap页包含直接从编辑器渲染立方图的脚本代码示例。
Properties 属性
-
Right (+X) 右Texture for the right global side of the Cubemap face. 立方图右面的纹理
-
Left (-X) 左Texture for the up global side of the Cubemap face. 立方图左面的纹理
-
Top (+Y) 顶Texture for the top global side of the Cubemap face. 立方图顶面的纹理
-
Bottom (-Y) 底Texture for the bottom global side of the Cubemap face. 立方图底面的纹理
-
Front (+Z) 前Texture for the forward global side of the Cubemap face. 立方图前面的纹理
-
Back (-Z) 后Texture for the rear global side of the Cubemap face. 立方图后面的纹理
-
Face Size 面大小Width and Height in pixels across each individual Cubemap face. Textures will be internally scaled to fit this size, there is no need to manually scale the assets.
立方图每个面的宽度和高度,以像素为单位。纹理将在内部缩放,以适应这个尺寸,不需要手动缩放资源。 -
Mipmap 多级纹理Enable to create mipmaps. 启用多级纹理
-
Format 格式Format of the created cubemap. 创建立方图的格式