Commit 0d69e366 authored by Dave DeMarle's avatar Dave DeMarle Committed by David DeMarle
Browse files

Fix bug exposed by update test.

gradient shadding didn't appear to be working, but only because
the new volume never had a chance to set up its own properties.
parent 1468fc37
......@@ -180,10 +180,16 @@ void vtkOSPRayVolumeMapperNode::Render(bool prepass)
}
this->RenderTime = volNode->GetMTime();
//
// test for modifications to input
if (mapper->GetDataSetInput()->GetMTime() > this->BuildTime)
{
ospSet2f(this->TransferFunction, "valueRange",
data->GetScalarRange()[0], data->GetScalarRange()[1]);
}
// test for modifications to volume properties
//
if (vol->GetProperty()->GetMTime() > this->PropertyTime)
if (vol->GetProperty()->GetMTime() > this->PropertyTime
|| mapper->GetDataSetInput()->GetMTime() > this->BuildTime)
{
vtkVolumeProperty* volProperty = vol->GetProperty();
vtkColorTransferFunction* colorTF = volProperty->GetRGBTransferFunction(0);
......@@ -217,15 +223,6 @@ void vtkOSPRayVolumeMapperNode::Render(bool prepass)
ospRelease(tfAlphaData);
}
// test for modifications to input
if (mapper->GetDataSetInput()->GetMTime() > this->BuildTime)
{
ospSet2f(this->TransferFunction, "valueRange",
data->GetScalarRange()[0], data->GetScalarRange()[1]);
//! Commit the transfer function only after the initial colors and alphas have been set (workaround for Qt signalling issue).
ospCommit(this->TransferFunction);
}
ospSetObject((OSPObject)this->OSPRayVolume, "transferFunction", this->TransferFunction);
this->BuildTime.Modified();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment