Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support materialLUT for livre engine #128

Merged
merged 1 commit into from
Mar 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitsubprojects
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ common_find_package(Servus REQUIRED)
if(BRAYNS_NETWORKING_ENABLED OR BRAYNS_DEFLECT_ENABLED)
git_subproject(ZeroBuf https://github.com/HBPVIS/ZeroBuf.git cea0338)
git_subproject(ZeroEQ https://github.com/HBPVis/ZeroEQ.git 847025a)
git_subproject(Lexis https://github.com/HBPVis/Lexis.git 2678219)
git_subproject(Lexis https://github.com/HBPVis/Lexis.git 2f50220)
common_find_package(ZeroEQ REQUIRED)
common_find_package(ZeroBuf REQUIRED)
common_find_package(Lexis REQUIRED)
Expand Down Expand Up @@ -46,7 +46,7 @@ endif()

# Livre rendering engine
if(BRAYNS_LIVRE_ENABLED)
git_subproject(Livre https://github.com/BlueBrain/Livre.git c8bbc0d)
git_subproject(Livre https://github.com/BlueBrain/Livre.git b706e65)
common_find_package(Livre)
endif()

Expand Down
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