renderers.rst 27 KB

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