overview.rst 15 KB

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