renderers.rst 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. .. _doc_renderers:
  2. Renderers
  3. =========
  4. .. seealso::
  5. This page gives an overview of Godot's renderers, focusing on the differences
  6. between their rendering features. For more technical details on the renderers,
  7. see :ref:`doc_internal_rendering_architecture`.
  8. Introduction
  9. ------------
  10. Godot 4 includes three renderers:
  11. - **Forward+**. The most advanced renderer, suited for desktop platforms only.
  12. Used by default on desktop platforms. This renderer uses **Vulkan**, **Direct3D 12**,
  13. or **Metal** as the rendering driver, and it uses the **RenderingDevice** backend.
  14. - **Mobile**. Fewer features, but renders simple scenes faster. Suited for mobile
  15. and desktop platforms. Used by default on mobile platforms. This renderer uses
  16. **Vulkan**, **Direct3D 12**, or **Metal** as the rendering driver, and it uses
  17. the **RenderingDevice** backend.
  18. - **Compatibility**, sometimes called **GL Compatibility**. The least advanced
  19. renderer, suited for low-end desktop and mobile platforms. Used by default on
  20. the web platform. This renderer uses **OpenGL** as the rendering driver.
  21. Renderers, rendering drivers, and RenderingDevice
  22. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  23. .. figure:: img/renderers_rendering_layers.webp
  24. :alt: Diagram of rendering layers. The Compatibility renderer runs on the OpenGL
  25. driver. The Forward+ and Mobile renderers run on RenderingDevice, which can use
  26. Vulkan, Direct3D 12, or Metal as a rendering driver.
  27. :align: center
  28. Godot's rendering abstraction layers.
  29. The *renderer*, or *rendering method*, determines which features are available.
  30. Most of the time, this is the only thing you need to think about. Godot's renderers
  31. are **Forward+**, **Mobile**, and **Compatibility**.
  32. The *rendering driver* tells the GPU what to do, using a graphics API. Godot can
  33. use the **OpenGL**, **Vulkan**, **Direct3D 12**, and **Metal** rendering drivers.
  34. Not every GPU supports every rendering driver, and therefore not every GPU supports
  35. all renderers. Vulkan, Direct3D 12, and Metal are modern, low-level graphics APIs,
  36. and requires newer hardware. OpenGL is an older graphics API that runs on most hardware.
  37. RenderingDevice is a *rendering backend*, an abstraction layer between the renderer
  38. and the rendering driver. It is used by the Forward+ and Mobile renderers, and
  39. these renderers are sometimes called "RenderingDevice-based renderers".
  40. Choosing a renderer
  41. -------------------
  42. Choosing a renderer is a complex question, and depends on your hardware and the
  43. which platforms you are developing for. As a starting point:
  44. Choose **Forward+** if:
  45. - You are developing for desktop.
  46. - You have relatively new hardware which supports Vulkan, Direct3D 12, or Metal.
  47. - You are developing a 3D game.
  48. - You want to use the most advanced rendering features.
  49. Choose **Mobile** if:
  50. - You are developing for newer mobile devices, desktop XR, or desktop.
  51. - You have relatively new hardware which supports Vulkan, Direct3D 12, or Metal.
  52. - You are developing a 3D game.
  53. - You want to use advanced rendering features, subject to the limitations
  54. of mobile hardware.
  55. Choose **Compatibility** if:
  56. - You are developing for older mobile devices, older desktop devices, or
  57. standalone XR. The Compatibility renderer supports the widest range of hardware.
  58. - You are developing for web. In this case, Compatibility is the only choice.
  59. - You have older hardware which does not support Vulkan. In this case,
  60. Compatibility is the only choice.
  61. - You are developing a 2D game, or a 3D game which does not need advanced
  62. rendering features.
  63. - You want the best performance possible on all devices and don't need advanced
  64. rendering features.
  65. Keep in mind every game is unique, and this is only a starting point. For example,
  66. you might choose to use the Compatibility renderer even though you have the latest
  67. GPU, so you can support the widest range of hardware. Or you might want to use the
  68. Forward+ renderer for a 2D game, so you can advanced features like compute shaders.
  69. Switching between renderers
  70. ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  71. In the editor, you can always switch between renderers by clicking on the renderer
  72. name in the upper-right corner of the editor.
  73. Switching between renderers may require some manual tweaks to your scene, lighting,
  74. and environment, since each renderer is different. In general, switching between
  75. the Mobile and Forward+ renderers will require fewer adjustments than switching
  76. between the Compatibility renderer and the Forward+ or Mobile renderers.
  77. Since Godot 4.4, when using Forward+ or Mobile, if Vulkan is not supported, the
  78. engine will fall back to Direct3D 12 and vice versa. If the attempted fallback
  79. driver is not supported either, the engine will then fall back to Compatibility
  80. when the RenderingDevice backend is not supported. This allows the project to run
  81. anyway, but it may look different than the intended appearance due to the more
  82. limited renderer. This behavior can be disabled in the project settings by unchecking
  83. :ref:`Rendering > Rendering Device > Fallback to OpenGL 3<class_ProjectSettings_property_rendering/rendering_device/fallback_to_opengl3>`.
  84. Feature comparison
  85. ------------------
  86. This is not a complete list of the features of each renderer. If a feature is
  87. not listed here, it is available in all renderers, though it may be much faster
  88. on some renderers. For a list of *all* features in Godot, see :ref:`doc_list_of_features`.
  89. Hardware with RenderingDevice support is hardware which can run Vulkan, Direct3D
  90. 12, or Metal.
  91. Overall comparison
  92. ~~~~~~~~~~~~~~~~~~
  93. .. Note that these tables use emojis, which are not monospaced in most editors.
  94. .. The tables look malformed but are not. When making changes, check the nearby
  95. .. lines for guidance.
  96. +---------------------+--------------------------+--------------------------+--------------------------+
  97. | Feature | Compatibility | Mobile | Forward+ |
  98. +=====================+==========================+==========================+==========================+
  99. | **Required** | Older or low-end. | Newer or high-end. | Newer or high-end. |
  100. | **hardware** | | Requires Vulkan, Direct3D| Requires Vulkan, Direct3D|
  101. | | | 12, or Metal support. | 12, or Metal support. |
  102. +---------------------+--------------------------+--------------------------+--------------------------+
  103. | Runs on new hardware| ✔️ Yes. | ✔️ Yes. | ✔️ Yes. |
  104. +---------------------+--------------------------+--------------------------+--------------------------+
  105. | Runs on old and | ✔️ Yes. | ✔️ Yes, but slower than | ✔️ Yes, but slowest of |
  106. | low-end hardware | | Compatibility. | all renderers. |
  107. +---------------------+--------------------------+--------------------------+--------------------------+
  108. | Runs on hardware | ✔️ Yes. | ❌ No. | ❌ No. |
  109. | without | | | |
  110. | RenderingDevice | | | |
  111. | support | | | |
  112. +---------------------+--------------------------+--------------------------+--------------------------+
  113. | **Target platforms**| Mobile, low-end desktop, | Mobile, desktop. | Desktop. |
  114. | | web. | | |
  115. | | | | |
  116. +---------------------+--------------------------+--------------------------+--------------------------+
  117. | Desktop | ✔️ Yes. | ✔️ Yes. | ✔️ Yes. |
  118. +---------------------+--------------------------+--------------------------+--------------------------+
  119. | Mobile | ✔️ Yes (low-end). | ✔️ Yes (high-end). | ⚠️ Supported, but poorly |
  120. | | | | optimized. Use Mobile or |
  121. | | | | Compatibility instead. |
  122. +---------------------+--------------------------+--------------------------+--------------------------+
  123. | XR | ✔️ Yes. Recommended for | ✔️ Yes. Recommended for | ⚠️ Supported, but poorly |
  124. | | standalone headsets. | desktop headsets. | optimized. Use Mobile or |
  125. | | | | Compatibility instead. |
  126. +---------------------+--------------------------+--------------------------+--------------------------+
  127. | Web | ✔️ Yes. | ❌ No. | ❌ No. |
  128. +---------------------+--------------------------+--------------------------+--------------------------+
  129. | 2D Games | ✔️ Yes. | ✔️ Yes, but | ✔️ Yes, but |
  130. | | | Compatibility is usually | Compatibility is usually |
  131. | | | good enough for 2D. | good enough for 2D. |
  132. +---------------------+--------------------------+--------------------------+--------------------------+
  133. | 3D Games | ✔️ Yes. | ✔️ Yes. | ✔️ Yes. |
  134. +---------------------+--------------------------+--------------------------+--------------------------+
  135. | **Feature set** | 2D and core 3D features. | Most rendering features. | All rendering features. |
  136. +---------------------+--------------------------+--------------------------+--------------------------+
  137. | 2D rendering | ✔️ Yes. | ✔️ Yes. | ✔️ Yes. |
  138. | features | | | |
  139. +---------------------+--------------------------+--------------------------+--------------------------+
  140. | Core 3D rendering | ✔️ Yes. | ✔️ Yes. | ✔️ Yes. |
  141. | features | | | |
  142. +---------------------+--------------------------+--------------------------+--------------------------+
  143. | Advanced | ❌ No. | ⚠️ Yes, limited by | ✔️ Yes. All rendering |
  144. | rendering features | | mobile hardware. | features are supported. |
  145. +---------------------+--------------------------+--------------------------+--------------------------+
  146. | New features | ⚠️ Some new rendering | ✔️ Most new rendering | ✔️ All new features are |
  147. | | features are added to | features are added to | added to Forward+. As the|
  148. | | Compatibility. Features | Mobile. Mobile usually | focus of new development,|
  149. | | are added after Mobile | gets new features as | Forward+ gets features |
  150. | | and Forward+. | Forward+ does. | first. |
  151. +---------------------+--------------------------+--------------------------+--------------------------+
  152. | Rendering cost | Low base cost, but | Medium base cost, and | Highest base cost, and |
  153. | | high scaling cost. | medium scaling cost. | low scaling cost. |
  154. +---------------------+--------------------------+--------------------------+--------------------------+
  155. | Rendering driver | OpenGL. | Vulkan, Direct3D 12, or | Vulkan, Direct3D 12, or |
  156. | | | Metal. | Metal. |
  157. +---------------------+--------------------------+--------------------------+--------------------------+
  158. Lights and shadows
  159. ~~~~~~~~~~~~~~~~~~
  160. See :ref:`doc_lights_and_shadows` for more information.
  161. +-------------------------+--------------------------+--------------------------+--------------------------+
  162. | Feature | Compatibility | Mobile | Forward+ |
  163. +=========================+==========================+==========================+==========================+
  164. | Lighting approach | Forward | Forward | Clustered Forward |
  165. | | | | |
  166. +-------------------------+--------------------------+--------------------------+--------------------------+
  167. | Maximum | 8 per mesh. Can be | 8 per mesh, 256 per view.| 512 per cluster. Can be |
  168. | OmniLights | increased. | | increased. |
  169. +-------------------------+--------------------------+--------------------------+--------------------------+
  170. | Maximum | 8 per mesh. Can be | 8 per mesh, 256 per view.| 512 per cluster. Can be |
  171. | SpotLights | increased. | | increased. |
  172. +-------------------------+--------------------------+--------------------------+--------------------------+
  173. | Maximum | 8 | 8 | 8 |
  174. | DirectionalLights | | | |
  175. +-------------------------+--------------------------+--------------------------+--------------------------+
  176. | PCSS for | ❌ Not supported. | ✔️ Supported. | ✔️ Supported. |
  177. | OmniLight and SpotLight | | | |
  178. +-------------------------+--------------------------+--------------------------+--------------------------+
  179. | PCSS for | ❌ Not supported. | ❌ Not supported. | ✔️ Supported. |
  180. | DirectionalLight | | | |
  181. +-------------------------+--------------------------+--------------------------+--------------------------+
  182. | Light projector | ❌ Not supported. | ✔️ Supported. | ✔️ Supported. |
  183. | textures | | | |
  184. +-------------------------+--------------------------+--------------------------+--------------------------+
  185. Global Illumination
  186. ~~~~~~~~~~~~~~~~~~~
  187. See :ref:`doc_introduction_to_global_illumination` for more information.
  188. +-------------------------+--------------------------+--------------------------+--------------------------+
  189. | Feature | Compatibility | Mobile | Forward+ |
  190. +=========================+==========================+==========================+==========================+
  191. | ReflectionProbe | ✔️ Supported, 2 per | ✔️ Supported, 8 per | ✔️ Supported, unlimited. |
  192. | | mesh. | mesh. | |
  193. +-------------------------+--------------------------+--------------------------+--------------------------+
  194. | LightmapGI | ⚠️ Rendering of baked | ✔️ Supported. | ✔️ Supported. |
  195. | | lightmaps is supported. | | |
  196. | | Baking requires hardware | | |
  197. | | with RenderingDevice | | |
  198. | | support. | | |
  199. +-------------------------+--------------------------+--------------------------+--------------------------+
  200. | VoxelGI | ❌ Not supported. | ❌ Not supported. | ✔️ Supported. |
  201. | | | | |
  202. +-------------------------+--------------------------+--------------------------+--------------------------+
  203. | Screen-Space | ❌ Not supported. | ❌ Not supported. | ✔️ Supported. |
  204. | Indirect Lighting (SSIL)| | | |
  205. +-------------------------+--------------------------+--------------------------+--------------------------+
  206. | Signed Distance Field | ❌ Not supported. | ❌ Not supported. | ✔️ Supported. |
  207. | Global Illumination | | | |
  208. | (SDFGI) | | | |
  209. +-------------------------+--------------------------+--------------------------+--------------------------+
  210. Environment and post-processing
  211. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  212. See :ref:`doc_environment_and_post_processing` for more information.
  213. +-------------------------+--------------------------+--------------------------+--------------------------+
  214. | Feature | Compatibility | Mobile | Forward+ |
  215. +=========================+==========================+==========================+==========================+
  216. | Fog (Depth and Height) | ✔️ Supported. | ✔️ Supported. | ✔️ Supported. |
  217. +-------------------------+--------------------------+--------------------------+--------------------------+
  218. | Volumetric Fog | ❌ Not supported. | ❌ Not supported. | ✔️ Supported. |
  219. +-------------------------+--------------------------+--------------------------+--------------------------+
  220. | Tonemapping | ✔️ Supported. | ✔️ Supported. | ✔️ Supported. |
  221. +-------------------------+--------------------------+--------------------------+--------------------------+
  222. | Screen-Space Reflections| ❌ Not supported. | ❌ Not supported. | ✔️ Supported. |
  223. +-------------------------+--------------------------+--------------------------+--------------------------+
  224. | Screen-Space Ambient | ❌ Not supported. | ❌ Not supported. | ✔️ Supported. |
  225. | Occlusion (SSAO) | | | |
  226. +-------------------------+--------------------------+--------------------------+--------------------------+
  227. | Screen-Space | ❌ Not supported. | ❌ Not supported. | ✔️ Supported. |
  228. | Indirect Lighting (SSIL)| | | |
  229. +-------------------------+--------------------------+--------------------------+--------------------------+
  230. | Signed Distance Field | ❌ Not supported. | ❌ Not supported. | ✔️ Supported. |
  231. | Global Illumination | | | |
  232. | (SDFGI) | | | |
  233. +-------------------------+--------------------------+--------------------------+--------------------------+
  234. | Glow | ✔️ Supported. | ✔️ Supported. | ✔️ Supported. |
  235. +-------------------------+--------------------------+--------------------------+--------------------------+
  236. | Adjustments | ✔️ Supported. | ✔️ Supported. | ✔️ Supported. |
  237. +-------------------------+--------------------------+--------------------------+--------------------------+
  238. | Custom post-processing | ✔️ Supported. | ✔️ Supported. | ✔️ Supported. |
  239. | with fullscreen quad | | | |
  240. +-------------------------+--------------------------+--------------------------+--------------------------+
  241. | Custom post-processing | ❌ Not supported. | ✔️ Supported. | ✔️ Supported. |
  242. | with CompositorEffects | | | |
  243. +-------------------------+--------------------------+--------------------------+--------------------------+
  244. Antialiasing
  245. ~~~~~~~~~~~~
  246. See :ref:`doc_3d_antialiasing` for more information.
  247. +-------------------+--------------------------+--------------------------+--------------------------+
  248. | Feature | Compatibility | Mobile | Forward+ |
  249. +===================+==========================+==========================+==========================+
  250. | MSAA 3D | ✔️ Supported. | ✔️ Supported. | ✔️ Supported. |
  251. +-------------------+--------------------------+--------------------------+--------------------------+
  252. | MSAA 2D | ❌ Not supported. | ✔️ Supported. | ✔️ Supported. |
  253. +-------------------+--------------------------+--------------------------+--------------------------+
  254. | TAA | ❌ Not supported. | ❌ Not supported. | ✔️ Supported. |
  255. +-------------------+--------------------------+--------------------------+--------------------------+
  256. | FSR2 | ❌ Not supported. | ❌ Not supported. | ✔️ Supported. |
  257. +-------------------+--------------------------+--------------------------+--------------------------+
  258. | FXAA | ❌ Not supported. | ✔️ Supported. | ✔️ Supported. |
  259. +-------------------+--------------------------+--------------------------+--------------------------+
  260. | SSAA | ✔️ Supported. | ✔️ Supported. | ✔️ Supported. |
  261. +-------------------+--------------------------+--------------------------+--------------------------+
  262. | Screen-space | ❌ Not supported. | ✔️ Supported. | ✔️ Supported. |
  263. | roughness limiter | | | |
  264. +-------------------+--------------------------+--------------------------+--------------------------+
  265. StandardMaterial features
  266. ~~~~~~~~~~~~~~~~~~~~~~~~~
  267. See :ref:`doc_standard_material_3d` for more information.
  268. +-------------------------+--------------------------+--------------------------+--------------------------+
  269. | Feature | Compatibility | Mobile | Forward+ |
  270. +=========================+==========================+==========================+==========================+
  271. | Sub-surface scattering | ❌ Not supported. | ❌ Not supported. | ✔️ Supported. |
  272. | | | | |
  273. +-------------------------+--------------------------+--------------------------+--------------------------+
  274. Shader features
  275. ~~~~~~~~~~~~~~~
  276. See :ref:`doc_shading_reference` for more information.
  277. +-------------------------+--------------------------+--------------------------+--------------------------+
  278. | Feature | Compatibility | Mobile | Forward+ |
  279. +=========================+==========================+==========================+==========================+
  280. | Screen texture | ✔️ Supported. | ✔️ Supported. | ✔️ Supported. |
  281. +-------------------------+--------------------------+--------------------------+--------------------------+
  282. | Depth texture | ✔️ Supported. | ✔️ Supported. | ✔️ Supported. |
  283. | | | | |
  284. +-------------------------+--------------------------+--------------------------+--------------------------+
  285. | Normal/Roughness texture| ❌ Not supported. | ❌ Not supported. | ✔️ Supported. |
  286. +-------------------------+--------------------------+--------------------------+--------------------------+
  287. | Compute shaders | ❌ Not supported. | ⚠️ Supported, but comes | ✔️ Supported. |
  288. | | | with a performance | |
  289. | | | penalty on older devices.| |
  290. +-------------------------+--------------------------+--------------------------+--------------------------+
  291. Other features
  292. ~~~~~~~~~~~~~~
  293. +-------------------------+--------------------------+--------------------------+--------------------------+
  294. | Feature | Compatibility | Mobile | Forward+ |
  295. +=========================+==========================+==========================+==========================+
  296. | Variable rate | ❌ Not supported. | ✔️ Supported. | ✔️ Supported. |
  297. | shading | | | |
  298. +-------------------------+--------------------------+--------------------------+--------------------------+
  299. | Decals | ❌ Not supported. | ✔️ Supported. | ✔️ Supported. |
  300. +-------------------------+--------------------------+--------------------------+--------------------------+
  301. | Depth of field blur | ❌ Not supported. | ✔️ Supported. | ✔️ Supported. |
  302. +-------------------------+--------------------------+--------------------------+--------------------------+
  303. | Adaptive and Mailbox | ❌ Not supported. | ✔️ Supported. | ✔️ Supported. |
  304. | VSync modes | | | |
  305. +-------------------------+--------------------------+--------------------------+--------------------------+
  306. | 2D HDR Viewport | ❌ Not supported. | ✔️ Supported. | ✔️ Supported. |
  307. +-------------------------+--------------------------+--------------------------+--------------------------+
  308. | RenderingDevice | ❌ Not supported. | ✔️ Supported. | ✔️ Supported. |
  309. | access | | | |
  310. +-------------------------+--------------------------+--------------------------+--------------------------+