Godot 轉譯器選項
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Godot 支援兩個轉譯引擎:GLES2 和 GLES3。啟動專案時,您應選擇 GLES2 或 GLES3,並盡可能避免切換。專案可在這兩個轉譯引擎之間來回切換,但切換作業需要額外的遷移工作。
在 Android 平台上,這些轉譯器會分別使用 OpenGL ES 2.0 和 OpenGL ES 3.0 API。GLES3 轉譯器具有更多複雜的功能,而 GLES2 轉譯器與更多 Android 裝置相容。即使是相同的輸入情境資料,轉譯器也會產生稍微不同的影像輸出。造成差異的原因是 GLES2 轉譯器使用 sRGB 色域,而 GLES3 轉譯器使用線性色域。
選擇轉譯器
GLES2
GLES2 轉譯器最適合有少量圖形需求的 2D 或 3D 專案,並且與幾乎所有現行的 Android 裝置相容。如果專案設計適合在較舊的裝置上執行,而你想支援這些裝置,那麼 GLES2 就是最好的選擇。
Android 上的 GLES2 轉譯器有一個重要限制,就是僅支援 ETC1 這種經過壓縮的材質格式。ETC1 不支援 Alpha 通道。其他引擎可能會使用雙 ETC1 紋理做為替代方案,也就是一種包含色彩資料的紋理,以及另一個包含 Alpha 管道資料的紋理。Godot 不會這麼做。在包含 Alpha 通道的情況下,於 Android 上使用 GLES2 轉譯器的專案必須使用未壓縮的材質。未壓縮紋理會大量使用較多的記憶體,而且效能不如壓縮的紋理。特別是資源有限的舊型裝置在使用大型未壓縮紋理時 (包括耗用記憶體限制) 可能會發生問題。
GLES2 轉譯器可能無法使用進階轉譯功能。GLES2 轉譯器的限制包括但不限於:
- 每個有效即時光源的效能提升效果不彰。
- 不支援轉譯功能,例如高畫質範圍、折射屬性、螢幕空間反射或螢幕空間環境遮蔽。
- 著色器複雜度受限。
- 缺乏即時全域照明支援。
- 不支援粒子的 GPU 加速功能。
GLES3
GLES3 轉譯器與大約 90% 支援 OpenGL ES 3.0 的現行 Android 裝置相容。只有現行最舊款的 Android 裝置無法享有 OpenGL ES 3.0 支援。
雖然 GLES3 轉譯器與任何 OpenGL ES 3.0 裝置相容,但請注意,舊型裝置比較不可能以可接受的影格速率執行。有些舊款裝置的 OpenGL ES 3.0 實作項目也包含圖形驅動程式錯誤。Android 上的 GLES3 轉譯器對於驅動程式錯誤的影響有限。這些問題對於新版裝置較不會構成困擾。
GLES3 轉譯器支援 Android 上的 ETC2 材質壓縮格式。
與 ETC1 不同,ETC2 支援 Alpha 通道。
詳情請參閱 Godot 說明文件 - GLES2 和 GLES3 的差異
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[null,null,["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],null,["# Godot renderer options\n\nGodot supports two rendering engines: GLES2 and GLES3. You should choose\nbetween GLES2 or GLES3 when you start your project, and avoid switching if\npossible. Projects can switch back and forth between these two rendering\nengines, but switching requires additional migration work.\n\nOn Android, these renderers use the OpenGL ES 2.0 and OpenGL ES 3.0 APIs\nrespectively. The GLES3 renderer has more sophisticated capabilities and\nfeatures, while the GLES2 renderer is compatible with more Android devices. The\nrenderers also produce slightly different visual output for identical input\nscene data. This disparity is caused by the GLES2 renderer using a sRGB color\nspace while the GLES3 renderer uses a linear color space.\n\nChoosing a renderer\n-------------------\n\n### GLES2\n\nThe GLES2 renderer is most appropriate for 2D or 3D projects with modest graphic\nrequirements, and is compatible with virtually all active Android devices. If\nyour project is designed to run well on older devices, and you intend to support\nthem, GLES2 may be the best choice.\n\nAn important limitation of the GLES2 renderer on Android is that only one\ncompressed texture format is supported: ETC1. ETC1 doesn't support an alpha\nchannel. Other engines may use dual ETC1 textures as a workaround, with one\ntexture containing color data and a second texture containing the alpha channel\ndata. Godot doesn't do this. Projects using the GLES2 renderer on\nAndroid must use uncompressed textures when including an alpha channel.\nUncompressed textures use significantly more memory and don't perform as well as\ncompressed textures. Older devices with limited resources in particular may\nhave issues when using large uncompressed textures, including running into\nmemory limits.\n\nAdvanced rendering features might\nnot be available to the GLES2 renderer. Limitations of the\nGLES2 renderer include but are not limited to:\n\n- Poor performance scaling per active real-time light.\n- Lack of support for rendering features such as high-definition range, refraction properties, screen space reflections, or screen space ambient occlusion.\n- Restrictions on shader complexity.\n- Lack of real-time global illumination support.\n- Lack of GPU acceleration support for particles.\n\n### GLES3\n\nThe GLES3 renderer is compatible with the approximately 90% of active Android\ndevices that have OpenGL ES 3.0 support. Only the oldest of active Android\ndevices lack OpenGL ES 3.0 support.\n\nWhile the GLES3 renderer is compatible with\nany OpenGL ES 3.0 device, be aware that older\ndevices are less likely to run at acceptable\nframe rates. Some older devices also contain graphic driver bugs in their OpenGL\nES 3.0 implementations. The GLES3 renderer on Android has limited mitigations\nfor driver bugs. These issues are less of a concern on newer devices.\n\nThe GLES3 renderer supports the ETC2 texture compression format on Android.\nUnlike ETC1, ETC2 includes support for an alpha channel.\n\nFor more information, see the [Godot Documentation - Differences between GLES2 and GLES3](https://docs.godotengine.org/en/stable/tutorials/misc/gles2_gles3_differences.html)"]]