Skip to content

Commit

Permalink
Update camera manual for zh with new function. (#393)
Browse files Browse the repository at this point in the history
* forum url

* read only user

* html5 gamepad

* sdk api update

* update

* image properties

* update editor

* defold sdk update

* animation updates

* animation fix

* run as admin

* update bob

* update about AndroidX support

* software render

* linux-faq.md update

* 4.28.2021 updates

* Basis Universal format

* sound & mesh

* gamepad event mapping

* admob url

* Minor edit to building blocks intro text

* update gamepad & ios

* project settings

* libffi version

* scaling

* image compression

* update gamepads

* increase memory

* caching assets

* update 2021/10/6

* update 2021/10/16
blend-modes.md

* update 2021/11/12

* allow dynamic transforms update

* Bundle update

* update faq

* bullet & bob

* script properties update

* editor-styling

* build server url

* editor templates

* spine extension update

* Fix typo in the "optimizations" word in Chinese docs

* Update to material.md - Constants buffers

* Verify Graphics Calls

* H5 parameters

* OpenJDK downloads

* cn update corresponds to [pull 259](#259)

* application security

* porting guidelines

* update for 8f1651f

* cn update for 094bf6f

* cn update for 20fdfc5 & 6263317

* cn update for 7/19/2022

* title

* profiling update

* update editor.md

* update bob.md

* update shortcuts

* update fixed update note

* Update properties.md

* Update material.md

* Updates links

* Update bob help with the latest info

* camera & renderer

* Updated android keystore info zh_cn

* bundling.md release vs debug zh_cn

* update bob.md & gui-clipping.md

* contentless bundle

* consoles update

* model animation link

* gamepad & faq

* remove a camera lib

* font shadow render mode fix

* updates about app-manifest and others

* Update script.md

* includes in shaders

* editor scripts

* material updates

* Added dynamic atlas and texture creation

* fixes for atlas and some others

* update screenshots and add explanations (CN)

* add a line about Dynamic Prototype (CN)

* remove "inline" marks in pics

* de-translate the subtitle "Running the debugger" & images fix

* bundle identifier restrictions

* node properties Enabled and Visible (CN)

* release checklist & slice-9

* Update project-settings.md (CN)

* Update camera.md (CN)

* Update project-settings.md (CN)

* culling of meshes (CN)

* Update project-settings.md (CN)

* gltf model file support (CN)

* updates about factory (CN)

* Update bob.md (CN)

* Update bob.jar help (CN)

* Update about renderer and other things

* Update PS4 development and other things

* Dynamic prototype part of the collection factory.

* sync to atlas.md

* sync to design.md

* sync to gpgs.md

* sync to hot-reload.md

* sync to linux.md

* sync to live-update.md

* sync to lua.md

* sync to networking.md

* sync to physics-shapes.md

* sync to push.md

* sync to test.md

* sync to working-offline.md

* update material.md

* update zerobrane.md

* all done

* Splitting .zip archives in live-update.md

* manual for collision events

* Updated sprite documentation to include info about multiple textures

* update editor-scripts.md & physics-events.md

* update buffer.md & physics-shapes.md

* screen blend mode

* Update camera manual for zh with new function.

* Fix texture profile documentation for 1.7.0 zh
  • Loading branch information
CocosGames authored Feb 14, 2024
1 parent e77e02e commit 237c588
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 30 deletions.
6 changes: 5 additions & 1 deletion docs/zh/manuals/camera.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ Orthographic Zoom

## 使用摄像机

通过发送 `acquire_camera_focus` 消息, 激活摄像机并填充视口同时向渲染脚本提供映射矩阵:
通过调用 `camera.acquire_focus` 函数或者向组件发送 `acquire_camera_focus` 消息, 激活摄像机并填充视口同时向渲染脚本提供映射矩阵:

```lua
camera.acquire_focus("#camera")
```
或者
```lua
msg.post("#camera", "acquire_camera_focus")
```
Expand Down
32 changes: 3 additions & 29 deletions docs/zh/manuals/texture-profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Defold 可以自动把图片数据处理成纹理并进行压缩 (称为 *Atlas*
: 纹理格式. 如果指定多个, 每个格式都会生效. 引擎会在运行时选择合适的纹理格式.

*Mipmaps*
: 是否生成mipmap. 默认勾选.
: 是否生成mipmap. 默认不勾选.

*Premultiply alpha*
: 是否预乘alpha. 默认勾选.
Expand Down Expand Up @@ -116,7 +116,7 @@ Defold 可以自动把图片数据处理成纹理并进行压缩 (称为 *Atlas*
:::

*Type*
: 压缩类型, 可选值有 `COMPRESSION_TYPE_DEFAULT`, `COMPRESSION_TYPE_WEBP``COMPRESSION_TYPE_WEBP_LOSSY`. 详见下文 [压缩类型](#compression-types).
: 压缩类型, 可选值有 `COMPRESSION_TYPE_DEFAULT``COMPRESSION_TYPE_BASIS_UASTC`. 详见下文 [压缩类型](#compression-types).

## 纹理格式

Expand All @@ -126,23 +126,9 @@ Defold 可以自动把图片数据处理成纹理并进行压缩 (称为 *Atlas*
`TEXTURE_FORMAT_RGB`, `TEXTURE_FORMAT_RGBA`, `TEXTURE_FORMAT_RGB_16BPP`, `TEXTURE_FORMAT_RGBA_16BPP`, `TEXTURE_FORMAT_LUMINANCE``TEXTURE_FORMAT_LUMINANCE_ALPHA`.

基础通用压缩解码支持各种输出格式, 例如 `ASTC4x4`, `BCx`, `ETC2`, `ETC1``PVRTC1`.
更多更新详情请见

::: sidenote
为了引入基础通用编码器, 目前指定硬件输出格式关闭.

如何同时支持这两种格式还在探索当中.
远期未来目标是引入内容管线插件来解决这个问题.
:::

目前支持以下有损压缩格式:

PVRTC
: 也是一种图块压缩方法. 在4比特模式 (4BPP) 下每个图块 4×4 像素. 在2比特模式 (2BPP) 下每个图块 8×4 像素. 每个图块占用 64 比特 (8 字节) 内存空间. 这种格式原本用于 iPhone, iPod Touch, 和 iPad. 目前使用 PowerVR GPU 的 Android 设备, 也支持这种格式. Defold 支持 PVRTC1, 在格式id中用后缀 "V1" 表示.

ETC
: 爱立信纹理压缩格式. 4×4 像素块再次压缩为 64 比特数据. 4×4 像素块一分为二然后给每块指定一个基础颜色. 每个像素编码为这个基础颜色的四通道偏移量. Android 从 2.2 版 (Froyo) 开始支持 ETC1. Defold 支持 ETC1 纹理压缩格式.

| 格式 | 压缩 | 描述 |
| --------------------------------- | ----------- | -------------------------------- | ---- |
| `TEXTURE_FORMAT_RGB` | none | 3 颜色通道. Alpha 被丢弃 |
Expand All @@ -151,33 +137,21 @@ ETC
| `TEXTURE_FORMAT_RGBA_16BPP` | none | 3 颜色通道和 1 alpha 通道. 4+4+4+4 比特. |
| `TEXTURE_FORMAT_LUMINANCE` | none | 1 灰度通道, 无 alpha 通道. RGB 编码为 1 颜色通道. Alpha 被丢弃. |
| `TEXTURE_FORMAT_LUMINANCE_ALPHA` | none | 1 灰度通道和 1 alpha 通道. RGB 编码为 1 颜色通道. |
| `TEXTURE_FORMAT_RGB_PVRTC2BPPV1` | 1:16 固定. | 无 alpha 通道. 正方形图片. 非正方形图片会被裁剪. |
| `TEXTURE_FORMAT_RGB_PVRTC4BPPV1` | 1:8 固定 | 无 alpha 通道. 正方形图片. 非正方形图片会被裁剪. |
| `TEXTURE_FORMAT_RGBA_PVRTC2BPPV1` | 1:16 固定 | 预乘 alpha. 正方形图片. 非正方形图片会被裁剪. |
| `TEXTURE_FORMAT_RGBA_PVRTC4BPPV1` | 1:8 固定. | 预乘 alpha. 正方形图片. 非正方形图片会被裁剪. |
| `TEXTURE_FORMAT_RGB_ETC1` | 1:6 固定 | 无 alpha 通道. |


## 压缩类型

支持以下软件压缩类型. 载入内存时需要解压.

::: sidenote
目前 `WEBP` 压缩会回退为 `BASIS_UASTC` 压缩.

如何同时支持这两种格式还在探索当中.
我们目前正在研究重新支持硬件格式以及读取 WEBP 压缩格式.
远期未来目标是引入内容管线插件来解决这个问题.
:::

| 类型 | 格式 | 说明 |
| --------------------------------- | ------------------------- | ---- |
| `COMPRESSION_TYPE_DEFAULT` | All formats | 常见有损压缩. 默认类型. |
| `COMPRESSION_TYPE_BASIS_UASTC` | All RGB/RGBA formats | 基础通用高质, 有损压缩. 质量等级越低体积越小. |
| `COMPRESSION_TYPE_WEBP` | All formats | WebP 无损压缩. 质量等级越高体积越小. |
| `COMPRESSION_TYPE_WEBP_LOSSY` | All non hardware compressed formats. | WebP 有损压缩. 质量等级越低体积越小. |

对于硬件压缩纹理格式PVRTC或ETC, WebP无损压缩过程使用内部中间格式将压缩的硬件纹理格式数据转换为更适合WebP图像压缩的数据. 然后在运行时加载时将其转换回压缩的硬件纹理格式. 硬件压缩纹理格式PVRTC和ETC目前不支持WebP有损类型.


## 图片压缩测试

Expand Down

0 comments on commit 237c588

Please sign in to comment.