readme.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
  7. <title></title>
  8. <style type="text/css">
  9. /*
  10. :Author: David Goodger ([email protected])
  11. :Id: $Id: html4css1.css 5196 2007-06-03 20:25:28Z wiemann $
  12. :Copyright: This stylesheet has been placed in the public domain.
  13. Default cascading style sheet for the HTML output of Docutils.
  14. See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
  15. customize this style sheet.
  16. */
  17. /* used to remove borders from tables and images */
  18. .borderless, table.borderless td, table.borderless th {
  19. border: 0 }
  20. table.borderless td, table.borderless th {
  21. /* Override padding for "table.docutils td" with "! important".
  22. The right padding separates the table cells. */
  23. padding: 0 0.5em 0 0 ! important }
  24. .first {
  25. /* Override more specific margin styles with "! important". */
  26. margin-top: 0 ! important }
  27. .last, .with-subtitle {
  28. margin-bottom: 0 ! important }
  29. .hidden {
  30. display: none }
  31. a.toc-backref {
  32. text-decoration: none ;
  33. color: black }
  34. blockquote.epigraph {
  35. margin: 2em 5em ; }
  36. dl.docutils dd {
  37. margin-bottom: 0.5em }
  38. /* Uncomment (and remove this text!) to get bold-faced definition list terms
  39. dl.docutils dt {
  40. font-weight: bold }
  41. */
  42. div.abstract {
  43. margin: 2em 5em }
  44. div.abstract p.topic-title {
  45. font-weight: bold ;
  46. text-align: center }
  47. div.admonition, div.attention, div.caution, div.danger, div.error,
  48. div.hint, div.important, div.note, div.tip, div.warning {
  49. margin: 2em ;
  50. border: medium outset ;
  51. padding: 1em }
  52. div.admonition p.admonition-title, div.hint p.admonition-title,
  53. div.important p.admonition-title, div.note p.admonition-title,
  54. div.tip p.admonition-title {
  55. font-weight: bold ;
  56. font-family: sans-serif }
  57. div.attention p.admonition-title, div.caution p.admonition-title,
  58. div.danger p.admonition-title, div.error p.admonition-title,
  59. div.warning p.admonition-title {
  60. color: red ;
  61. font-weight: bold ;
  62. font-family: sans-serif }
  63. /* Uncomment (and remove this text!) to get reduced vertical space in
  64. compound paragraphs.
  65. div.compound .compound-first, div.compound .compound-middle {
  66. margin-bottom: 0.5em }
  67. div.compound .compound-last, div.compound .compound-middle {
  68. margin-top: 0.5em }
  69. */
  70. div.dedication {
  71. margin: 2em 5em ;
  72. text-align: center ;
  73. font-style: italic }
  74. div.dedication p.topic-title {
  75. font-weight: bold ;
  76. font-style: normal }
  77. div.figure {
  78. margin-left: 2em ;
  79. margin-right: 2em }
  80. div.footer, div.header {
  81. clear: both;
  82. font-size: smaller }
  83. div.line-block {
  84. display: block ;
  85. margin-top: 1em ;
  86. margin-bottom: 1em }
  87. div.line-block div.line-block {
  88. margin-top: 0 ;
  89. margin-bottom: 0 ;
  90. margin-left: 1.5em }
  91. div.sidebar {
  92. margin: 0 0 0.5em 1em ;
  93. border: medium outset ;
  94. padding: 1em ;
  95. background-color: #ffffee ;
  96. width: 40% ;
  97. float: right ;
  98. clear: right }
  99. div.sidebar p.rubric {
  100. font-family: sans-serif ;
  101. font-size: medium }
  102. div.system-messages {
  103. margin: 5em }
  104. div.system-messages h1 {
  105. color: red }
  106. div.system-message {
  107. border: medium outset ;
  108. padding: 1em }
  109. div.system-message p.system-message-title {
  110. color: red ;
  111. font-weight: bold }
  112. div.topic {
  113. margin: 2em }
  114. h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
  115. h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
  116. margin-top: 0.4em }
  117. h1.title {
  118. text-align: center }
  119. h2.subtitle {
  120. text-align: center }
  121. hr.docutils {
  122. width: 75% }
  123. img.align-left {
  124. clear: left }
  125. img.align-right {
  126. clear: right }
  127. ol.simple, ul.simple {
  128. margin-bottom: 1em }
  129. ol.arabic {
  130. list-style: decimal }
  131. ol.loweralpha {
  132. list-style: lower-alpha }
  133. ol.upperalpha {
  134. list-style: upper-alpha }
  135. ol.lowerroman {
  136. list-style: lower-roman }
  137. ol.upperroman {
  138. list-style: upper-roman }
  139. p.attribution {
  140. text-align: right ;
  141. margin-left: 50% }
  142. p.caption {
  143. font-style: italic }
  144. p.credits {
  145. font-style: italic ;
  146. font-size: smaller }
  147. p.label {
  148. white-space: nowrap }
  149. p.rubric {
  150. font-weight: bold ;
  151. font-size: larger ;
  152. color: maroon ;
  153. text-align: center }
  154. p.sidebar-title {
  155. font-family: sans-serif ;
  156. font-weight: bold ;
  157. font-size: larger }
  158. p.sidebar-subtitle {
  159. font-family: sans-serif ;
  160. font-weight: bold }
  161. p.topic-title {
  162. font-weight: bold }
  163. pre.address {
  164. margin-bottom: 0 ;
  165. margin-top: 0 ;
  166. font-family: serif ;
  167. font-size: 100% }
  168. pre.literal-block, pre.doctest-block {
  169. margin-left: 2em ;
  170. margin-right: 2em }
  171. span.classifier {
  172. font-family: sans-serif ;
  173. font-style: oblique }
  174. span.classifier-delimiter {
  175. font-family: sans-serif ;
  176. font-weight: bold }
  177. span.interpreted {
  178. font-family: sans-serif }
  179. span.option {
  180. white-space: nowrap }
  181. span.pre {
  182. white-space: pre }
  183. span.problematic {
  184. color: red }
  185. span.section-subtitle {
  186. /* font-size relative to parent (h1..h6 element) */
  187. font-size: 80% }
  188. table.citation {
  189. border-left: solid 1px gray;
  190. margin-left: 1px }
  191. table.docinfo {
  192. margin: 2em 4em }
  193. table.docutils {
  194. margin-top: 0.5em ;
  195. margin-bottom: 0.5em }
  196. table.footnote {
  197. border-left: solid 1px black;
  198. margin-left: 1px }
  199. table.docutils td, table.docutils th,
  200. table.docinfo td, table.docinfo th {
  201. padding-left: 0.5em ;
  202. padding-right: 0.5em ;
  203. vertical-align: top }
  204. table.docutils th.field-name, table.docinfo th.docinfo-name {
  205. font-weight: bold ;
  206. text-align: left ;
  207. white-space: nowrap ;
  208. padding-left: 0 }
  209. h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
  210. h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
  211. font-size: 100% }
  212. ul.auto-toc {
  213. list-style-type: none }
  214. </style>
  215. </head>
  216. <body>
  217. <div class="document">
  218. <p><strong>AnKi 3D Engine</strong></p>
  219. <p>Copyright (C) 2009, 2010 Panagiotis Christopoulos-Charitos</p>
  220. <p><a class="reference external" href="http://www.ancient-ritual.com">http://www.ancient-ritual.com</a>
  221. <a class="reference external" href="mailto:godlike&#64;ancient-ritual.com">godlike&#64;ancient-ritual.com</a></p>
  222. <div class="contents topic" id="table-of-contents">
  223. <p class="topic-title first">Table of Contents</p>
  224. <ul class="simple">
  225. <li><a class="reference internal" href="#building" id="id1">Building</a><ul>
  226. <li><a class="reference internal" href="#required-libraries" id="id2">Required libraries</a><ul>
  227. <li><a class="reference internal" href="#bullet-physics-library" id="id3">Bullet Physics Library</a></li>
  228. <li><a class="reference internal" href="#sdl-ver-1-3" id="id4">SDL ver 1.3</a></li>
  229. <li><a class="reference internal" href="#glew" id="id5">GLEW</a></li>
  230. </ul>
  231. </li>
  232. <li><a class="reference internal" href="#generating-makefiles-and-building-anki" id="id6">Generating makefiles and building AnKi</a></li>
  233. </ul>
  234. </li>
  235. <li><a class="reference internal" href="#assets" id="id7">Assets</a></li>
  236. <li><a class="reference internal" href="#system-requirements" id="id8">System requirements</a></li>
  237. <li><a class="reference internal" href="#generating-source-documentation-doxygen" id="id9">Generating source documentation (doxygen)</a></li>
  238. <li><a class="reference internal" href="#coding-style" id="id10">Coding style</a><ul>
  239. <li><a class="reference internal" href="#classes" id="id11">Classes</a></li>
  240. <li><a class="reference internal" href="#material-shader-program-naming" id="id12">Material shader program naming</a></li>
  241. <li><a class="reference internal" href="#naming-shortcuts" id="id13">Naming shortcuts</a></li>
  242. <li><a class="reference internal" href="#controllers" id="id14">Controllers</a></li>
  243. <li><a class="reference internal" href="#submitting-patches" id="id15">Submitting patches</a></li>
  244. </ul>
  245. </li>
  246. <li><a class="reference internal" href="#todo-list" id="id16">ToDo list</a></li>
  247. </ul>
  248. </div>
  249. <div class="section" id="building">
  250. <h1><a class="toc-backref" href="#id1">Building</a></h1>
  251. <p>AnKi build system is very Linux specific (GNU make only) at the moment. It
  252. also requires a few extra development libraries. You can also find a custom
  253. build system that generates GNU makefiles.</p>
  254. <div class="section" id="required-libraries">
  255. <h2><a class="toc-backref" href="#id2">Required libraries</a></h2>
  256. <p>AnKi requires a few up to date versions of some libraries. The libraries are:</p>
  257. <ul class="simple">
  258. <li>Bullet Physics</li>
  259. <li>SDL ver 1.3</li>
  260. <li>GLEW</li>
  261. </ul>
  262. <p>So before generating makefiles or building AnKi you have to download from their
  263. repositories and build the above libraries. Instructions follow. You can
  264. alternately use the script download-and-build-externals.sh</p>
  265. <div class="section" id="bullet-physics-library">
  266. <h3><a class="toc-backref" href="#id3">Bullet Physics Library</a></h3>
  267. <p>From now on the AnKi requires the Bullet physics library. You need CMake and
  268. SVN installed.</p>
  269. <ol class="arabic simple">
  270. <li>$ Go to the root AnKi path (where src, shaders and blenderscripts are)</li>
  271. <li>$ cd ..</li>
  272. <li>$ svn checkout <a class="reference external" href="http://bullet.googlecode.com/svn/trunk/">http://bullet.googlecode.com/svn/trunk/</a> bullet_svn</li>
  273. <li>$ cd bullet_svn</li>
  274. <li>$ cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release</li>
  275. <li>$ make</li>
  276. </ol>
  277. </div>
  278. <div class="section" id="sdl-ver-1-3">
  279. <h3><a class="toc-backref" href="#id4">SDL ver 1.3</a></h3>
  280. <p>We need SDL ver 1.3 for creating OpenGL 3.x context. You need to have the
  281. Mercurial and autoconf installed.</p>
  282. <ol class="arabic simple">
  283. <li>$ Go to the root AnKi path (where src, shaders and blenderscripts are)</li>
  284. <li>$ cd ..</li>
  285. <li>$ hg clone <a class="reference external" href="http://hg.libsdl.org/SDL">http://hg.libsdl.org/SDL</a> SDL-hg</li>
  286. <li>$ cd SDL-hg</li>
  287. <li>$ ./autogen.sh</li>
  288. <li>$ ./configure</li>
  289. <li>$ make</li>
  290. </ol>
  291. </div>
  292. <div class="section" id="glew">
  293. <h3><a class="toc-backref" href="#id5">GLEW</a></h3>
  294. <p>The latest GLEW provides us with OpenGL 3 and 4 extensions. Needs SVN and a
  295. Unix environment (for step 5).</p>
  296. <ol class="arabic simple">
  297. <li>$ Go to the root AnKi path (where src, shaders and blenderscripts are)</li>
  298. <li>$ cd ..</li>
  299. <li>$ svn co <a class="reference external" href="https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew">https://glew.svn.sourceforge.net/svnroot/glew/trunk/glew</a> glew</li>
  300. <li>$ cd glew</li>
  301. <li>$ make extensions</li>
  302. <li>$ make</li>
  303. </ol>
  304. </div>
  305. </div>
  306. <div class="section" id="generating-makefiles-and-building-anki">
  307. <h2><a class="toc-backref" href="#id6">Generating makefiles and building AnKi</a></h2>
  308. <p>There are 4 build targets in this folder. There is also a build system that
  309. generates GNU makefiles (it requires Python 3 installed). If you want to
  310. generate the makefile for the debug target (for example) do the following:</p>
  311. <ol class="arabic simple">
  312. <li>$ cd &lt;path to anki&gt;/build/debug</li>
  313. <li>$ ../genmakefile.py</li>
  314. <li>$ make</li>
  315. </ol>
  316. <p>And the build process will begin.</p>
  317. <p>The gen.cfg.py files contain the build options of every target. Their format
  318. is pretty straightforward and minimal.</p>
  319. <p><strong>WARNING</strong>: Sometimes I forget to update all the targets. The debug is always
  320. updated though.</p>
  321. </div>
  322. </div>
  323. <div class="section" id="assets">
  324. <h1><a class="toc-backref" href="#id7">Assets</a></h1>
  325. <p>Currently there are no assets (models, textures, materials etc) so even if you
  326. build it, the application will fail to run.</p>
  327. </div>
  328. <div class="section" id="system-requirements">
  329. <h1><a class="toc-backref" href="#id8">System requirements</a></h1>
  330. <p>The engine requires:</p>
  331. <ul class="simple">
  332. <li>GPU with shader model 4</li>
  333. <li>Linux OS</li>
  334. <li>Proprietary GPU drivers (as far as Catalyst is concerned &gt;= 9.10)</li>
  335. </ul>
  336. <p>Development rig: Ubuntu 9.10, AMD Radeon 4870. So it should be working on
  337. similar systems.</p>
  338. </div>
  339. <div class="section" id="generating-source-documentation-doxygen">
  340. <h1><a class="toc-backref" href="#id9">Generating source documentation (doxygen)</a></h1>
  341. <p>The AnKi source code utilises doxygen style comments. For that you need doxygen
  342. (<a class="reference external" href="http://www.doxygen.org/">http://www.doxygen.org/</a>). To generate the html documentation from a terminal
  343. do:</p>
  344. <ol class="arabic simple">
  345. <li>$ cd docs</li>
  346. <li>$ doxygen doxyfile</li>
  347. </ol>
  348. <p>Then open doxygen.html to see it.</p>
  349. </div>
  350. <div class="section" id="coding-style">
  351. <h1><a class="toc-backref" href="#id10">Coding style</a></h1>
  352. <p>Some things to remember while coding AnKi.</p>
  353. <div class="section" id="classes">
  354. <h2><a class="toc-backref" href="#id11">Classes</a></h2>
  355. <p>class</p>
  356. <p>{</p>
  357. <blockquote>
  358. <p>friends</p>
  359. <p>pre-nested (if necessary)</p>
  360. <p>nested</p>
  361. <p>properties</p>
  362. <p>public</p>
  363. <p>protected</p>
  364. <p>private</p>
  365. </blockquote>
  366. <p>}</p>
  367. </div>
  368. <div class="section" id="material-shader-program-naming">
  369. <h2><a class="toc-backref" href="#id12">Material shader program naming</a></h2>
  370. <p>dnspgke:</p>
  371. <ul class="simple">
  372. <li>diffuse mapping</li>
  373. <li>normal mapping</li>
  374. <li>specular mapping</li>
  375. <li>parallax mapping</li>
  376. <li>grass like</li>
  377. <li>hardware skinning</li>
  378. <li>environment mapping</li>
  379. </ul>
  380. </div>
  381. <div class="section" id="naming-shortcuts">
  382. <h2><a class="toc-backref" href="#id13">Naming shortcuts</a></h2>
  383. <p>This list contains some of the naming shortcuts we use in AnKi:</p>
  384. <ul class="simple">
  385. <li>Array : arr</li>
  386. <li>Animation : anim</li>
  387. <li>Application : app</li>
  388. <li>Buffer : buff</li>
  389. <li>Camera : cam</li>
  390. <li>Color : col</li>
  391. <li>Controller : ctrl</li>
  392. <li>Feature : feat</li>
  393. <li>Fragment : frag</li>
  394. <li>Framebuffer Attachable Image : fai</li>
  395. <li>Geometry : geom</li>
  396. <li>Location : loc</li>
  397. <li>Material : mtl</li>
  398. <li>Matrix : mat</li>
  399. <li>Number : num</li>
  400. <li>Physics : phy</li>
  401. <li>Property : prop</li>
  402. <li>Quadrilateral : quad</li>
  403. <li>Quaternion : quat</li>
  404. <li>Resource : rsrc</li>
  405. <li>Rotation : rot</li>
  406. <li>Shader : shdr</li>
  407. <li>Shader Program : shaderProg or sProg</li>
  408. <li>Skeletal Animation : sAnim</li>
  409. <li>Skeleton : skel</li>
  410. <li>Text : txt</li>
  411. <li>Texture : tex</li>
  412. <li>Transformation : trf</li>
  413. <li>Translation : tsl</li>
  414. <li>Triangle : tri</li>
  415. <li>Utility : util</li>
  416. <li>Variable : var</li>
  417. <li>Vector : vec</li>
  418. <li>Vertex : vert</li>
  419. </ul>
  420. </div>
  421. <div class="section" id="controllers">
  422. <h2><a class="toc-backref" href="#id14">Controllers</a></h2>
  423. <p>The controllers are part of the scene node objects. They control the node's
  424. behaviour.</p>
  425. <p>They have an input (script, animation, etc) and they control a scene node. The
  426. naming convention of the controllers is:</p>
  427. <p>&lt;what the controller controls&gt;&lt;the input of the contoller&gt;Ctrl</p>
  428. <p>For Example:</p>
  429. <p>MeshSkelNodeCtrl A Mesh is controlled by a SkelNode</p>
  430. </div>
  431. <div class="section" id="submitting-patches">
  432. <h2><a class="toc-backref" href="#id15">Submitting patches</a></h2>
  433. <p>If you want to update/patch a file (for example Main.cpp) do:</p>
  434. <ul class="simple">
  435. <li>Make the changes on that file</li>
  436. <li>Save the differences in a file using &quot;svn diff Main.cpp &gt; /tmp/diff&quot;</li>
  437. <li>E-mail the &quot;diff&quot; file with subject &quot;[PATCH] Main.cpp updates&quot;</li>
  438. </ul>
  439. </div>
  440. </div>
  441. <div class="section" id="todo-list">
  442. <h1><a class="toc-backref" href="#id16">ToDo list</a></h1>
  443. <ul>
  444. <li><p class="first">Continue working on the new coding style in shaders</p>
  445. </li>
  446. <li><p class="first">Changes in the blending objects problem. The BS will become one stage and the
  447. PPS will be divided in two steps. The first will apply the SSAO and the EdgeAA
  448. in the IS_FAI and the second will do the rest</p>
  449. </li>
  450. <li><p class="first">The second Physics demo: Create a box that is geting moved by the user. It has
  451. to interact with the other boxes</p>
  452. </li>
  453. <li><p class="first">Set the gravity of a certain body to a lower value and see how it behaves</p>
  454. </li>
  455. <li><p class="first">In the Ragdoll bullet demo try to change the distances of the bodies</p>
  456. </li>
  457. <li><dl class="first docutils">
  458. <dt>Ask in the bullet forum:</dt>
  459. <dd><ul class="first last simple">
  460. <li>How to make floating particles like smoke. But first try with one body and
  461. manualy setting the gravity</li>
  462. <li>What the btCollisionObject::setActivationState takes as parameter?</li>
  463. </ul>
  464. </dd>
  465. </dl>
  466. </li>
  467. <li><p class="first">Enable depth test before skybox rendering to see what happens -&gt; Forgot to
  468. disable the test</p>
  469. </li>
  470. <li><p class="first">Re-enable the stencil tex in Ms.cpp</p>
  471. </li>
  472. </ul>
  473. </div>
  474. </div>
  475. </body>
  476. </html>