overview.rst 15 KB

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