View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0011911 | VTK | (No Category) | public | 2011-03-01 08:08 | 2016-08-12 09:55 | ||||
Reporter | Sergey Slyadnev | ||||||||
Assigned To | Jean-Christophe Fillion-Robin | ||||||||
Priority | normal | Severity | minor | Reproducibility | have not tried | ||||
Status | closed | Resolution | moved | ||||||
Platform | OS | OS Version | |||||||
Product Version | |||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0011911: vtkXOpenGLRenderWindow: window appears in off-screen rendering mode | ||||||||
Description | Tests were performed on Red Hat 5.5 (64bit) with VTK 5.6.1. I've tried to enable the off-screen rendering mode on both Windows & Linux platforms with vtkRenderWindow::SetOffScreenRendering() method. While it works properly on Windows, the blank rendering window is surprisingly displayed on Linux. Here is my sample code: ========================================================================== vtkSmartPointer<vtkRenderWindow> aRenderWindow = vtkSmartPointer<vtkRenderWindow>::New(); vtkSmartPointer<vtkRenderer> aRenderer = vtkSmartPointer<vtkRenderer>::New(); aRenderWindow->AddRenderer(aRenderer); aRenderWindow->SetOffScreenRendering(1); aRenderWindow->SetSize(600, 600); vtkSmartPointer<vtkCamera> aCamera = aRenderer->GetActiveCamera(); aCamera->ParallelProjectionOn(); aCamera->SetPosition(1.0, 1.0, 1.0); aRenderer->ResetCamera(); vtkSmartPointer<vtkActor> anActor = vtkSmartPointer<vtkActor>::New(); vtkSmartPointer<vtkPolyDataMapper> aMapper = vtkSmartPointer<vtkPolyDataMapper>::New(); vtkSmartPointer<vtkSphereSource> aSphereSource = vtkSmartPointer<vtkSphereSource>::New(); aMapper->SetInput( aSphereSource->GetOutput() ); anActor->SetMapper(aMapper); aRenderer->AddActor(anActor); vtkSmartPointer<vtkPNGWriter> aPNGWriter = vtkSmartPointer<vtkPNGWriter>::New(); vtkSmartPointer<vtkWindowToImageFilter> aWinToImageFilter = vtkSmartPointer<vtkWindowToImageFilter>::New(); aWinToImageFilter->SetInput(aRenderWindow); aWinToImageFilter->SetInputBufferTypeToRGB(); aWinToImageFilter->SetMagnification(1); aWinToImageFilter->ShouldRerenderOn(); aWinToImageFilter->Update(); aPNGWriter->SetInput( aWinToImageFilter->GetOutput() ); aPNGWriter->SetFileName("sphere_output.png"); aPNGWriter->Write(); ========================================================================== It seems like there is a problem in vtkXOpenGLRenderWindow, line 0000643: ================================================= if(this->OwnWindow) { ... XMapWindow(this->DisplayId, this->WindowId); ... ================================================= This code is executed even in the off-screen rendering mode. I've used the following patch to prevent the window from mapping: ================================================= if(this->OwnWindow !this->OffScreenRendering) { ... XMapWindow(this->DisplayId, this->WindowId); ... ================================================= I resolves the problem with the blank window. Do you think it is possible to apply that patch on future versions of VTK? | ||||||||
Tags | No tags attached. | ||||||||
Project | |||||||||
Type | |||||||||
Attached Files | |||||||||
Relationships | ||||||
|
Relationships |
Notes | |
(0030917) Jean-Christophe Fillion-Robin (manager) 2013-06-05 15:56 |
Updated testcase: #include <vtkActor2D.h> #include <vtkCamera.h> #include <vtkNew.h> #include <vtkPNGWriter.h> #include <vtkPolyDataMapper.h> #include <vtkRenderer.h> #include <vtkRenderWindow.h> #include <vtkSmartPointer.h> #include <vtkSphereSource.h> #include <vtkWindowToImageFilter.h> int main(int, char* []) { vtkNew<vtkRenderWindow> aRenderWindow; vtkNew<vtkRenderer> aRenderer; aRenderWindow->AddRenderer(aRenderer.GetPointer()); aRenderWindow->SetOffScreenRendering(1); aRenderWindow->SetSize(600, 600); vtkSmartPointer<vtkCamera> aCamera = aRenderer->GetActiveCamera(); aCamera->ParallelProjectionOn(); aCamera->SetPosition(1.0, 1.0, 1.0); aRenderer->ResetCamera(); vtkNew<vtkActor> anActor; vtkNew<vtkPolyDataMapper> aMapper; vtkNew<vtkSphereSource> aSphereSource; aMapper->SetInputConnection( aSphereSource->GetOutputPort() ); anActor->SetMapper(aMapper.GetPointer()); aRenderer->AddActor(anActor.GetPointer()); vtkNew<vtkPNGWriter> aPNGWriter; vtkNew<vtkWindowToImageFilter> aWinToImageFilter; aWinToImageFilter->SetInput(aRenderWindow.GetPointer()); aWinToImageFilter->SetInputBufferTypeToRGB(); aWinToImageFilter->SetMagnification(1); aWinToImageFilter->ShouldRerenderOn(); aWinToImageFilter->Update(); aPNGWriter->SetInputConnection( aWinToImageFilter->GetOutputPort() ); aPNGWriter->SetFileName("sphere_output.png"); aPNGWriter->Write(); return 0; } |
(0030918) Jean-Christophe Fillion-Robin (manager) 2013-06-05 15:59 edited on: 2013-06-05 16:00 |
Off screen rendering has been tested using VTK 6 (384636ec) and VTK 5.10.1 on Ubuntu 10.04 using the provided testcase and it works as expected. |
(0034309) Clinton Stimpson (developer) 2015-03-16 11:50 |
This is not resolved for me. The provided test case using VTK 5.10.1 still pops up a window. Also, vtkOpenGLExtensionManager directly calls vtkXOpenGLRenderWindow::CreateAWindow(). I do not see a the check for this->OffScreenRendering, before XMapWindow() is called in either 5.10.1 or the master branch. |
(0034310) Clinton Stimpson (developer) 2015-03-16 11:51 |
Also, there is a popup window on Mac/Cocoa. |
(0037222) Kitware Robot (administrator) 2016-08-12 09:55 |
Resolving issue as `moved`. This issue tracker is no longer used. Further discussion of this issue may take place in the current VTK Issues page linked in the banner at the top of this page. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2011-03-01 08:08 | Sergey Slyadnev | New Issue | |
2013-06-05 15:56 | Jean-Christophe Fillion-Robin | Note Added: 0030917 | |
2013-06-05 15:56 | Jean-Christophe Fillion-Robin | Assigned To | => Jean-Christophe Fillion-Robin |
2013-06-05 15:56 | Jean-Christophe Fillion-Robin | Status | backlog => tabled |
2013-06-05 15:59 | Jean-Christophe Fillion-Robin | Note Added: 0030918 | |
2013-06-05 15:59 | Jean-Christophe Fillion-Robin | Status | tabled => closed |
2013-06-05 15:59 | Jean-Christophe Fillion-Robin | Resolution | open => fixed |
2013-06-05 15:59 | Jean-Christophe Fillion-Robin | Fixed in Version | => 5.10.1 |
2013-06-05 16:00 | Jean-Christophe Fillion-Robin | Note Edited: 0030918 | |
2013-06-05 16:08 | Jean-Christophe Fillion-Robin | Relationship added | related to 0011912 |
2015-03-16 11:50 | Clinton Stimpson | Note Added: 0034309 | |
2015-03-16 11:50 | Clinton Stimpson | Status | closed => backlog |
2015-03-16 11:50 | Clinton Stimpson | Resolution | fixed => reopened |
2015-03-16 11:51 | Clinton Stimpson | Note Added: 0034310 | |
2016-07-06 16:47 | Berk Geveci | Status | backlog => expired |
2016-08-12 09:55 | Kitware Robot | Note Added: 0037222 | |
2016-08-12 09:55 | Kitware Robot | Status | expired => closed |
2016-08-12 09:55 | Kitware Robot | Fixed in Version | 5.10.1 => |
2016-08-12 09:55 | Kitware Robot | Resolution | reopened => moved |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |