Godot 渲染程序选项
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Godot 支持两种渲染引擎:GLES2 和 GLES3。启动项目时,您应在 GLES2 或 GLES3 之间进行选择,并尽可能避免切换。项目可以在这两个渲染引擎之间来回切换,但切换需要额外的迁移工作。
在 Android 上,这些渲染程序分别使用 OpenGL ES 2.0 API 和 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 不会这样做。在 Android 上使用 GLES2 渲染程序的项目在添加 Alpha 通道时必须使用未压缩纹理。未压缩纹理占用的内存明显多,且性能不如压缩纹理。特别是资源有限的旧款设备,在使用较大的未压缩纹理时,可能会出现问题,包括遇到内存限制。
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 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[null,null,["最后更新时间 (UTC):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)"]]