| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585 |
- <?xml version="1.0" encoding="utf-8" ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
- <title></title>
- <style type="text/css">
- /*
- :Author: David Goodger ([email protected])
- :Id: $Id: html4css1.css 5196 2007-06-03 20:25:28Z wiemann $
- :Copyright: This stylesheet has been placed in the public domain.
- Default cascading style sheet for the HTML output of Docutils.
- See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
- customize this style sheet.
- */
- /* used to remove borders from tables and images */
- .borderless, table.borderless td, table.borderless th {
- border: 0 }
- table.borderless td, table.borderless th {
- /* Override padding for "table.docutils td" with "! important".
- The right padding separates the table cells. */
- padding: 0 0.5em 0 0 ! important }
- .first {
- /* Override more specific margin styles with "! important". */
- margin-top: 0 ! important }
- .last, .with-subtitle {
- margin-bottom: 0 ! important }
- .hidden {
- display: none }
- a.toc-backref {
- text-decoration: none ;
- color: black }
- blockquote.epigraph {
- margin: 2em 5em ; }
- dl.docutils dd {
- margin-bottom: 0.5em }
- /* Uncomment (and remove this text!) to get bold-faced definition list terms
- dl.docutils dt {
- font-weight: bold }
- */
- div.abstract {
- margin: 2em 5em }
- div.abstract p.topic-title {
- font-weight: bold ;
- text-align: center }
- div.admonition, div.attention, div.caution, div.danger, div.error,
- div.hint, div.important, div.note, div.tip, div.warning {
- margin: 2em ;
- border: medium outset ;
- padding: 1em }
- div.admonition p.admonition-title, div.hint p.admonition-title,
- div.important p.admonition-title, div.note p.admonition-title,
- div.tip p.admonition-title {
- font-weight: bold ;
- font-family: sans-serif }
- div.attention p.admonition-title, div.caution p.admonition-title,
- div.danger p.admonition-title, div.error p.admonition-title,
- div.warning p.admonition-title {
- color: red ;
- font-weight: bold ;
- font-family: sans-serif }
- /* Uncomment (and remove this text!) to get reduced vertical space in
- compound paragraphs.
- div.compound .compound-first, div.compound .compound-middle {
- margin-bottom: 0.5em }
- div.compound .compound-last, div.compound .compound-middle {
- margin-top: 0.5em }
- */
- div.dedication {
- margin: 2em 5em ;
- text-align: center ;
- font-style: italic }
- div.dedication p.topic-title {
- font-weight: bold ;
- font-style: normal }
- div.figure {
- margin-left: 2em ;
- margin-right: 2em }
- div.footer, div.header {
- clear: both;
- font-size: smaller }
- div.line-block {
- display: block ;
- margin-top: 1em ;
- margin-bottom: 1em }
- div.line-block div.line-block {
- margin-top: 0 ;
- margin-bottom: 0 ;
- margin-left: 1.5em }
- div.sidebar {
- margin: 0 0 0.5em 1em ;
- border: medium outset ;
- padding: 1em ;
- background-color: #ffffee ;
- width: 40% ;
- float: right ;
- clear: right }
- div.sidebar p.rubric {
- font-family: sans-serif ;
- font-size: medium }
- div.system-messages {
- margin: 5em }
- div.system-messages h1 {
- color: red }
- div.system-message {
- border: medium outset ;
- padding: 1em }
- div.system-message p.system-message-title {
- color: red ;
- font-weight: bold }
- div.topic {
- margin: 2em }
- h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
- h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
- margin-top: 0.4em }
- h1.title {
- text-align: center }
- h2.subtitle {
- text-align: center }
- hr.docutils {
- width: 75% }
- img.align-left {
- clear: left }
- img.align-right {
- clear: right }
- ol.simple, ul.simple {
- margin-bottom: 1em }
- ol.arabic {
- list-style: decimal }
- ol.loweralpha {
- list-style: lower-alpha }
- ol.upperalpha {
- list-style: upper-alpha }
- ol.lowerroman {
- list-style: lower-roman }
- ol.upperroman {
- list-style: upper-roman }
- p.attribution {
- text-align: right ;
- margin-left: 50% }
- p.caption {
- font-style: italic }
- p.credits {
- font-style: italic ;
- font-size: smaller }
- p.label {
- white-space: nowrap }
- p.rubric {
- font-weight: bold ;
- font-size: larger ;
- color: maroon ;
- text-align: center }
- p.sidebar-title {
- font-family: sans-serif ;
- font-weight: bold ;
- font-size: larger }
- p.sidebar-subtitle {
- font-family: sans-serif ;
- font-weight: bold }
- p.topic-title {
- font-weight: bold }
- pre.address {
- margin-bottom: 0 ;
- margin-top: 0 ;
- font-family: serif ;
- font-size: 100% }
- pre.literal-block, pre.doctest-block {
- margin-left: 2em ;
- margin-right: 2em }
- span.classifier {
- font-family: sans-serif ;
- font-style: oblique }
- span.classifier-delimiter {
- font-family: sans-serif ;
- font-weight: bold }
- span.interpreted {
- font-family: sans-serif }
- span.option {
- white-space: nowrap }
- span.pre {
- white-space: pre }
- span.problematic {
- color: red }
- span.section-subtitle {
- /* font-size relative to parent (h1..h6 element) */
- font-size: 80% }
- table.citation {
- border-left: solid 1px gray;
- margin-left: 1px }
- table.docinfo {
- margin: 2em 4em }
- table.docutils {
- margin-top: 0.5em ;
- margin-bottom: 0.5em }
- table.footnote {
- border-left: solid 1px black;
- margin-left: 1px }
- table.docutils td, table.docutils th,
- table.docinfo td, table.docinfo th {
- padding-left: 0.5em ;
- padding-right: 0.5em ;
- vertical-align: top }
- table.docutils th.field-name, table.docinfo th.docinfo-name {
- font-weight: bold ;
- text-align: left ;
- white-space: nowrap ;
- padding-left: 0 }
- h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
- h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
- font-size: 100% }
- ul.auto-toc {
- list-style-type: none }
- </style>
- </head>
- <body>
- <div class="document">
- <p><strong>AnKi 3D Engine</strong></p>
- <p>Copyright (C) 2009-2011 Panagiotis Christopoulos-Charitos</p>
- <p><a class="reference external" href="http://www.anki3d.org">http://www.anki3d.org</a></p>
- <p><a class="reference external" href="mailto:godlike@ancient-ritual.com">godlike@ancient-ritual.com</a></p>
- <div class="contents topic" id="table-of-contents">
- <p class="topic-title first">Table of Contents</p>
- <ul class="simple">
- <li><a class="reference internal" href="#license" id="id1">License</a></li>
- <li><a class="reference internal" href="#building" id="id2">Building</a><ul>
- <li><a class="reference internal" href="#required-external-libraries" id="id3">Required external libraries</a></li>
- <li><a class="reference internal" href="#building-anki-and-optionally-generating-makefiles" id="id4">Building AnKi and optionally generating makefiles</a></li>
- </ul>
- </li>
- <li><a class="reference internal" href="#assets" id="id5">Assets</a></li>
- <li><a class="reference internal" href="#system-requirements" id="id6">System requirements</a></li>
- <li><a class="reference internal" href="#generating-source-code-documentation-doxygen" id="id7">Generating source code documentation (doxygen)</a></li>
- <li><a class="reference internal" href="#coding-style" id="id8">Coding style</a><ul>
- <li><a class="reference internal" href="#types" id="id9">Types</a></li>
- <li><a class="reference internal" href="#functions-variables" id="id10">Functions & variables</a></li>
- <li><a class="reference internal" href="#constants-macros-enumerators" id="id11">Constants, macros & enumerators</a></li>
- <li><a class="reference internal" href="#parenthesis-braces-comas-operators" id="id12">Parenthesis, braces, comas & operators</a></li>
- <li><a class="reference internal" href="#order-in-class-definitions" id="id13">Order in class definitions</a></li>
- <li><a class="reference internal" href="#naming-shortcuts" id="id14">Naming shortcuts</a></li>
- <li><a class="reference internal" href="#controllers" id="id15">Controllers</a></li>
- <li><a class="reference internal" href="#glsl-shaders" id="id16">GLSL shaders</a></li>
- <li><a class="reference internal" href="#submitting-patches" id="id17">Submitting patches</a></li>
- </ul>
- </li>
- <li><a class="reference internal" href="#todo-list" id="id18">ToDo list</a></li>
- </ul>
- </div>
- <div class="section" id="license">
- <h1><a class="toc-backref" href="#id1">License</a></h1>
- <p>Anki is dual licensed. The first option is GLPv3 and the second commercial
- license. If you want to use* AnKi to make opensource software (licensed under
- GLPv3) then AnKi is provited to you for free but if you want to use it* for
- non-GPLv3 licensed software then you have to apply for a commercial license.</p>
- <p>*: as a whole or parts of the source</p>
- </div>
- <div class="section" id="building">
- <h1><a class="toc-backref" href="#id2">Building</a></h1>
- <p>AnKi build system is build over the popular CMake.</p>
- <p>To download the latest version of AnKi from the SVN repository type:</p>
- <pre class="literal-block">
- svn checkout http://anki-3d-engine.googlecode.com/svn/trunk/ anki
- </pre>
- <p>to build:</p>
- <div class="section" id="required-external-libraries">
- <h2><a class="toc-backref" href="#id3">Required external libraries</a></h2>
- <p>AnKi requires a few up to date versions of some libraries. The libraries are:</p>
- <ul class="simple">
- <li>Bullet Physics 2.77 (in extern)</li>
- <li>SDL 1.3 (in extern)</li>
- <li>GLEW 1.5.5 (in extern)</li>
- <li>boost 1.46</li>
- <li>libpng 1.2</li>
- <li>libjpeg 6b</li>
- <li>libpython 2.6</li>
- </ul>
- <p>Normally, in order to build AnKi you need to have all of the above libraries.
- Some of them are not that common and</p>
- <p>Some of them are not provided from the most Linux distros or they are older
- versions. The libraries you have to download and build for yourself are Bullet,
- SDL and GLEW. The other are pretty common and you can find them almost anywhere.</p>
- <p>To ease the building process and to save you some time <strong>some</strong> of the above
- libraries are already backed and placed inside the extern directory. The backed
- libraries are for Linux and for x86-64 architecture. If you dont trust my
- binaries and/or you want to build the libs yourselves you have to download,
- build and install the libs in the extern directory manually. The script
- <em>download-externs.sh</em> downloads the libraries (it requires SVN, mercurial,
- CMake, autoconf) and the <em>do-externs.sh</em> builds the libraries and installs them
- in the extern directory. Open the files and see how it is done.</p>
- <p>You wont find any development files for boost, libpng, libjpeg and libpython
- inside the extern dir. Get them using your Linux distribution's packet manager.</p>
- </div>
- <div class="section" id="building-anki-and-optionally-generating-makefiles">
- <h2><a class="toc-backref" href="#id4">Building AnKi and optionally generating makefiles</a></h2>
- <p>Inside the build directory you can find 4 build targets containing GNU
- makefiles. If you want to build AnKi just type "make" from inside a target.</p>
- <p><strong>WARNING</strong>: Sometimes I forget to update all the targets. The debug is always
- updated though.</p>
- <p>AnKi uses a build system that generates the above makefiles. This build system
- is no longer part of AnKi and its located in a different repository. This tool
- is called gBuildSystem and you can find it in
- <a class="reference external" href="http://godlike-projects.googlecode.com/svn/trunk/gBuildSystem">http://godlike-projects.googlecode.com/svn/trunk/gBuildSystem</a>. Downloaded it
- using SVN:</p>
- <p>$ svn checkout <a class="reference external" href="http://godlike-projects.googlecode.com/svn/trunk/gBuildSystem">http://godlike-projects.googlecode.com/svn/trunk/gBuildSystem</a></p>
- <p>gBuildSystem only purpose is to re-generate these makefiles in case you have
- made changes in the code structure (renaming/moving/deleting/adding files) or in
- the included header files (#include) or your have the external libs in different
- paths. gBuildSystem requires the gen.cfg.py files (something like
- CMakeLists.txt). gen.cfg.py format is pretty straightforward and minimal.</p>
- <p>If you want to generate the makefile for the debug target (for example) do the
- following:</p>
- <ol class="arabic simple">
- <li>$ cd <path to anki>/build/debug</li>
- <li>$ <path to gBuildSystem>/gbs.py</li>
- </ol>
- <p>To build:</p>
- <p>$ make</p>
- <p>And the build process will begin.</p>
- </div>
- </div>
- <div class="section" id="assets">
- <h1><a class="toc-backref" href="#id5">Assets</a></h1>
- <p>Currently there are no assets (models, textures, materials etc) so even if you
- build it, the application will fail to run.</p>
- </div>
- <div class="section" id="system-requirements">
- <h1><a class="toc-backref" href="#id6">System requirements</a></h1>
- <p>The engine requires:</p>
- <ul class="simple">
- <li>GPU with shader model 4</li>
- <li>Linux OS</li>
- <li>Proprietary GPU drivers</li>
- </ul>
- <p>Development rig: Ubuntu 10.10, AMD Radeon 4870 w/ Catalyst 10.10. So it should
- be working on similar systems.</p>
- </div>
- <div class="section" id="generating-source-code-documentation-doxygen">
- <h1><a class="toc-backref" href="#id7">Generating source code documentation (doxygen)</a></h1>
- <p>The AnKi source code uses doxygen style comments in almost every file. To
- generate the documentation you need doxygen (<a class="reference external" href="http://www.doxygen.org/">http://www.doxygen.org/</a>). From a
- terminal type:</p>
- <ol class="arabic simple">
- <li>$ cd docs</li>
- <li>$ doxygen doxyfile</li>
- </ol>
- <p>Then open doxygen.html to see it.</p>
- </div>
- <div class="section" id="coding-style">
- <h1><a class="toc-backref" href="#id8">Coding style</a></h1>
- <p>Every project has some rules and here are some things to remember while coding
- AnKi.</p>
- <div class="section" id="types">
- <h2><a class="toc-backref" href="#id9">Types</a></h2>
- <p>The classes, structs, typedefs, enums etc must be capitalized eg <em>ThisIsAClass</em></p>
- </div>
- <div class="section" id="functions-variables">
- <h2><a class="toc-backref" href="#id10">Functions & variables</a></h2>
- <p>All functions (including class methods) and all variables are mixed case.</p>
- <p>All functions should have a verb inside them eg <em>doSomething()</em></p>
- <p>All variables should not have verbs eg <em>oneVariable</em></p>
- </div>
- <div class="section" id="constants-macros-enumerators">
- <h2><a class="toc-backref" href="#id11">Constants, macros & enumerators</a></h2>
- <p>All constants, macros and enumerators are capital with undercores eg <em>#define
- MACRO(x)</em> or <em>const int ONE_INT = 10;</em></p>
- <p>All the constants should be defined without using the preprocessor eg dont write
- <em>#define ONE_INT 10</em></p>
- <p>All enumerators have the first letters of the enum as prefix eg
- <em>enum CarColors { CC_BLUE, CC_GREEN };</em></p>
- </div>
- <div class="section" id="parenthesis-braces-comas-operators">
- <h2><a class="toc-backref" href="#id12">Parenthesis, braces, comas & operators</a></h2>
- <p>After opening parenthesis and before closing it there is no spaces, same for
- square brackets. Before and after an operator there is always a space</p>
- <p>eg <em>((mat1 * 10) + 10)</em> or <em>setWidth(100)</em> or <em>int arr[100 + 1];</em></p>
- <p>After a coma there is a space eg <em>setSize(10, 20)</em></p>
- </div>
- <div class="section" id="order-in-class-definitions">
- <h2><a class="toc-backref" href="#id13">Order in class definitions</a></h2>
- <p>class</p>
- <p>{</p>
- <blockquote>
- <p>friends</p>
- <p>pre-nested (very rare)</p>
- <p>nested</p>
- <p>properties</p>
- <p>public</p>
- <p>protected</p>
- <p>private</p>
- </blockquote>
- <p>}</p>
- <p>inlines</p>
- </div>
- <div class="section" id="naming-shortcuts">
- <h2><a class="toc-backref" href="#id14">Naming shortcuts</a></h2>
- <p>This list contains some of the naming shortcuts we use in AnKi. This is because
- we are bored to type:</p>
- <ul class="simple">
- <li>Array : arr</li>
- <li>Animation : anim</li>
- <li>Application : app</li>
- <li>Buffer : buff</li>
- <li>Camera : cam</li>
- <li>Color : col</li>
- <li>Controller : ctrl</li>
- <li>Current : crnt</li>
- <li>Feature : feat</li>
- <li>Fragment : frag</li>
- <li>Framebuffer Attachable Image : fai</li>
- <li>Geometry : geom</li>
- <li>Location : loc</li>
- <li>Material : mtl</li>
- <li>Matrix : mat</li>
- <li>Number : num</li>
- <li>Physics : phy</li>
- <li>Position : pos</li>
- <li>Property : prop</li>
- <li>Quadrilateral : quad</li>
- <li>Quaternion : quat</li>
- <li>Resource : rsrc</li>
- <li>Rotation : rot</li>
- <li>Shader : shdr</li>
- <li>Shader Program : shaderProg or sProg</li>
- <li>Skeletal Animation : sAnim</li>
- <li>Skeleton : skel</li>
- <li>Text : txt</li>
- <li>Texture : tex</li>
- <li>Transformation : trf</li>
- <li>Transform Feedback : trffb</li>
- <li>Translation : tsl</li>
- <li>Triangle : tri</li>
- <li>Utility : util</li>
- <li>Variable : var</li>
- <li>Vector : vec</li>
- <li>Vertex : vert</li>
- </ul>
- <p>Anything else should be typed full.</p>
- </div>
- <div class="section" id="controllers">
- <h2><a class="toc-backref" href="#id15">Controllers</a></h2>
- <p>The controllers are part of the scene node objects. They control the node's
- behaviour.</p>
- <p>They have an input (script, animation, etc) and they control a scene node. The
- naming convention of the controllers is:</p>
- <p><what the controller controls><the input of the contoller>Ctrl</p>
- <p>For Example:</p>
- <p>MeshSkelNodeCtrl A Mesh is controlled by a SkelNode</p>
- </div>
- <div class="section" id="glsl-shaders">
- <h2><a class="toc-backref" href="#id16">GLSL shaders</a></h2>
- <p>The same rules apply to GLSL shaders but with a few changes:</p>
- <p>All the vars you can find in a GLSL shader program are either attributes,
- uniforms or in/out vars (varyings) and everything else. The attributes and
- uniforms are mixed case. The in/out vars are mixed case as well but they have a
- prefix string that indicates their output. For example if a var is output from
- the vertex shader it will have a 'v' before its name. The In detail:</p>
- <p>v: Vertex shader
- tc: Tessellation control shader
- te: Tessellation evaluation shader
- g: Geometry shader
- f: Fragment shader</p>
- <p>All the other variables (locals and globals) inside the code are mixed case but
- with a leading and a following underscore.</p>
- </div>
- <div class="section" id="submitting-patches">
- <h2><a class="toc-backref" href="#id17">Submitting patches</a></h2>
- <p>If you want to update/patch a file (for example Main.cpp) do:</p>
- <ul class="simple">
- <li>Make the changes on that file</li>
- <li>Save the differences in a file using "svn diff Main.cpp > /tmp/diff"</li>
- <li>E-mail the "diff" file with subject "[PATCH] Main.cpp updates"</li>
- </ul>
- </div>
- </div>
- <div class="section" id="todo-list">
- <h1><a class="toc-backref" href="#id18">ToDo list</a></h1>
- <ul>
- <li><p class="first">Continue working on the new coding style in shaders</p>
- </li>
- <li><p class="first">Changes in the blending objects problem. The BS will become one stage and the
- PPS will be divided in two steps. The first will apply the SSAO and the EdgeAA
- in the IS_FAI and the second will do the rest</p>
- </li>
- <li><p class="first">The second Physics demo: Create a box that is geting moved by the user. It has
- to interact with the other boxes</p>
- </li>
- <li><p class="first">Set the gravity of a certain body to a lower value and see how it behaves</p>
- </li>
- <li><p class="first">In the Ragdoll bullet demo try to change the distances of the bodies</p>
- </li>
- <li><dl class="first docutils">
- <dt>Ask in the bullet forum:</dt>
- <dd><ul class="first last simple">
- <li>How to make floating particles like smoke. But first try with one body and
- manualy setting the gravity</li>
- <li>What the btCollisionObject::setActivationState takes as parameter?</li>
- </ul>
- </dd>
- </dl>
- </li>
- <li><p class="first">Re-enable the stencil tex in Ms.cpp and replace all the stencil buffers with
- that (Smo, Bs) to save memory</p>
- </li>
- <li><p class="first">See if the restrictions in FBOs (all FAIs same size) still apply</p>
- </li>
- <li><p class="first">See what happens if I write <em>#pragma anki attribute <randName> 10</em> where
- randName does not exist. Do the same for tranform feedback varyings</p>
- </li>
- </ul>
- </div>
- </div>
- </body>
- </html>
|