diff --git a/docs/en/graphics/texture/2d.md b/docs/en/graphics/texture/2d.mdx similarity index 87% rename from docs/en/graphics/texture/2d.md rename to docs/en/graphics/texture/2d.mdx index 19b6733c8..1a3f1e553 100644 --- a/docs/en/graphics/texture/2d.md +++ b/docs/en/graphics/texture/2d.mdx @@ -1,8 +1,8 @@ --- order: 1 -title: 2D 纹理 -type: 图形 -group: 纹理 +title: 2D Texture +type: Graphics +group: Texture label: Graphics/Texture --- @@ -12,7 +12,7 @@ label: Graphics/Texture In the editor, you can easily import a 2D texture by following the path **[Asset Panel](/en/docs/assets/interface)** -> **Right-click Upload** -> **Select Texture2D** -> **Choose the corresponding texture** -> **2D texture asset creation complete**. -image.png +image.png Similarly, in the script, you can load an image through [ResourceManager](/apis/core/#ResourceManager) to get the corresponding 2D texture: @@ -85,7 +85,7 @@ texture.getPixelBuffer(0, 0, width, height, 0, data); Assigning the texture to the corresponding property of the material ball can enable different rendering functions. For example, adding a base color texture can determine the basic tone of the model. In the editor, you only need to select the corresponding texture in the corresponding property. -image.png +image.png Similarly, in the script, you can set it like this: @@ -98,7 +98,7 @@ material.baseTexture = texture; ## Color Expansion -image.png +image.png To solve the problem of black edges appearing at the abrupt changes in Alpha values in images with transparent pixels, the editor has a built-in color expansion function. This function removes the black edges of the image by rewriting the RGB values of all transparent pixels in the image to the RGB values of the nearest non-fully transparent pixels. @@ -109,6 +109,6 @@ To solve the problem of black edges appearing at the abrupt changes in Alpha val ## Export Configuration -image.png +image.png The [Project Release](/en/docs/platform/platform) document explains the **global configuration** for texture export in detail. If the Overwrite option is selected here, this asset will follow the **custom configuration** instead of the **global configuration** during export. diff --git a/docs/en/graphics/texture/compression.md b/docs/en/graphics/texture/compression.mdx similarity index 90% rename from docs/en/graphics/texture/compression.md rename to docs/en/graphics/texture/compression.mdx index c75635608..2b041bd7d 100644 --- a/docs/en/graphics/texture/compression.md +++ b/docs/en/graphics/texture/compression.mdx @@ -36,7 +36,7 @@ KTX2 can be generated using: When packaging the project, the editor can configure options to generate KTX2. Refer to the '[Project Release](/en/docs/platform/platform/)' document. The project export is a global configuration, and different compression formats can be configured independently for different texture resources. Check overwrite in the texture panel of the editor to override the global configuration: -image-20240705112419249 +image-20240705112419249 - ETC1S has a small size and minimal memory usage but lower quality, suitable for albedo, specular, and other maps. - UASTC has a larger size and higher quality, suitable for normal maps and similar textures. diff --git a/docs/en/graphics/texture/cube.md b/docs/en/graphics/texture/cube.mdx similarity index 100% rename from docs/en/graphics/texture/cube.md rename to docs/en/graphics/texture/cube.mdx diff --git a/docs/en/graphics/texture/rtt.md b/docs/en/graphics/texture/rtt.mdx similarity index 100% rename from docs/en/graphics/texture/rtt.md rename to docs/en/graphics/texture/rtt.mdx diff --git a/docs/en/graphics/texture/texture.md b/docs/en/graphics/texture/texture.mdx similarity index 93% rename from docs/en/graphics/texture/texture.md rename to docs/en/graphics/texture/texture.mdx index 523c2459e..ad75bc4b5 100644 --- a/docs/en/graphics/texture/texture.md +++ b/docs/en/graphics/texture/texture.mdx @@ -34,14 +34,14 @@ This article will mainly introduce: Texture space is determined by the shape of the texture. 2D textures require 2D space vectors for texture sampling, while cube textures require 3D space vectors for texture sampling. -
-
- Texture 2D -
Texture 2D
+
+
+ Texture 2D +
Texture 2D
-
- Texture Cube -
Texture Cube
+
+ Texture Cube +
Texture Cube
diff --git a/docs/zh/graphics/texture/2d.md b/docs/zh/graphics/texture/2d.mdx similarity index 87% rename from docs/zh/graphics/texture/2d.md rename to docs/zh/graphics/texture/2d.mdx index 3f7468c3c..b447773a9 100644 --- a/docs/zh/graphics/texture/2d.md +++ b/docs/zh/graphics/texture/2d.mdx @@ -12,7 +12,7 @@ label: Graphics/Texture 在编辑器中可以方便地导入一张 2D 纹理,按照路径 **[资产面板](/docs/assets/interface)** -> **右键上传** -> **选择 Texture2D** -> **选择对应贴图** -> **2D 纹理资产创建完毕** 操作即可。 -image.png +image.png 同样的,在脚本中可以通过 [ResourceManager](/apis/core/#ResourceManager) 加载图片获取对应的 2D 纹理: @@ -85,7 +85,7 @@ texture.getPixelBuffer(0, 0, width, height, 0, data); 将纹理赋予材质球的相应属性,可以开启不同的渲染功能,如添加基础颜色纹理,可以决定模型的基本色调。在编辑器中,只需在对应属性选择相应纹理即可。 -image.png +image.png 对应的,在脚本中,可以这样设置: @@ -98,7 +98,7 @@ material.baseTexture = texture; ## 色彩膨胀 -image.png +image.png 为了解决带透明像素图片在 Alpha 值突变处出现黑边的问题,编辑器内置了色彩膨胀功能。该功能是通过将图片中所有透明像素的 RGB 值改写为与其最临近非完全透明像素的 RGB 值,达到去除图片黑边的效果。 @@ -109,6 +109,6 @@ material.baseTexture = texture; ## 导出配置 -image.png +image.png [项目发布](/docs/platform/platform)文档中详细说明了纹理导出时的**全局配置**,若此处勾选 Overwrite 选项时,此资产导出时将遵循**自定义配置**将非**全局配置**。 diff --git a/docs/zh/graphics/texture/compression.md b/docs/zh/graphics/texture/compression.mdx similarity index 92% rename from docs/zh/graphics/texture/compression.md rename to docs/zh/graphics/texture/compression.mdx index 5c1c42296..b0c81f1d8 100644 --- a/docs/zh/graphics/texture/compression.md +++ b/docs/zh/graphics/texture/compression.mdx @@ -38,7 +38,7 @@ KTX2 的生成可以使用: 编辑器在项目打包时,可以配置选项生成 KTX2,可以参考『[项目发布](/docs/platform/platform/)』文档。项目导出是全局的配置,也可以独立给不同的纹理资源配置不同的压缩格式。在编辑器的纹理面板下勾选 overwrite 可以覆盖全局配置: -image-20240705112419249 +image-20240705112419249 - ETC1S 尺寸小,内存极小,但是质量较低,适合 albedo, specular 等贴图 - UASTC 尺寸大,质量高,适合 normal 这类贴图 diff --git a/docs/zh/graphics/texture/cube.md b/docs/zh/graphics/texture/cube.mdx similarity index 100% rename from docs/zh/graphics/texture/cube.md rename to docs/zh/graphics/texture/cube.mdx diff --git a/docs/zh/graphics/texture/rtt.md b/docs/zh/graphics/texture/rtt.mdx similarity index 100% rename from docs/zh/graphics/texture/rtt.md rename to docs/zh/graphics/texture/rtt.mdx diff --git a/docs/zh/graphics/texture/texture.md b/docs/zh/graphics/texture/texture.mdx similarity index 93% rename from docs/zh/graphics/texture/texture.md rename to docs/zh/graphics/texture/texture.mdx index cf4e70eae..2829d29dd 100644 --- a/docs/zh/graphics/texture/texture.md +++ b/docs/zh/graphics/texture/texture.mdx @@ -34,14 +34,14 @@ label: Graphics/Texture 纹理空间是由纹理形状决定的, 2D 纹理对应需要使用二维空间向量进行纹理采样,相应地,立方纹理需要使用三维空间向量进行纹理采样。 -
-
- Texture 2D -
Texture 2D
+
+
+ Texture 2D +
Texture 2D
-
- Texture Cube -
Texture Cube
+
+ Texture Cube +
Texture Cube