4 <title>Sixth 3D - 3D engine</title>
5 <!-- 2017-06-13 Tue 08:56 -->
7 <meta name="viewport" content="width=device-width, initial-scale=1">
8 <meta name="generator" content="Org-mode">
9 <meta name="author" content="Svjatoslav Agejenko">
10 <link href="https://bootswatch.com/darkly/bootstrap.min.css" rel="stylesheet">
11 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
12 <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>"
13 <style type="text/css">
14 footer {background-color: #111 !important;}
15 pre {background-color: #111; color: #ccc;}
17 <style type="text/css">
18 /* org mode styles on top of twbs */
35 background-color: #f5f5f5;
62 display: inline-block;
74 .bs-docs-sidebar.affix {
77 @media (min-width: 768px) {
83 /* All levels of nav */
84 .bs-docs-sidebar .nav > li > a {
91 .bs-docs-sidebar .nav > li > a:hover,
92 .bs-docs-sidebar .nav > li > a:focus {
95 text-decoration: none;
96 background-color: transparent;
97 border-left: 1px solid #A1283B;
99 .bs-docs-sidebar .nav > .active > a,
100 .bs-docs-sidebar .nav > .active:hover > a,
101 .bs-docs-sidebar .nav > .active:focus > a {
105 background-color: transparent;
106 border-left: 2px solid #A1283B;
109 /* Nav: second level (shown on .active) */
110 .bs-docs-sidebar .nav .nav {
111 display: none; /* Hide by default, but at >768px, show it */
112 padding-bottom: 10px;
114 .bs-docs-sidebar .nav .nav > li > a {
121 .bs-docs-sidebar .nav .nav > li > a:hover,
122 .bs-docs-sidebar .nav .nav > li > a:focus {
125 .bs-docs-sidebar .nav .nav > .active > a,
126 .bs-docs-sidebar .nav .nav > .active:hover > a,
127 .bs-docs-sidebar .nav .nav > .active:focus > a {
132 /* Nav: third level (shown on .active) */
133 .bs-docs-sidebar .nav .nav .nav {
134 padding-bottom: 10px;
136 .bs-docs-sidebar .nav .nav .nav > li > a {
143 .bs-docs-sidebar .nav .nav .nav > li > a:hover,
144 .bs-docs-sidebar .nav .nav .nav > li > a:focus {
147 .bs-docs-sidebar .nav .nav .nav > .active > a,
148 .bs-docs-sidebar .nav .nav .nav > .active:hover > a,
149 .bs-docs-sidebar .nav .nav .nav > .active:focus > a {
154 /* Show and affix the side nav when space allows it */
155 @media (min-width: 992px) {
156 .bs-docs-sidebar .nav > .active > ul {
159 /* Widen the fixed sidebar */
160 .bs-docs-sidebar.affix,
161 .bs-docs-sidebar.affix-bottom {
164 .bs-docs-sidebar.affix {
165 position: fixed; /* Undo the static from mobile first approach */
168 .bs-docs-sidebar.affix-bottom {
169 position: absolute; /* Undo the static from mobile first approach */
171 .bs-docs-sidebar.affix .bs-docs-sidenav,.bs-docs-sidebar.affix-bottom .bs-docs-sidenav {
176 @media (min-width: 1200px) {
177 /* Widen the fixed sidebar again */
178 .bs-docs-sidebar.affix-bottom,
179 .bs-docs-sidebar.affix {
184 <script type="text/javascript">
188 $('.bs-docs-sidebar li').first().addClass('active');
190 $(document.body).scrollspy({target: '.bs-docs-sidebar'});
192 $('.bs-docs-sidebar').affix();
197 <div id="content" class="container">
198 <div class="row"><div class="col-md-9"><h1 class="title">Sixth 3D - 3D engine</h1>
201 <li>This is a subproject of <a href="http://www2.svjatoslav.eu/gitbrowse/sixth/doc/index.html">Sixth</a>
204 <li><a href="http://www2.svjatoslav.eu/gitweb/?p=sixth-3d.git;a=snapshot;h=HEAD;sf=tgz">download latest snapshot</a>
207 <li>This program is free software; you can redistribute it and/or modify it under
208 the terms of version 3 of the <a href="https://www.gnu.org/licenses/lgpl.html">GNU Lesser General Public License</a> or later as
209 published by the Free Software Foundation.
214 <li>Svjatoslav Agejenko
216 <li>Homepage: <a href="http://svjatoslav.eu">http://svjatoslav.eu</a>
218 <li>Email: <a href="mailto://svjatoslav@svjatoslav.eu">mailto://svjatoslav@svjatoslav.eu</a>
223 <li><a href="http://svjatoslav.eu/programs.jsp">other applications hosted at svjatoslav.eu</a>
227 <div id="outline-container-sec-1" class="outline-2">
228 <h2 id="sec-1"><span class="section-number-2">1</span> Project description</h2>
229 <div class="outline-text-2" id="text-1">
231 In-software, pure Java realtime 3D rendering engine. With the final
232 goal of becoming a platform for buildng 3D user interfaces and
233 interactive data visualization.
237 <li>See: <a href="http://www2.svjatoslav.eu/gitbrowse/sixth-3d-demos/doc/index.html">demos of current 3D engine capabilities</a>
243 System is implemented in Java because:
246 <li>It is easy to refactor and experiment with.
249 <li>It scales well to handle great complexity.
251 <li>Allows to implement clever performance optimizations (instead of
252 going for GPU offered brute-force rendering approach).
257 <li>No limitations imposed by:
259 <li>requirement for decent GPU
261 <li>GPU missing features
263 <li>GPU missing/incomplete/buggy drivers
265 <li>OpenGL specification
270 <li>It is fast enough thanks to:
272 <li>Java virtual machine just-in-time compiler.
274 <li>Growing CPU cores count.
279 <li>As a result it is easy to run on various hardware platforms and
285 3D rendering is done in software, 100% pure Java on CPU. At least for
286 now. Modern CPU cores count keeps growing and therefore rendering by
287 CPU is not as expensive as it used to be for the old single core
292 CPU rendering performance is already good enough to implement usable
293 3D UI at sufficient detail level, resolution and frame rate.
297 Pure Java also means easy portability and installation. No need to
298 deal with platform specific dependencies.
302 Also CPU rendering allows to easily test different rendering
303 algorithms and retains complete control of every rendered pixel.
309 <div id="outline-container-sec-2" class="outline-2">
310 <h2 id="sec-2"><span class="section-number-2">2</span> Instructions to embed Sixth-3D in your project</h2>
311 <div class="outline-text-2" id="text-2">
313 Maven *pom.xml* file snippet:
315 <div class="org-src-container">
317 <pre class="src src-xml"><<span style="color: #A6E22E;">dependencies</span>>
319 <<span style="color: #A6E22E;">dependency</span>>
320 <<span style="color: #A6E22E;">groupId</span>>eu.svjatoslav</<span style="color: #A6E22E;">groupId</span>>
321 <<span style="color: #A6E22E;">artifactId</span>>sixth-3d</<span style="color: #A6E22E;">artifactId</span>>
322 <<span style="color: #A6E22E;">version</span>>1.0</<span style="color: #A6E22E;">version</span>>
323 </<span style="color: #A6E22E;">dependency</span>>
325 </<span style="color: #A6E22E;">dependencies</span>>
327 <<span style="color: #A6E22E;">repositories</span>>
329 <<span style="color: #A6E22E;">repository</span>>
330 <<span style="color: #A6E22E;">id</span>>svjatoslav.eu</<span style="color: #A6E22E;">id</span>>
331 <<span style="color: #A6E22E;">name</span>>Svjatoslav repository</<span style="color: #A6E22E;">name</span>>
332 <<span style="color: #A6E22E;">url</span>>http://www2.svjatoslav.eu/maven/</<span style="color: #A6E22E;">url</span>>
333 </<span style="color: #A6E22E;">repository</span>>
335 </<span style="color: #A6E22E;">repositories</span>>
340 See <a href="codeGraph/index.html">generated code graph</a> using <a href="http://www2.svjatoslav.eu/gitbrowse/javainspect/doc/index.html">this tool</a>.
344 <div id="outline-container-sec-3" class="outline-2">
345 <h2 id="sec-3"><span class="section-number-2">3</span> <span class="label label-primary TODO">TODO</span> features to add</h2>
346 <div class="outline-text-2" id="text-3">
348 <li>Partial region/frame repaint: when only one small object changed on
349 the scene, it would be faster to re-render that specific area.
352 <li>Once partial rendering works, in would be easy to add multi-core
353 rendering support. So that each core renders it's own region of the
357 <li>Antialiazing. Would improve text readability. If antialiazing is too
358 expensive for every frame, it could be used only for last frame
359 before animations become still and waiting for user input starts.
362 <li>Render only visible polygons.
364 <li>This would significantly reduce RAM <-> CPU traffic.
367 <li>General algorithm description:
369 <li>For each horizontal scanline:
371 <li>sort polygon edges from left to right
373 <li>while iterating and drawing pixels over screen X axis (left to
374 right) track next appearing/disappearing polygons.
376 <li>For each polygon edge update Z sorted active polygons list.
378 <li>Only draw pixel from the top-most polygon.
380 <li>Only if polygon area is transparent/half-transparent add
381 colors from the polygons below.
392 <li>As a bonus, this would allow to track which polygons are really
393 visible in the final scene for each frame.
396 <li>Such information allows further optimizations:
399 <li>Dynamic geometry simplification:
401 <li>Dynamically detect and replace invisible objects from the
402 scene with simplified bounding box.
405 <li>Dynamically replace boudnig box with actual object once it
411 <li>Dynamically unload unused textures from RAM.
422 </div><div class="col-md-3"><nav id="table-of-contents">
423 <div id="text-table-of-contents" class="bs-docs-sidebar">
425 <li><a href="#sec-1">1. Project description</a></li>
426 <li><a href="#sec-2">2. Instructions to embed Sixth-3D in your project</a></li>
427 <li><a href="#sec-3">3. features to add</a></li>
432 <footer id="postamble" class="">
433 <div><p class="author">Author: Svjatoslav Agejenko</p>
434 <p class="date">Created: 2017-06-13 Tue 08:56</p>
435 <p class="creator"><a href="http://www.gnu.org/software/emacs/">Emacs</a> 25.1.1 (<a href="http://orgmode.org">Org-mode</a> 8.2.10)</p>