Skip to content
This repository has been archived by the owner on Jul 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #84 from tribal-tec/master
Browse files Browse the repository at this point in the history
Fix #73: Merge data- and textureDataCache, rename commandline options
  • Loading branch information
Ahmet Bilgili committed Jul 22, 2015
2 parents fb812e7 + c4a94d6 commit 4f62f01
Show file tree
Hide file tree
Showing 33 changed files with 464 additions and 833 deletions.
37 changes: 25 additions & 12 deletions doc/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,40 @@
Changelog {#Changelog}
=========

## Release 0.4 (git master) {Release040}
# Release 0.4 (git master) {#Release040}

* [#84](https://github.com/BlueBrain/Livre/pull/84):
Cache statistics are printed when showing statistics (press 's' key)
* [#84](https://github.com/BlueBrain/Livre/pull/84):
Fix [#73](https://github.com/BlueBrain/Livre/issues/73): Merge data- and
textureDataCache, commandline options for changing the cache sizes are now
--gpu-cache-mem (instead of --texture-cache-mem) and --cpu-cache-mem (instead
of --data-cache-mem and --texturedata-cache-mem)
* [#78](https://github.com/BlueBrain/Livre/pull/78):
New command line parameter to load a transfer function from file (".1dt" file
extension, based on the format used by ImageVis3D)
* [#75](https://github.com/BlueBrain/Livre/pull/75):
Separate ZeroEQ communication to class zeq::Communicator

## Release 0.3 (2015-07-07) {Release030}
# Release 0.3 (2015-07-07) {#Release030}

* [#37](https://github.com/BlueBrain/Livre/pull/37):
New command line option to enable synchronous mode (wait until every block has
been processed before rendering them)
* [#33](https://github.com/BlueBrain/Livre/pull/33):
New command line option to enable ZeroEQ camera synchronization
* [#44](https://github.com/BlueBrain/Livre/pull/44):
New command line option to specify a range of frames to render from the command line
New command line option to specify a range of frames to render from the
command line
* [#57](https://github.com/BlueBrain/Livre/pull/57):
New command line parameter to set the camera lookAt vector to define its orientation
New command line parameter to set the camera lookAt vector to define its
orientation
* New command line parameter to set camera position
* [#17](https://github.com/BlueBrain/Livre/pull/17):
New command line parameters for RESTBridge (hostname, port, ZeroEQ schema)
* [#53](https://github.com/BlueBrain/Livre/pull/53):
New command line parameters to specify the minimum and maximum levels of detail to render
New command line parameters to specify the minimum and maximum levels of
detail to render
* New heartbeat messaging mechanism
* [#43](https://github.com/BlueBrain/Livre/pull/43):
New livre_batch.py script for offline image series rendering
Expand All @@ -44,7 +54,8 @@ Changelog {#Changelog}
* Fix broken memory mapped reading in UVF
* Fix GLEW_MX linking
* [#45](https://github.com/BlueBrain/Livre/pull/45):
Fix the "Empty servus implementation" exception that was raised when zeroconf wasn not available
Fix the "Empty servus implementation" exception that was raised when zeroconf
was not available
* [#58](https://github.com/BlueBrain/Livre/pull/58):
Fix the LOD computation based on the screen height
* [#33](https://github.com/BlueBrain/Livre/pull/33):
Expand All @@ -53,14 +64,16 @@ Changelog {#Changelog}
Graceful exit when ZeroEQ EXIT event is received
* Improve glslshader/raycastrenderer error handling and API
* [#28](https://github.com/BlueBrain/Livre/pull/28):
Improve performance and memory usage through a new implicit, flat octree implementation
Improve performance and memory usage through a new implicit, flat octree
implementation
* [#48](https://github.com/BlueBrain/Livre/pull/48):
Improve rendering performance through frustum culling
* Optimization: use lunchbox::Buffer instead of std::vector in MemoryUnit and
MemoryDataSource (+35% speed in remote datasource test)
* [#34](https://github.com/BlueBrain/Livre/pull/34):
Refactor the code to setup the data and texture UploadProcessors, removing race
conditions and fixing crashes (at exit and with multiple local GPUs) in the process
Refactor the code to setup the data and texture UploadProcessors, removing
race conditions and fixing crashes (at exit and with multiple local GPUs) in
the process
* [#35](https://github.com/BlueBrain/Livre/pull/35)
[#36](https://github.com/BlueBrain/Livre/pull/36):
Several fixes in the tree creation and the LOD-selection algorithm
Expand All @@ -70,9 +83,9 @@ Changelog {#Changelog}
Use one GPU by default
* Use ZeroEQ for the transfer function editor GUI
* [#70](https://github.com/BlueBrain/Livre/pull/70):
Window title has been improved to show the application name and its version number
Window title has been improved to show the application name and its version
number


## Release 0.2 (2014-10-15) {Release020}
# Release 0.2 (2014-10-15) {#Release020}

* BBP internal release
97 changes: 51 additions & 46 deletions doc/user-guide.dox
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@

@subsection Overview Overview

Livre is a out-of-core volume rendering engine depending Equalizer and OpenGL for rendering, and
Tuvok library for data management.
Livre is a out-of-core volume rendering engine depending Equalizer and OpenGL
for rendering, and Tuvok library for data management.

@section INSTALLATION Installation

@subsection Setup Setup

Livre, currently doesn't have Ubuntu or Redhat packages. It should be build from the source code at
github.(The compiler should support the C++11 - minimum g++ 4.6 - to compile the project because of
the Tuvok library dependency). The basic building procedure is as below:
Livre, currently doesn't have Ubuntu or Redhat packages. It should be build from
the source code at github.(The compiler should support the C++11 - minimum g++
4.6 - to compile the project because of the Tuvok library dependency). The basic
building procedure is as below:

\code
$ git clone https://github.com/BlueBrain/Livre.git
Expand All @@ -39,10 +40,11 @@ $ make
$ make install
\endcode

The above commands will fetch the necessary packages and build the dependencies, and install the
executables and libraries.
The above commands will fetch the necessary packages and build the dependencies,
and install the executables and libraries.

After a successful build and installation, the following executables will be available:
After a successful build and installation, the following executables will be
available:

- livre (The command line render application)
- livre_batch.py (Python script to launch livre in batch mode using sbatch to
Expand All @@ -55,21 +57,23 @@ After a successful build and installation, the following executables will be ava

@subsection Pre-processing_Tools Volume pre-processing tools

The volumetric data should be pre-processed in order to visualize in Livre. More information about
the pipeline of preprocessing can be found at @ref Tuvok_Tool tools page.
The volumetric data should be pre-processed in order to visualize in Livre. More
information about the pipeline of preprocessing can be found at
@ref Tuvok_Tool tools page.

@subsection Livre Livre

The volume renderer is executed through the command line. To test if the volume renderer is working
or not, you can simply execute :
The volume renderer is executed through the command line. To test if the volume
renderer is working, you can simply execute :

\code
livre [--volume mem://1024,1024,512,32]
livre --volume mem://1024,1024,512,32
\endcode

which will render an in memory test volume data structure. Here 1024, 1024 and 512 are the width,
height and length of the volume in voxels, respectively. 32 is the block size and "mem://" is the
scheme to generate in memory volume. You should be getting an image like below:
which will render an in memory test volume data structure. Here 1024, 1024 and
512 are the width, height and length of the volume in voxels, respectively. 32
is the block size and "mem://" is the scheme to generate in memory volume. You
should be getting an image like below:

@image html livre.png "Livre"

Expand All @@ -82,60 +86,61 @@ Application Parameters
delta for animation speed, use
--animation=-<int> for reverse
animation)
--frames arg (=[0 4294967295])
--frames arg (=[ 0 4294967295 ])
Frames to render 'start end'
--num-frames arg (=4294967295) Maximum nuber of frames to render
--camera-position arg (=[0 0 2])
--camera-position arg (=[ 0 0 2 ])
Camera position
--camera-lookat arg (=[0 0 0])
--camera-lookat arg (=[ 0 0 0 ])
Camera orientation
--sync-camera Synchronize camera with other
applications

REST Parameters
--rest-host arg (=localhost) RESTBridge's http hostname
--rest-port arg (=4020) RESTBridge's http port
--zeq-schema arg (=rest) RESTBridge's internal zeq schema
--use-rest Use RESTBridge
--rest-host arg (=localhost) RESTBridge's http hostname
--rest-port arg (=4020) RESTBridge's http port
--zeq-schema arg (=rest) RESTBridge's internal zeq schema
--use-rest Use RESTBridge

Volume Renderer Parameters
--data-cache-mem arg (=1024) Maximum data cache memory (MB) - caches
the raw data read from I/O in system
memory
--texture-cache-mem arg (=3072) Maximum texture cache memory (MB) -
caches the texture data on GPU memory
--texturedata-cache-mem arg (=8192) Maximum texture data cache memory (MB) -
caches the data that has been converted
into internal texture format in system
memory
--sse arg (=4) Screen space error
--synchronous Enable synchronous mode
--min-lod arg (=0) Minimum level of detail
--max-lod arg (=9) Maximum level of detail
--gpu-cache-mem arg (=3072) Maximum GPU cache memory (MB) - caches the
texture data in GPU memory
--cpu-cache-mem arg (=8192) Maximum CPU cache memory (MB) - caches the
volume data in CPU memory
--sse arg (=4) Screen space error
--synchronous Enable synchronous mode
--min-lod arg (=0) Minimum level of detail
--max-lod arg (=9) Maximum level of detail
--samples-per-ray arg (=512) Number of samples per ray
--transfer-function arg Path to transfer function file
\endcode

The important parameters are :

- "--volume" URL of the volume
- "--sse" Quality of the rendering, the lower the value, the higher the quality. If value is 1,
1 pixel is 1 voxel, for lower quality values should be larger than 1 (4 by default)
- "--sse" Quality of the rendering, the lower the value, the higher the quality.
If value is 1, 1 pixel is 1 voxel, for lower quality values should be bigger
than 1 (4 by default).

@subsection LivreGUI Transfer function editor

Transfer function editor helps the users to attach different colors and opacities to voxel values.
The "livreGUI" is the main application for editing the transfer function. It can connect the "livre
"application remotely and can modify the colors. Each color channel can be modified separately.
The starting dialog is as below:
Transfer function editor helps the users to attach different colors and
opacities to voxel values. The "livreGUI" is the main application for editing
the transfer function. It can connect the "livre "application remotely and can
modify the colors. Each color channel can be modified separately. The starting
dialog is as below:

@image html MainWindow.png "Main Window"

For connection, hit the connect button and enter the hostname where "livre" application is running.
For connection, hit the connect button and enter the hostname where "livre"
application is running.

@image html Connection.png "Connection Dialog"

After successfull connection, you can open the transfer function editor. In the plot area x axis
represents the values of voxel and the y axis represents the opacity values. Each color channel can
be modified seperately by selecting the channel from the color channels.
After successfull connection, you can open the transfer function editor. In the
plot area x axis represents the values of voxel and the y axis represents the
opacity values. Each color channel can be modified seperately by selecting the
channel from the color channels.

@image html TransferFunctionEditor.png "Transfer Function Editor"

Expand Down
91 changes: 73 additions & 18 deletions livre/Eq/Channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* Copyright (c) 2006-2015, Stefan Eilemann <eile@equalizergraphics.com>
* Maxim Makhinya <maxmah@gmail.com>
* Ahmet Bilgili <ahmet.bilgili@epfl.ch>
* Daniel Nachbaur <daniel.nachbaur@epfl.ch>
*
* This file is part of Livre <https://github.com/BlueBrain/Livre>
*
Expand All @@ -19,36 +20,37 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include <livre/Eq/FrameData.h>
#include <livre/Eq/Settings/FrameSettings.h>
#include <livre/Eq/Channel.h>
#include <livre/Eq/Pipe.h>
#include <livre/Eq/Node.h>
#include <livre/Eq/Window.h>
#include <livre/Eq/Error.h>
#include <livre/Eq/Config.h>
#include <livre/Eq/Settings/CameraSettings.h>
#include <livre/Eq/Settings/RenderSettings.h>
#include <livre/Eq/Error.h>
#include <livre/Eq/FrameData.h>
#include <livre/Eq/FrameGrabber.h>
#include <livre/Eq/Node.h>
#include <livre/Eq/Pipe.h>
#include <livre/Eq/Render/EqContext.h>
#include <livre/Eq/Render/RayCastRenderer.h>
#include <livre/Eq/FrameGrabber.h>
#include <livre/Eq/Settings/CameraSettings.h>
#include <livre/Eq/Settings/FrameSettings.h>
#include <livre/Eq/Settings/RenderSettings.h>
#include <livre/Eq/Window.h>

#include <livre/core/DashPipeline/DashProcessorOutput.h>
#include <livre/core/Dash/DashRenderStatus.h>
#include <livre/core/Dash/DashTree.h>
#include <livre/core/DashPipeline/DashProcessorInput.h>
#include <livre/core/DashPipeline/DashProcessorOutput.h>
#include <livre/core/Data/VolumeDataSource.h>
#include <livre/core/Render/Frustum.h>
#include <livre/core/Render/GLWidget.h>
#include <livre/core/Render/RenderBrick.h>
#include <livre/core/Visitor/RenderNodeVisitor.h>

#include <livre/Lib/Cache/TextureCache.h>
#include <livre/Lib/Cache/TextureDataCache.h>
#include <livre/Lib/Cache/TextureObject.h>
#include <livre/Lib/Render/AvailableSetGenerator.h>
#include <livre/Lib/Render/RenderView.h>
#include <livre/Lib/Render/ScreenSpaceLODEvaluator.h>


#include <livre/core/Render/Frustum.h>
#include <livre/core/Render/GLWidget.h>
#include <livre/core/Render/RenderBrick.h>
#include <livre/core/Dash/DashRenderStatus.h>
#include <livre/core/Dash/DashTree.h>
#include <livre/core/Data/VolumeDataSource.h>

#include <eq/eq.h>
#include <eq/gl.h>

Expand Down Expand Up @@ -449,7 +451,58 @@ class Channel

FrameSettingsPtr frameSettingsPtr = getFrameData()->getFrameSettings();
if( frameSettingsPtr->getStatistics( ))
{
_channel->drawStatistics();
drawCacheStatistics();
}
}

void drawCacheStatistics()
{
glLogicOp( GL_XOR );
glEnable( GL_COLOR_LOGIC_OP );
glDisable( GL_LIGHTING );
glDisable( GL_DEPTH_TEST );

glColor3f( 1.f, 1.f, 1.f );

const eq::PixelViewport& pvp = _channel->getPixelViewport();
const eq::Viewport& vp = _channel->getViewport();
const float height = pvp.h / vp.h;

glMatrixMode( GL_PROJECTION );
glLoadIdentity();
_channel->applyScreenFrustum();
glMatrixMode( GL_MODELVIEW );

livre::Node* node = static_cast< livre::Node* >( _channel->getNode( ));
std::ostringstream dataStr;
dataStr << node->getTextureDataCache().getStatistics();
float y = height/2;
_drawText( dataStr.str(), y );

Window* window = static_cast< Window* >( _channel->getWindow( ));
std::ostringstream textureStr;
textureStr << window->getTextureCache().getStatistics();
y = height/4;
_drawText( textureStr.str(), y );
}

void _drawText( std::string text, float y )
{
const eq::util::BitmapFont* font = _channel->getWindow()->getSmallFont();
for( size_t pos = text.find( '\n' ); pos != std::string::npos;
pos = text.find( '\n' ))
{
glRasterPos3f( 10.f, y, 0.99f );

font->draw( text.substr( 0, pos ));
text = text.substr( pos + 1 );
y -= 16.f;
}
// last line
glRasterPos3f( 10.f, y, 0.99f );
font->draw( text );
}

void frameFinish()
Expand Down Expand Up @@ -582,7 +635,9 @@ void Channel::frameViewStart( const uint128_t& frameId )

void Channel::frameViewFinish( const eq::uint128_t &frameID )
{
setupAssemblyState();
_impl->frameViewFinish();
resetAssemblyState();
eq::Channel::frameViewFinish( frameID );
_impl->removeImageListener();
}
Expand Down
Loading

0 comments on commit 4f62f01

Please sign in to comment.