REARVIEW 0.3.1, show-off release
Project description
0. Vision1. What is Rearview ?
2. Installation
3. Troubleshooting
4. License
0. Vision
Rearview aims towards a three dimensional computer graphcis engine which fits both human perception and the shape of the real world better than common polygon renderers do. To achieve this, Rearview occasionally displays very rough shapes (to gain speed) which, on the other hand, were defined infinitely exact with a math function.
It is not meant to be a very sharp-shaped, high-contrast engine. Rearview's strength are grown things, dirty things, bumpy things. Natural stuff like smooth hills, old walls. Everything you wouldn't want to turn into a polygon mesh, because there are things like bumps to it which you dont want to describe exactly. You only want it to look non-planar. So you would just add some noise function to your shape.
1. What is Rearview ?
1.1. in short,
REARViEw stands for REAl-time Raytracing Voxel Engine. So what it does is rendering 3d space with a raytracing algorithm. To make that efficient, and to be able to render every mathematically described object (isosurfaces as well as triangle meshes), the system uses voxels to approximate the geometry. It is intended to run fast enough to act as a game engine.
1.2. so why do we need that?
Unlike traditional game engines (apart from Novalogic's Voxelspace for Comanche), Rearview does not depend on polygons. This way, all displayed objects are not restricted to planar shape. Every object is described mathematically, thus very exactly. Depending on the amount of memory you want to use and the time you want to wait, this is turned into a voxel tree.
The benefits of the raytracing method are clear. There is no point in repeating all the raytracing vs rasterization stuff here, so in short, it is possible to realise: real indirect light, real reflectance, everything real you want to imagine since light is modelled on a very low level compared to rasterization techniques. In the current release (0.3.0) rearview supports only a few basic shaders like some textures to be combined with a headlight or lighting via HDRI. This will be extended to a modular shader system which will allow custom shaders written in C++.
1.3. what is implemented by now?
Rearview is still in development so there is nothing really advanced here, you can also have a look at http://rearview.sourceforge.net/features.shtml, for a list which is hopefully up to date.
- Geometry input:
There are ellipsoids, planes and cubes, nesting maps for rotation, bumps, perlin noise and shaders. Apart from those isosurface objects, there is the possibility to read triangle meshes in the .3ds and the .ply format. It's possible to add to, subtract from and inverse a map's shape. The map file syntax is in XML, the DTD can be found in maps/rearview_map.dtd.- Generating the tree:
rearview-treegen
reads the .xml map file and turns it into an octree of voxels with an iterative scanconversion algorithm which finds the minimal voxel hull for the described objects. You may specify the number of threads to use for that, if rearview has been compiled with threading. The number of Threads is currently limited to 8, since the job is split into the eight octants of the root node. This could be extended by using the bounding boxes of the objects, but the threaded version uses much more memory and is therefore disabled by default.- Lighting:
All lighting is performed in real time as you walk through the scene. This currently only involves direct lighting via a HDRI, ambient occlusion or a headlight. Global illumination to come :)- Rendering:
- Render Modes:
There are currently 3 types of rendering supported, which can be controlled by the--with-render-method=x
switch ofconfigure
:
(0) Sampling the image plane with blue noise, get motion blur
(1) Sampling the image plane with the same points but use last frame differently to get a nice, nightvision-like camera effect
(2) `photo-realistic' samples every pixel, is slow, looks boring, just for debugging
These settings can be fine tuned to look like a painting using thenpr.conf
file.- Depth Of Field
- Animated Objects
- Interaction:
Version 0.3.0 allows you to move around with the std Quake keys (use the--enable-dvorak
switch if you are using the dvorak layout). The left mouse button destroys a sphere of voxels in the viewing direction, the right mouse button adds a sphere, the mousewheel controls the focus (if you compiled with--enable-dof
for depth-of-field), the middle mouse button does an auto-focus on the next object in the viewing direction.
2. installation
2.1. getting the sources
Grab a release from rearview.sourceforge.net or via CVS:
from a directory of your choice, type:
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/rearview co rearview
and just press enter when prompted for a password
2.2. compiling
What you'll need: By now, Rearview is compiled against: SDL, GL, GLU, libxml2, zlib, libpng and lib3ds. So you will need some OpenGL implementation, the Simple Direct Media Layer SDL, GNOME's xml library and lib3ds. Please note that a recent version of libxml2 is required (about 2.6.3).
Fast install: Extract the sources. From the source directory, type
./reconf
./configure --prefix=$(pwd)
make install
The binaries can then be found in the bin/ directory, the library is in lib/ (as you may have expected ;) .
2.3. generating and viewing a .tree file
You may generate a tree with the
rearview-treegen
program.
bin/rearview-treegen [--detail={d}] maps/<whatever>.xml
The detail parameter specifies the size of the voxels. Clearly, smaller voxels lead to more memory consumption and a nicer tree file. Since voxel sizes can only be powers of two, the parameter affects the size as follows: size = pow(2, {d}). As a rule of thumb, trees will use up four times the amount of memory they would have used with the detail parameter increased by one.
If you don't change it explicitly, the output will be named trees/<whatever>-{d}.tree. You can view this tree with
bin/rearview trees/<whatever>-{d}.tree
.
2.4. getting the painting look
To change the render modes, you can adjust
npr.conf
. Only the first line of the file is parsed, it has to have this format:
brushes/brushname.ppm sizex sizey
where
brushname
is the name of the brush texture you want to use andsizex
andsizey
can be used to stretch the brush. for a long stroke use one large (e.g. 13) and one small (e.g. 4) value. The texture reading is quite stupid as well, so you will have to remove all comments of the .ppm header when using custom brushes, sorry.Note that if you are using the sources the non-photo-realistic looks best (imho) when compiling with
./configure --disable-dof --disable-hires --with-render-method=0
Whereas the more realistic looking version with round splats (
sizex
=sizey
= 4.5) looks better with
./configure --enable-dof --enable-hires --with-render-method=11
which is why the binaries come in two versions.
3. Troubleshooting
3.1. improving speed
If your machine has a small cache, generate the tree with less detail (-d1 or -d2).
If your graphics card is slow, turn off depth of field (configure --disable-dof).
Always helpful: disable secondary rays by replacinghdrilightshader
in the .xml file withheadlightshader
. You may also try to first decrease the number of rays in the options parameter.
3.2. contacting the authors
If you found a bug, have questions or think something cool is missing.. you can write to the mailinglist (rearview-devel (at) lists.sourceforge.net) or the project initiator (jhanika (at) informatik.uni-ulm.de).
4. License
Rearview is released under the terms of the GNU General Public License. You should have received a copy with the sources. There are parts of the source (in specially named directories
foreign/
which may have a different license. See those files for details.The 3ds files venus.3ds, horse.3ds and dragon.3ds are taken from the internet as well, the .ply scans are the famous Stanford models. All these are obviously not made by the Rearview team and may have a different license.