Texture Map Assets
Texture mapping assets are assets used for procedural sampling, such as textures on models and the UI on Sprites. When the UI or model are rendered, the corresponding texture is sampled, then filled on the model grid, plus a series of processing such as lighting to render the entire scene.
Texture assets can be generated from ImageAsset. Some common image formats, including .png
, .jpeg
, etc. can be used in ImageAsset.
Texture2D
Texture2D is a type of texture asset that is usually used for rendering of 3D models, such as reflection maps, ambient light mask maps, etc… in model materials.
Texture2D in Cocos Creator:
Note: the texture type is a Texture2D asset.
Adjusting the Properties of a Texture2D
When importing an ImageAsset, it will be set to Texture2D by default. At this same time, one or more sub-assets will be generated on the original asset. Click the arrow in front of the original asset to see all the sub-assets. Example:
After selecting the generated Texture2D sub-asset, you can see the following panel:
Sub-Asset Texture2D Properties Panel
The following describes the properties of the panel:
Property | Explanation |
---|---|
anisotropy | Anisotropy value |
minFilter | Narrowing Filter Algorithm |
magFilter | Magnification Filter Algorithm |
mipFilter | Multi-level texture filtering algorithm |
wrapS | S (U) direction texture addressing mode |
wrapT | T (V) direction texture addressing mode |
Using Texture2D
Texture2D is a very widely used asset. Any property marked as Texture2D in the Inspector panel can be dragged into a Texture2D asset type.
The usage scenario is mainly in the Editor environment and for dynamic acquisition:
- In the Editor, just drag the assets in;
- For dynamic acquisition, you need to obtain the ImageAsset asset first, and then instantiate the Texture2D asset based on the obtained ImageAsset.
TextureCube
TextureCube is a cube texture, which can be used to set the scene’s Skybox. It can be obtained by setting the panorama ImageAsset to the TextureCube type. It can also be obtained by making CubeMap assets.
TextureCube obtained from a panorama in Cocos Creator:
TextureCube obtained by making a CubeMap in Cocos Creator:
To learn more about the use of TextureCube and CubeMaps, please refer to the Skybox documentation.