Skip to content

Commit

Permalink
Exposed volume alpha correction parameters to WS API (#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
favreau committed Aug 6, 2018
1 parent 3e1d261 commit 5bf6028
Show file tree
Hide file tree
Showing 6 changed files with 190 additions and 159 deletions.
10 changes: 7 additions & 3 deletions plugins/engines/ospray/OSPRayEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ void OSPRayEngine::_createRenderers()
properties.setProperty(
{"shadows", "Shadow intensity", 0.f, {0.f, 1.f}});
properties.setProperty(
{"softShadows", "Shadow softness", 0.f, {0.f, 0.1f}});
{"softShadows", "Shadow softness", 0.f, {0.f, 1.f}});
properties.setProperty({"samplingThreshold",
"Threshold under which sampling is ignored",
0.01f,
Expand All @@ -298,6 +298,10 @@ void OSPRayEngine::_createRenderers()
"Volume specular exponent",
20.f,
{1.f, 100.f}});
properties.setProperty({"volumeAlphaCorrection",
"Volume alpha correction",
1.f,
{0.01f, 1.f}});
}
if (renderer == "scivis")
{
Expand Down Expand Up @@ -386,9 +390,9 @@ void OSPRayEngine::_createCameras()
properties.setProperty(fovy);
properties.setProperty(aspect);
properties.setProperty(
{"apertureRadius", "Aperture radius", 0.f, {0.f, 1.0f}});
{"apertureRadius", "Aperture radius", 0.f, {0.f, 18.0f}});
properties.setProperty(
{"focusDistance", "Focus Distance", 1.f, {0.f, 10.f}});
{"focusDistance", "Focus Distance", 1.f, {0.f, 1e31f}});
properties.setProperty(stereoProperty);
properties.setProperty(eyeSeparation);
}
Expand Down
3 changes: 2 additions & 1 deletion plugins/engines/ospray/ispc/render/SimulationRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ void SimulationRenderer::commit()

_samplingThreshold = getParam1f("samplingThreshold", 0.01f);
_volumeSpecularExponent = getParam1f("volumeSpecularExponent", 20.f);
_volumeAlphaCorrection = getParam1f("volumeAlphaCorrection", 4.f);

ispc::SimulationRenderer_set(
getIE(), (_simulationModel ? _simulationModel->getIE() : nullptr),
Expand All @@ -78,7 +79,7 @@ void SimulationRenderer::commit()
: NULL,
_transferFunctionSize, _transferFunctionMinValue,
_transferFunctionRange, _samplingThreshold, _detectionDistance,
_volumeSpecularExponent);
_volumeSpecularExponent, _volumeAlphaCorrection);
}

SimulationRenderer::SimulationRenderer()
Expand Down
1 change: 1 addition & 0 deletions plugins/engines/ospray/ispc/render/SimulationRenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class SimulationRenderer : public AbstractRenderer
float _detectionDistance;
float _samplingThreshold;
float _volumeSpecularExponent;
float _volumeAlphaCorrection;
};

} // ::brayns

0 comments on commit 5bf6028

Please sign in to comment.