Skip to content

Commit

Permalink
Support materialLUT for livre engine
Browse files Browse the repository at this point in the history
  • Loading branch information
tribal-tec committed Mar 6, 2017
1 parent 22ed0a8 commit b9a998c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 30 deletions.
28 changes: 12 additions & 16 deletions plugins/engines/livre/LivreScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,20 @@ LivreScene::LivreScene(const Renderers& renderers,

void LivreScene::commitTransferFunctionData()
{
TransferFunction& transferFunction = getTransferFunction();
Vector4fs& diffuseColors = transferFunction.getDiffuseColors();
if (diffuseColors.size() != 256)
{
BRAYNS_ERROR << "Livre only supports color maps with 256 values"
<< std::endl;
return;
}
uint8_ts lut;
lut.reserve(1024);
for (const auto& color : diffuseColors)
auto& livreTF =
_livre.getFrameData().getRenderSettings().getTransferFunction();
const auto& diffuseColors = getTransferFunction().getDiffuseColors();

livreTF.getDiffuse().resize(diffuseColors.size());
livreTF.getAlpha().resize(diffuseColors.size());
for (size_t i = 0; i < diffuseColors.size(); ++i)
{
lut.push_back(color.x() * 255.f);
lut.push_back(color.y() * 255.f);
lut.push_back(color.z() * 255.f);
lut.push_back(color.w() * 255.f);
const auto& color = diffuseColors[i];
livreTF.getDiffuse()[i] = {color[0], color[1], color[2]};
livreTF.getAlpha()[i] = color[3];
}
_livre.getFrameData().getRenderSettings().getTransferFunction().setLut(lut);
const auto& range = getTransferFunction().getValuesRange();
livreTF.setRange({range[0], range[1]});
}

void LivreScene::commitVolumeData()
Expand Down
14 changes: 0 additions & 14 deletions plugins/extensions/plugins/ZeroEQPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <lexis/render/Histogram.h>
#include <lexis/render/frame.h>
#include <lexis/render/imageJPEG.h>
#include <lexis/render/lookupTable1D.h>
#include <lexis/render/materialLUT.h>
#include <lexis/render/viewport.h>

Expand Down Expand Up @@ -106,19 +105,6 @@ class ZeroEQPlugin : public ExtensionPlugin
*/
void _spikesUpdated();

/**
* @brief This method is called when the lookup table is updated by a ZeroEQ
* event
*/
void _LookupTable1DUpdated();

/**
* @brief This method is called when a lookup table 1D is requested by a
* ZeroEQ event
* @return True if the method was successful, false otherwise
*/
bool _requestLookupTable1D();

/**
* @brief This method is called when the material lookup table is updated by
* a ZeroEQ event
Expand Down

0 comments on commit b9a998c

Please sign in to comment.