<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/blob/master/examples/00-helloworld">00-helloworld</a><aclass="headerlink"href="#helloworld"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/blob/master/examples/01-cubes/cubes.cpp">01-cubes</a><aclass="headerlink"href="#cubes"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/blob/master/examples/02-metaballs">02-metaballs</a><aclass="headerlink"href="#metaballs"title="Permalink to this headline">¶</a></h2>
<p>Rendering with transient buffers and embedding shaders.</p>
var statusElement = document.getElementById('status');
var progressElement = document.getElementById('progress');
var spinnerElement = document.getElementById('spinner');
var Module = {
preRun: [],
postRun: [],
print: (function() {
var element = document.getElementById('output');
if (element) element.value = ''; // clear browser cache
return function(text) {
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
// These replacements are necessary if you render to raw HTML
//text = text.replace(/&/g, "&");
//text = text.replace(/</g, "<");
//text = text.replace(/>/g, ">");
//text = text.replace('\n', '<br>', 'g');
console.log(text);
if (element) {
element.value += text + "\n";
element.scrollTop = element.scrollHeight; // focus on bottom
}
};
})(),
printErr: function(text) {
if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
if (0) { // XXX disabled for safety typeof dump == 'function') {
dump(text + '\n'); // fast, straight to the real console
} else {
console.error(text);
}
},
canvas: (function() {
var canvas = document.getElementById('canvas');
// As a default initial behavior, pop up an alert when webgl context is lost. To make your
// application robust, you may want to override this behavior before shipping!
// See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);
return canvas;
})(),
setStatus: function(text) {
if (!Module.setStatus.last) Module.setStatus.last = { time: Date.now(), text: '' };
if (text === Module.setStatus.text) return;
var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
var now = Date.now();
if (m && now - Date.now() <30)return;//ifthisisaprogressupdate,skipitiftoosoon
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/blob/master/examples/03-raymarch">03-raymarch</a><aclass="headerlink"href="#raymarch"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/blob/master/examples/04-mesh">04-mesh</a><aclass="headerlink"href="#mesh"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/blob/master/examples/05-instancing">05-instancing</a><aclass="headerlink"href="#instancing"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/blob/master/examples/06-bump">06-bump</a><aclass="headerlink"href="#bump"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/blob/master/examples/07-callback">07-callback</a><aclass="headerlink"href="#callback"title="Permalink to this headline">¶</a></h2>
<p>Implementing application specific callbacks for taking screen shots,
caching OpenGL binary shaders, and video capture.</p>
</div>
<divclass="section"id="update">
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/blob/master/examples/08-update">08-update</a><aclass="headerlink"href="#update"title="Permalink to this headline">¶</a></h2>
<p>Updating textures.</p>
</div>
<divclass="section"id="hdr">
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/09-hdr">09-hdr</a><aclass="headerlink"href="#hdr"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/10-font">10-font</a><aclass="headerlink"href="#font"title="Permalink to this headline">¶</a></h2>
<p>Use the font system to display text and styled text.</p>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/11-fontsdf">11-fontsdf</a><aclass="headerlink"href="#fontsdf"title="Permalink to this headline">¶</a></h2>
<p>Use a single distance field font to render text of various size.</p>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/12-lod">12-lod</a><aclass="headerlink"href="#lod"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/13-stencil">13-stencil</a><aclass="headerlink"href="#stencil"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/14-shadowvolumes">14-shadowvolumes</a><aclass="headerlink"href="#shadowvolumes"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/15-shadowmaps-simple">15-shadowmaps-simple</a><aclass="headerlink"href="#shadowmaps-simple"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/16-shadowmaps">16-shadowmaps</a><aclass="headerlink"href="#shadowmaps"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/blob/master/examples/17-drawstress">17-drawstress</a><aclass="headerlink"href="#drawstress"title="Permalink to this headline">¶</a></h2>
<divclass="section"id="hz">
<h3>60Hz<aclass="headerlink"href="#hz"title="Permalink to this headline">¶</a></h3>
<p>Draw stress is CPU stress test to show what is the maximimum number of
draw calls while maintaining 60Hz frame rate. bgfx currently has default
limit of 64K draw calls per frame. You can increase this limit by
<h3>30Hz (test for browsers)<aclass="headerlink"href="#hz-test-for-browsers"title="Permalink to this headline">¶</a></h3>
<p>By default browsers are using vsync, and don’t have option to turn it
off programatically.</p>
<tableborder="1"class="docutils">
<colgroup>
<colwidth="19%"/>
<colwidth="14%"/>
<colwidth="14%"/>
<colwidth="31%"/>
<colwidth="8%"/>
<colwidth="12%"/>
</colgroup>
<theadvalign="bottom">
<trclass="row-odd"><thclass="head">CPU</th>
<thclass="head">Renderer</th>
<thclass="head">GPU</th>
<thclass="head">Arch/Compiler/OS</th>
<thclass="head">Dim</th>
<thclass="head">Calls</th>
</tr>
</thead>
<tbodyvalign="top">
<trclass="row-even"><td>i7-920 2.66</td>
<td>GL2.1</td>
<td>GTX650Ti</td>
<td>x64/VS2008/Win7</td>
<td>38</td>
<td>64000+</td>
</tr>
<trclass="row-odd"><td>i5-4250U 1.3</td>
<td>GL2.1</td>
<td>HD5000</td>
<td>x64/Clang/OSX 10.9</td>
<td>36</td>
<td>46656</td>
</tr>
<trclass="row-even"><td>i5-4250U 1.3</td>
<td>Chrome34</td>
<td>HD5000</td>
<td>JIT/Clang/OSX-PNaCl 31</td>
<td>28</td>
<td>21952</td>
</tr>
<trclass="row-odd"><td>i5-4250U 1.3</td>
<td>Chrome33</td>
<td>HD5000</td>
<td>JIT/Clang/OSX-PNaCl 31</td>
<td>27</td>
<td>19683</td>
</tr>
<trclass="row-even"><td>i5-4250U 1.3</td>
<td>FF28</td>
<td>HD5000</td>
<td>JIT/Clang/OSX-asm.js</td>
<td>25</td>
<td>15625</td>
</tr>
<trclass="row-odd"><td>i5-4250U 1.3</td>
<td>FF36</td>
<td>HD5000</td>
<td>JIT/Clang/OSX-asm.js</td>
<td>25</td>
<td>15625</td>
</tr>
<trclass="row-even"><td>i5-4250U 1.3</td>
<td>Chrome41</td>
<td>HD5000</td>
<td>x64/GCC/OSX-NaCl 41</td>
<td>24</td>
<td>13824</td>
</tr>
<trclass="row-odd"><td>i5-4250U 1.3</td>
<td>FF37</td>
<td>HD5000</td>
<td>JIT/Clang/OSX-asm.js</td>
<td>23</td>
<td>12167</td>
</tr>
<trclass="row-even"><td>i5-4250U 1.3</td>
<td>FF27</td>
<td>HD5000</td>
<td>JIT/Clang/OSX-asm.js</td>
<td>20</td>
<td>8000</td>
</tr>
<trclass="row-odd"><td>i7-920 2.66</td>
<td>Chrome33</td>
<td>GTX650Ti</td>
<td>JIT/Clang/W7-PNaCl 31</td>
<td>20</td>
<td>8000</td>
</tr>
<trclass="row-even"><td>i7-920 2.66</td>
<td>Chrome34</td>
<td>GTX650Ti</td>
<td>JIT/Clang/W7-asm.js</td>
<td>18</td>
<td>5832</td>
</tr>
<trclass="row-odd"><td>i7-920 2.66</td>
<td>Chrome33</td>
<td>GTX650Ti</td>
<td>JIT/Clang/W7-asm.js</td>
<td>18</td>
<td>5832</td>
</tr>
<trclass="row-even"><td>i7-920 2.66</td>
<td>FF28</td>
<td>GTX650Ti</td>
<td>JIT/Clang/W7-asm.js</td>
<td>18</td>
<td>5832</td>
</tr>
<trclass="row-odd"><td>i7-920 2.66</td>
<td>FF27</td>
<td>GTX650Ti</td>
<td>JIT/Clang/W7-asm.js</td>
<td>18</td>
<td>5832</td>
</tr>
<trclass="row-even"><td>i5-4250U 1.3</td>
<td>Safari7</td>
<td>HD5000</td>
<td>JIT/Clang/OSX-asm.js</td>
<td>15</td>
<td>3375</td>
</tr>
</tbody>
</table>
</div>
</div>
<divclass="section"id="ibl">
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/18-ibl">18-ibl</a><aclass="headerlink"href="#ibl"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/19-oit">19-oit</a><aclass="headerlink"href="#oit"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/20-nanovg">20-nanovg</a><aclass="headerlink"href="#nanovg"title="Permalink to this headline">¶</a></h2>
<p>NanoVG is small antialiased vector graphics rendering library.</p>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/21-deferred">21-deferred</a><aclass="headerlink"href="#deferred"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/22-windows">22-windows</a><aclass="headerlink"href="#windows"title="Permalink to this headline">¶</a></h2>
<p>Rendering into multiple windows.</p>
</div>
<divclass="section"id="vectordisplay">
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/23-vectordisplay">23-vectordisplay</a><aclass="headerlink"href="#vectordisplay"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/24-nbody">24-nbody</a><aclass="headerlink"href="#nbody"title="Permalink to this headline">¶</a></h2>
<p>N-body simulation with compute shaders using buffers.</p>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/25-c99">25-c99</a><aclass="headerlink"href="#c99"title="Permalink to this headline">¶</a></h2>
<p>Initialization and debug text with C99 API.</p>
</div>
<divclass="section"id="occlusion">
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/26-occlusion">26-occlusion</a><aclass="headerlink"href="#occlusion"title="Permalink to this headline">¶</a></h2>
<p>Using occlusion query for conditional rendering.</p>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/27-terrain">27-terrain</a><aclass="headerlink"href="#terrain"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/28-wireframe">28-wireframe</a><aclass="headerlink"href="#wireframe"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/29-debugdraw">29-debugdraw</a><aclass="headerlink"href="#debugdraw"title="Permalink to this headline">¶</a></h2>
<h2><aclass="reference external"href="https://github.com/bkaradzic/bgfx/tree/master/examples/30-picking">30-picking</a><aclass="headerlink"href="#picking"title="Permalink to this headline">¶</a></h2>