I had previously been using QVTKWidget in VTK 7.1.0 with no issues. I decided to upgrade to VTK 8.2.0 and try out QVTKOpenGLNativeWidget. However I am noticing that with the new widget when I overlay two vtkImageActors, the opacity on the top one is reduced for some reason. You can see the attached example. The blue was full opacity before (as it was meant to be), but now is reduced. I’ve put some code below. Any help would be much appreciated! Thanks.
And here is a snippet of code that should give an idea of my pipeline:
QVTKOpenGLNativeWidget *window = new QVTKOpenGLNativeWidget();
window->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
window->setMinimumSize(QSize(580, 330));
window->enableHiDPI();
vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
for (int i = 0; i < 2; ++i)
{
// map
vtkSmartPointer<vtkImageMapToColors> imapper = vtkSmartPointer<vtkImageMapToColors>::New();
imapper->SetLookupTable(lut[i]); // custom lookup tables (one is just normal grayscale, the other is blue with full transparency on the low end and no transparency on the high end
imapper->PassAlphaToOutputOn();
// im[0] and im[1] are my vtkImageData that I load up from saved images
imapper->SetInputData(im[i]);
imapper->Update();
// actor
vtkSmartPointer<vtkImageActor> iactor = vtkSmartPointer<vtkImageActor>::New();
iactor->GetMapper()->SetInputConnection(imapper->GetOutputPort());
renderer->AddActor(iactor);
}
renderer->ResetCameraClippingRange();
window->GetRenderWindow()->AddRenderer(renderer);
window->GetRenderWindow()->Render();
This is on Windows 10, 64-bit. Using Visual Studio 2017.