overview.rst 15 KB

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