overview.rst 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. Overview
  2. ========
  3. What is it?
  4. -----------
  5. Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library,
  6. licensed under permissive BSD-2 clause open source license.
  7. .. raw:: html
  8. <p>
  9. <iframe src="https://ghbtns.com/github-btn.html?user=bkaradzic&repo=bgfx&type=star&count=true&size=large" frameborder="0" scrolling="0" width="160px" height="30px"></iframe>
  10. <iframe src="https://ghbtns.com/github-btn.html?user=bkaradzic&repo=bgfx&type=fork&count=true&size=large" frameborder="0" scrolling="0" width="158px" height="30px"></iframe>
  11. </p>
  12. Supported rendering backends
  13. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  14. - Direct3D 9
  15. - Direct3D 11
  16. - Direct3D 12
  17. - GNM (only for licensed PS4 developers, search DevNet forums for source)
  18. - Metal
  19. - OpenGL 2.1
  20. - OpenGL 3.1+
  21. - OpenGL ES 2
  22. - OpenGL ES 3.1
  23. - Vulkan
  24. - WebGL 1.0
  25. - WebGL 2.0
  26. - WebGPU/Dawn (experimental)
  27. Supported Platforms
  28. ~~~~~~~~~~~~~~~~~~~
  29. - Android (14+, ARM, x86, MIPS)
  30. - FreeBSD
  31. - iOS (iPhone, iPad, AppleTV)
  32. - Linux
  33. - MIPS Creator CI20
  34. - OSX (10.12+)
  35. - PlayStation 4
  36. - RaspberryPi
  37. - UWP (Universal Windows, Xbox One)
  38. - Wasm/Emscripten
  39. - Windows (XP, Vista, 7, 8, 10)
  40. Supported Compilers
  41. ~~~~~~~~~~~~~~~~~~~
  42. - Clang 3.3 and above
  43. - GCC 5 and above
  44. - vs2017 and above
  45. Supported Languages
  46. ~~~~~~~~~~~~~~~~~~~
  47. - `C/C++ API documentation <https://bkaradzic.github.io/bgfx/bgfx.html>`__
  48. - `Beef API bindings <https://github.com/bkaradzic/bgfx/tree/master/bindings/bf>`__
  49. - `C# language API bindings #1 <https://github.com/bkaradzic/bgfx/tree/master/bindings/cs>`__
  50. - `D language API bindings <https://github.com/GoaLitiuM/bindbc-bgfx>`__
  51. - `Go language API bindings <https://github.com/james4k/go-bgfx>`__
  52. - `Haskell language API bindings <https://github.com/haskell-game/bgfx>`__
  53. - `Lightweight Java Game Library 3 bindings <https://github.com/LWJGL/lwjgl3#lwjgl---lightweight-java-game-library-3>`__
  54. - `Lua language API bindings <https://github.com/cloudwu/lua-bgfx>`__
  55. - `Nim language API bindings <https://github.com/Halsys/nim-bgfx>`__
  56. - `Pascal language API bindings <https://github.com/Akira13641/PasBGFX>`__
  57. - `Python language API bindings #1 <https://github.com/fbertola/bgfx-python#-----bgfx-python-->`__
  58. - `Python language API bindings #2 <https://github.com/jnadro/pybgfx#pybgfx>`__
  59. - `Rust language API bindings <https://github.com/rhoot/bgfx-rs#bgfx-rs>`__
  60. - `Swift language API bindings <https://github.com/stuartcarnie/SwiftBGFX>`__
  61. - `Zig language API bindings <https://github.com/bkaradzic/bgfx/tree/master/bindings/zig>`__
  62. Project Page
  63. ~~~~~~~~~~~~
  64. - https://github.com/bkaradzic/bgfx
  65. Contact
  66. ~~~~~~~
  67. - `GitHub Discussions <https://github.com/bkaradzic/bgfx/discussions>`__
  68. - `Discord Chat <https://discord.gg/9eMbv7J>`__
  69. - GitHub `@bkaradzic <https://github.com/bkaradzic>`__
  70. - Twitter `@bkaradzic <https://twitter.com/bkaradzic>`__
  71. Debugging and Profiling
  72. -----------------------
  73. RenderDoc
  74. ~~~~~~~~~
  75. Loading of RenderDoc is integrated in bgfx when using DX11 or OpenGL
  76. renderer. You can drop in ``renderdoc.dll`` from RenderDoc distribution
  77. into working directory, and it will be automatically loaded during bgfx
  78. initialization. This allows frame capture at any time by pressing
  79. **F11**.
  80. Download: `RenderDoc <https://renderdoc.org/builds>`__
  81. RenderDoc `How do I ...? <https://renderdoc.org/docs/how/index.html>`__ documentation.
  82. `Shader debugging <https://software.intel.com/en-us/articles/shader-debugging-for-bgfx-rendering-engine>`__
  83. with RenderDoc and MSVC.
  84. IntelGPA
  85. ~~~~~~~~
  86. Right click **Intel GPA Monitor** tray icon, choose preferences, check
  87. "Auto-detect launched applications" option. Find ``InjectionList.txt``
  88. in GPA directory and add ``examples-*`` to the list.
  89. Download:
  90. `IntelGPA <https://software.intel.com/en-us/vcsource/tools/intel-gpa>`__
  91. Other Debuggers and Profilers
  92. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  93. .. |x| unicode:: U+2713 .. CHECK MARK
  94. +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
  95. | Name | OS | DX9 | DX11 | DX12 | Metal | GL | GLES | Vulkan| Source |
  96. +=============+=================+=======+========+======+=======+======+======+=======+========+
  97. | APITrace | Linux/OSX/Win | |x| | |x| | | | |x| | |x| | | |x| |
  98. +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
  99. | CodeXL | Linux/Win | | | | | |x| | | | |
  100. +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
  101. | Dissector | Win | |x| | | | | | | | |x| |
  102. +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
  103. | IntelGPA | Linux/OSX/Win | |x| | |x| | | | | |x| | | |
  104. +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
  105. | Nsight | Win | |x| | |x| | | | |x| | | | |
  106. +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
  107. | PerfHUD | Win | |x| | |x| | | | | | | |
  108. +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
  109. | PerfStudio | Win | | |x| | |x| | | |x| | |x| | | |
  110. +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
  111. | PIX | Win | | | |x| | | | | | |
  112. +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
  113. | RGP | Win | | | |x| | | | | |x| | |
  114. +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
  115. | RenderDoc | Win/Linux | | |x| | | | |x| | | |x| | |x| |
  116. +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
  117. | vogl | Linux | | | | | |x| | | | |x| |
  118. +-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
  119. Download:
  120. - `APITrace <https://apitrace.github.io/>`__
  121. - `CodeXL <http://developer.amd.com/tools-and-sdks/opencl-zone/codexl/>`__
  122. - `Dissector <https://github.com/imccown/Dissector>`__
  123. - `GPU PerfStudio <http://developer.amd.com/tools-and-sdks/graphics-development/gpu-perfstudio/>`__
  124. - `Linux Graphics Debugger <https://developer.nvidia.com/linux-graphics-debugger>`__
  125. - `Nsight <https://developer.nvidia.com/nsight-graphics>`__
  126. - `PIX <https://blogs.msdn.microsoft.com/pix/>`__
  127. - `PerfHUD <https://developer.nvidia.com/nvidia-perfhud>`__
  128. - `RGP (Radeon GPU Profiler) <https://github.com/GPUOpen-Tools/Radeon-GPUProfiler/releases>`__
  129. - `vogl <https://github.com/ValveSoftware/vogl>`__
  130. SDL, GLFW, etc.
  131. ---------------
  132. It is possible to use bgfx with SDL, GLFW and similar cross platform
  133. windowing libraries. The main requirement is that windowing library
  134. provides access to native window handle that's used to create Direct3D
  135. device or OpenGL context.
  136. For more info see: :doc:`bgfx`.
  137. .. note:: You can use ``--with-sdl`` when running GENie to enable SDL2 integration with examples:
  138. ``genie --with-sdl vs2012``
  139. .. note:: ``--with-glfw`` is also available, but it's just simple stub to be used to test GLFW
  140. integration API.
  141. .. note:: Special care is necessary to make custom windowing to work with multithreaded renderer.
  142. Each platform has rules about where renderer can be and how multithreading interacts
  143. with context/device. To disable multithreaded render use ``BGFX_CONFIG_MULTITHREADED=0``
  144. preprocessor define.
  145. Getting Involved
  146. ----------------
  147. Everyone is welcome to contribute to bgfx by submitting bug reports, testing on different
  148. platforms, writing examples (see `ideas <https://github.com/bkaradzic/bgfx/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+needed%22>`__),
  149. improving documentation, profiling and optimizing, etc.
  150. .. note:: **When contributing to the bgfx project you must agree to the BSD 2-clause
  151. licensing terms.**
  152. Contributors
  153. ~~~~~~~~~~~~
  154. Chronological order:
  155. - Branimir Karadžić (`@bkaradzic <https://github.com/bkaradzic>`__)
  156. - Garett Bass (`@garettbass <https://github.com/garettbass>`__) - OSX port.
  157. - Jeremie Roy (`@jeremieroy <https://github.com/jeremieroy>`__) -
  158. `10-font <examples.html#font>`__,
  159. and `11-fontsdf <examples.html#fontsdf>`__ examples.
  160. - Miloš Tošić (`@milostosic <https://github.com/milostosic>`__) -
  161. `12-lod <examples.html#lod>`__ example.
  162. - Dario Manesku (`@dariomanesku <https://github.com/dariomanesku>`__) -
  163. `13-stencil <examples.html#stencil>`__,
  164. `14-shadowvolumes <examples.html#shadowvolumes>`__,
  165. `15-shadowmaps-simple <examples.html#shadowmaps-simple>`__,
  166. `16-shadowmaps <examples.html#shadowmaps>`__,
  167. `18-ibl <examples.html#ibl>`__,
  168. and `28-wireframe <examples.html#wireframe>`__ example.
  169. - James Gray (`@james4k <https://github.com/james4k>`__) - Go language API bindings.
  170. - Guillaume Piolat (`@p0nce <https://github.com/p0nce>`__) - D language API bindings.
  171. - Mike Popoloski (`@MikePopoloski <https://github.com/MikePopoloski>`__) - C#/VB/F# language API
  172. bindings, WinRT/WinPhone support.
  173. - Kai Jourdan (`@questor <https://github.com/questor>`__) -
  174. `23-vectordisplay <examples.html#vectordisplay>`__ example.
  175. - Stanlo Slasinski (`@stanlo <https://github.com/stanlo>`__) -
  176. `24-nbody <examples.html#nbody>`__ example.
  177. - Daniel Collin (`@emoon <https://github.com/emoon>`__) - Port of Ocornut's ImGui to bgfx.
  178. - Andre Weissflog (`@floooh <https://github.com/floooh>`__) - Alternative build system fips.
  179. - Andrew Johnson (`@ajohnson23 <https://github.com/ajohnson23>`__) - TeamCity build.
  180. - Tony McCrary (`@enleeten <https://github.com/enleeten>`__) - Java language API bindings.
  181. - Attila Kocsis (`@attilaz <https://github.com/attilaz>`__) - Metal rendering backend, various OSX
  182. and iOS improvements and bug fixes, `39-assao <examples.html#assao>`__ example.
  183. - Richard Gale (`@RichardGale <https://github.com/RichardGale>`__) - Emscripten entry input
  184. handling.
  185. - Andrew Mac (`@andr3wmac <https://github.com/andr3wmac>`__) -
  186. `27-terrain <examples.html#terrain>`__ example.
  187. - Oliver Charles (`@ocharles <https://github.com/ocharles>`__) - Haskel language API bindings.
  188. - Johan Sköld (`@rhoot <https://github.com/rhoot>`__) - Rust language API bindings.
  189. - Jean-François Verdon (`@Nodrev <https://github.com/Nodrev>`__) - Alternative deployment for
  190. Android.
  191. - Jason Nadro (`@jnadro <https://github.com/jnadro>`__) - Python language API bindings.
  192. - Krzysztof Kondrak (`@kondrak <https://github.com/kondrak>`__) - OculusVR integration.
  193. - Colby Klein (`@excessive <https://github.com/excessive>`__) - Lua language API bindings.
  194. - Stuart Carnie (`@stuartcarnie <https://github.com/stuartcarnie>`__) - Swift language API
  195. bindings.
  196. - Joseph Cherlin (`@jcherlin <https://github.com/jcherlin>`__) -
  197. `30-picking <examples.html#picking>`__,
  198. and `31-rsm <examples.html#rsm>`__ example.
  199. - Olli Wang (`@olliwang <https://github.com/olliwang>`__) - Various NanoVG integration improvements.
  200. - Cory Golden (`@Halsys <https://github.com/Halsys>`__) - Nim language API bindings.
  201. - Camilla Berglund (`@elmindreda <https://github.com/elmindreda>`__) - GLFW support.
  202. - Daniel Ludwig (`@code-disaster <https://github.com/code-disaster>`__) - Lightweight Java Game
  203. Library 3 bindings.
  204. - Benoit Jacquier (`@benoitjacquier <https://github.com/benoitjacquier>`__) - Added support for
  205. cubemap as texture 2D array in a compute shader.
  206. - Apoorva Joshi (`@ApoorvaJ <https://github.com/ApoorvaJ>`__) -
  207. `33-pom <examples.html#pom>`__ example.
  208. - Stanislav Pidhorsky (`@podgorskiy <https://github.com/podgorskiy>`__) -
  209. `36-sky <examples.html#sky>`__ example.
  210. - 云风 (`@cloudwu <https://github.com/cloudwu>`__) - Alternative Lua bindings, bgfx IDL scripts,
  211. `42-bunnylod <examples.html#bunnylod>`__ example.
  212. - Kostas Anagnostou (`@KostasAAA <https://github.com/KostasAAA>`__) -
  213. `37-gpudrivenrendering <examples.html#gpudrivenrendering>`__ example.
  214. - Andrew Willmott (`@andrewwillmott <https://github.com/andrewwillmott>`__) - ATC and ASTC support.
  215. - Aleš Mlakar (`@jazzbre <https://github.com/jazzbre>`__) -
  216. `40-svt <examples.html#svt>`__ example.
  217. - Matt Chiasson (`@mchiasson <https://github.com/mchiasson>`__) - Various fixes and improvements.
  218. - Phil Peron (`@pperon <https://github.com/pperon>`__) - Tutorial how to use bgfx API.
  219. - Vincent Cruz (`@BlockoS <https://github.com/BlockoS>`__) - Wayland support.
  220. - Jonathan Young (`@jpcy <https://github.com/jpcy>`__) - Renderer for ioquake3 that uses bgfx,
  221. minimal bgfx example.
  222. - Nick Waanders (`@NickWaanders <https://github.com/NickWaanders>`__) - shaderc: Metal fixes.
  223. - Vladimir Vukićević (`@vvuk <https://github.com/vvuk>`__) - HTML5 context.
  224. - Daniel Gavin (`@DanielGavin <https://github.com/DanielGavin>`__) - `41-tess <examples.html#tess>`__ example.
  225. - Ji-yong Kwon (`@rinthel <https://github.com/rinthel>`__) - Vulkan rendering backend.
  226. - Leandro Freire (`@leandrolfre <https://github.com/leandrolfre>`__).
  227. - Ari Vuollet (`@GoaLitiuM <https://github.com/GoaLitiuM>`__) IDL generator for D language
  228. bindings.
  229. - Sebastian Marketsmueller (`@sebastianmunity3d <https://github.com/sebastianmunity3d>`__).
  230. - Cedric Guillemet (`@CedricGuillemet <https://github.com/CedricGuillemet>`__).
  231. - Pablo Escobar (`@pezcode <https://github.com/pezcode>`__) - Various Vulkan fixes.
  232. - Paul Gruenbacher (`@pgruenbacher <https://github.com/pgruenbacher>`__) - Various bug fixes.
  233. - Jukka Jylänki (`@juj <https://github.com/juj>`__) - Various WebGL optimizations and fixes.
  234. - Hugo Amnov (`@hugoam <https://github.com/hugoam>`__) - WebGPU/Dawn rendering backend.
  235. - Christophe Dehais (`@goodartistscopy <https://github.com/goodartistscopy>`__) - Various bug fixes.
  236. - elvencache (`@elvencache <https://github.com/elvencache>`__) -
  237. `43-denoise <examples.html#denoise>`__,
  238. `44-sss <examples.html#sss>`__,
  239. and `45-bokeh <examples.html#bokeh>`__ example.
  240. - Richard Schubert (`@Hemofektik <https://github.com/Hemofektik/>`__) - `46-fsr <examples.html#fsr>`__ example.
  241. and `others <https://github.com/bkaradzic/bgfx/graphs/contributors>`__...
  242. Repository visualization
  243. ~~~~~~~~~~~~~~~~~~~~~~~~
  244. .. raw:: html
  245. <p>
  246. <iframe width="694" height="390" src="https://www.youtube.com/embed/5ZeN_d_-BHo" frameborder="0" allowfullscreen></iframe>
  247. </p>