| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259 |
- <!DOCTYPE html>
- <!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
- <!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
- <head>
- <meta charset="utf-8">
-
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
- <title>Tools — bgfx 1.0 documentation</title>
-
-
-
-
-
-
- <script type="text/javascript" src="_static/js/modernizr.min.js"></script>
-
-
- <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
- <script src="_static/jquery.js"></script>
- <script src="_static/underscore.js"></script>
- <script src="_static/doctools.js"></script>
- <script src="_static/language_data.js"></script>
-
- <script type="text/javascript" src="_static/js/theme.js"></script>
-
-
- <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
- <link rel="index" title="Index" href="genindex.html" />
- <link rel="search" title="Search" href="search.html" />
- <link rel="next" title="Internals" href="internals.html" />
- <link rel="prev" title="API Reference" href="bgfx.html" />
- </head>
- <body class="wy-body-for-nav">
-
- <div class="wy-grid-for-nav">
-
- <nav data-toggle="wy-nav-shift" class="wy-nav-side">
- <div class="wy-side-scroll">
- <div class="wy-side-nav-search" >
-
-
- <a href="index.html" class="icon icon-home"> bgfx
-
-
- </a>
-
-
-
- <div class="version">
- 1.0
- </div>
-
-
-
- <div role="search">
- <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
- <input type="text" name="q" placeholder="Search docs" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- </div>
-
- </div>
- <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
-
-
-
-
-
-
- <ul class="current">
- <li class="toctree-l1"><a class="reference internal" href="overview.html">Overview</a></li>
- <li class="toctree-l1"><a class="reference internal" href="build.html">Building</a></li>
- <li class="toctree-l1"><a class="reference internal" href="examples.html">Examples</a></li>
- <li class="toctree-l1"><a class="reference internal" href="bgfx.html">API Reference</a></li>
- <li class="toctree-l1 current"><a class="current reference internal" href="#">Tools</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="#geometry-compiler-geometryc">Geometry Compiler (geometryc)</a></li>
- <li class="toctree-l2"><a class="reference internal" href="#shader-compiler-shaderc">Shader Compiler (shaderc)</a><ul>
- <li class="toctree-l3"><a class="reference internal" href="#building-shaders">Building shaders</a></li>
- </ul>
- </li>
- <li class="toctree-l2"><a class="reference internal" href="#texture-compiler-texturec">Texture Compiler (texturec)</a></li>
- <li class="toctree-l2"><a class="reference internal" href="#texture-viewer-texturev">Texture Viewer (texturev)</a></li>
- </ul>
- </li>
- <li class="toctree-l1"><a class="reference internal" href="internals.html">Internals</a></li>
- <li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
- </ul>
-
-
- </div>
- </div>
- </nav>
- <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
-
- <nav class="wy-nav-top" aria-label="top navigation">
-
- <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
- <a href="index.html">bgfx</a>
-
- </nav>
- <div class="wy-nav-content">
-
- <div class="rst-content">
-
-
- <div role="navigation" aria-label="breadcrumbs navigation">
- <ul class="wy-breadcrumbs">
-
- <li><a href="index.html">Docs</a> »</li>
-
- <li>Tools</li>
-
-
- <li class="wy-breadcrumbs-aside">
-
-
-
- </li>
-
- </ul>
-
- <hr/>
- </div>
- <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
- <div itemprop="articleBody">
-
- <div class="section" id="tools">
- <h1>Tools<a class="headerlink" href="#tools" title="Permalink to this headline">¶</a></h1>
- <div class="section" id="geometry-compiler-geometryc">
- <h2>Geometry Compiler (geometryc)<a class="headerlink" href="#geometry-compiler-geometryc" title="Permalink to this headline">¶</a></h2>
- <p>Converts Wavefront .obj mesh file to format optimal for using with bgfx.</p>
- </div>
- <div class="section" id="shader-compiler-shaderc">
- <h2>Shader Compiler (shaderc)<a class="headerlink" href="#shader-compiler-shaderc" title="Permalink to this headline">¶</a></h2>
- <p>bgfx cross-platform shader language is based on GLSL syntax. It’s uses
- ANSI C preprocessor to transform GLSL like language syntax into HLSL.
- This technique has certain drawbacks, but overall it’s simple and allows
- quick authoring of cross-platform shaders.</p>
- <p>Some differences between bgfx’s shaderc flavor of GLSL and regular GLSL:</p>
- <ul class="simple">
- <li><p>No <code class="docutils literal notranslate"><span class="pre">bool/int</span></code> uniforms, all uniforms must be <code class="docutils literal notranslate"><span class="pre">float</span></code>.</p></li>
- <li><p>Attributes and varyings can be accessed only from <code class="docutils literal notranslate"><span class="pre">main()</span></code>
- function.</p></li>
- <li><p>Must use <code class="docutils literal notranslate"><span class="pre">SAMPLER2D/3D/CUBE/etc.</span></code> macros instead of
- <code class="docutils literal notranslate"><span class="pre">sampler2D/3D/Cube/etc.</span></code> tokens.</p></li>
- <li><p>Must use <code class="docutils literal notranslate"><span class="pre">vec2/3/4_splat(<value>)</span></code> instead of
- <code class="docutils literal notranslate"><span class="pre">vec2/3/4(<value>)</span></code>.</p></li>
- <li><p>Must use <code class="docutils literal notranslate"><span class="pre">mtxFromCols/mtxFromRows</span></code> when constructing matrices in shaders.</p></li>
- <li><p>Must use <code class="docutils literal notranslate"><span class="pre">mul(x,</span> <span class="pre">y)</span></code> when multiplying vectors and matrices.</p></li>
- <li><p>Must use <code class="docutils literal notranslate"><span class="pre">varying.def.sc</span></code> to define input/output semantic and
- precission instead of using <code class="docutils literal notranslate"><span class="pre">attribute/in</span></code> and <code class="docutils literal notranslate"><span class="pre">varying/in/out</span></code>.</p></li>
- <li><p><code class="docutils literal notranslate"><span class="pre">$input/$output</span></code> tokens must appear at the begining of shader.</p></li>
- </ul>
- <p>For more info see <a class="reference external" href="https://github.com/bkaradzic/bgfx/blob/master/src/bgfx_shader.sh">shader helper
- macros</a>.</p>
- <div class="section" id="building-shaders">
- <h3>Building shaders<a class="headerlink" href="#building-shaders" title="Permalink to this headline">¶</a></h3>
- <p>Shaders must be compiled for all renderers by using <cite>shaderc</cite> tool. Makefile to simplify building
- shaders is provided in examples. D3D9 and D3D11 shaders can be only compiled on Windows.</p>
- </div>
- </div>
- <div class="section" id="texture-compiler-texturec">
- <h2>Texture Compiler (texturec)<a class="headerlink" href="#texture-compiler-texturec" title="Permalink to this headline">¶</a></h2>
- <p>Convert PNG, TGA, DDS, KTX, PVR texture into bgfx supported texture formats.</p>
- </div>
- <div class="section" id="texture-viewer-texturev">
- <h2>Texture Viewer (texturev)<a class="headerlink" href="#texture-viewer-texturev" title="Permalink to this headline">¶</a></h2>
- <p>Texture viewer.</p>
- </div>
- </div>
- </div>
-
- </div>
- <footer>
-
- <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
-
- <a href="internals.html" class="btn btn-neutral float-right" title="Internals" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
-
-
- <a href="bgfx.html" class="btn btn-neutral float-left" title="API Reference" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
-
- </div>
-
- <hr/>
- <div role="contentinfo">
- <p>
- © Copyright 2010-2019, Branimir Karadžić
- </p>
- </div>
- </footer>
- </div>
- </div>
- </section>
- </div>
-
- <script type="text/javascript">
- jQuery(function () {
- SphinxRtdTheme.Navigation.enable(true);
- });
- </script>
-
-
-
-
- </body>
- </html>
|