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

[visualization] some warnings will be displayed with VTK 9 #4830

Closed
UnaNancyOwen opened this issue Jul 2, 2021 · 10 comments
Closed

[visualization] some warnings will be displayed with VTK 9 #4830

UnaNancyOwen opened this issue Jul 2, 2021 · 10 comments
Labels
kind: bug Type of issue status: triage Labels incomplete
Milestone

Comments

@UnaNancyOwen
Copy link
Member

UnaNancyOwen commented Jul 2, 2021

Describe the bug

If you build PCL with VTK9, you will see some warnings when app runtime.
These warnings are caused by the use of deprecated features to be removed in the future of VTK.

To Reproduce

  1. install PCL 1.12.0 RC1 with VTK 9.
  2. run tutorial code of pcl visualizer.

Screenshots/Code snippets

  • screen shot

    2021-07-02_09h50_03

  • console

2021-07-02 09:48:16.193 (   0.273s) [                ]vtkOpenGLPolyDataMapper:271   WARN| vtkOpenGLPolyDataMapper::GetVertexShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::GetVertexShaderCode instead.
2021-07-02 09:48:16.220 (   0.299s) [                ]vtkOpenGLPolyDataMapper:263   WARN| vtkOpenGLPolyDataMapper::SetVertexShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::SetVertexShaderCode instead.
2021-07-02 09:48:16.223 (   0.303s) [                ]vtkOpenGLPolyDataMapper:301   WARN| vtkOpenGLPolyDataMapper::GetGeometryShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::GetGeometryShaderCode instead.
2021-07-02 09:48:16.227 (   0.307s) [                ]vtkOpenGLPolyDataMapper:293   WARN| vtkOpenGLPolyDataMapper::SetGeometryShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::SetGeometryShaderCode instead.
2021-07-02 09:48:16.234 (   0.313s) [                ]vtkOpenGLPolyDataMapper:286   WARN| vtkOpenGLPolyDataMapper::GetFragmentShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::GetFragmentShaderCode instead.
2021-07-02 09:48:16.239 (   0.318s) [                ]vtkOpenGLPolyDataMapper:278   WARN| vtkOpenGLPolyDataMapper::SetFragmentShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::SetFragmentShaderCode instead.
2021-07-02 09:48:16.244 (   0.324s) [                ]vtkOpenGLPolyDataMapper:271   WARN| vtkOpenGLPolyDataMapper::GetVertexShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::GetVertexShaderCode instead.
2021-07-02 09:48:16.252 (   0.332s) [                ]vtkOpenGLPolyDataMapper:263   WARN| vtkOpenGLPolyDataMapper::SetVertexShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::SetVertexShaderCode instead.
2021-07-02 09:48:16.260 (   0.340s) [                ]vtkOpenGLPolyDataMapper:301   WARN| vtkOpenGLPolyDataMapper::GetGeometryShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::GetGeometryShaderCode instead.
2021-07-02 09:48:16.268 (   0.348s) [                ]vtkOpenGLPolyDataMapper:293   WARN| vtkOpenGLPolyDataMapper::SetGeometryShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::SetGeometryShaderCode instead.
2021-07-02 09:48:16.278 (   0.358s) [                ]vtkOpenGLPolyDataMapper:286   WARN| vtkOpenGLPolyDataMapper::GetFragmentShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::GetFragmentShaderCode instead.
2021-07-02 09:48:16.287 (   0.367s) [                ]vtkOpenGLPolyDataMapper:278   WARN| vtkOpenGLPolyDataMapper::SetFragmentShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::SetFragmentShaderCode instead.
  • vtkOutputWindow
Generic Warning: In C:\VTK-9.0.2\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 271
vtkOpenGLPolyDataMapper::GetVertexShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::GetVertexShaderCode instead.

Generic Warning: In C:\VTK-9.0.2\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 263
vtkOpenGLPolyDataMapper::SetVertexShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::SetVertexShaderCode instead.

Generic Warning: In C:\VTK-9.0.2\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 301
vtkOpenGLPolyDataMapper::GetGeometryShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::GetGeometryShaderCode instead.

Generic Warning: In C:\VTK-9.0.2\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 293
vtkOpenGLPolyDataMapper::SetGeometryShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::SetGeometryShaderCode instead.

Generic Warning: In C:\VTK-9.0.2\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 286
vtkOpenGLPolyDataMapper::GetFragmentShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::GetFragmentShaderCode instead.

Generic Warning: In C:\VTK-9.0.2\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 278
vtkOpenGLPolyDataMapper::SetFragmentShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::SetFragmentShaderCode instead.

Generic Warning: In C:\VTK-9.0.2\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 271
vtkOpenGLPolyDataMapper::GetVertexShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::GetVertexShaderCode instead.

Generic Warning: In C:\VTK-9.0.2\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 263
vtkOpenGLPolyDataMapper::SetVertexShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::SetVertexShaderCode instead.

Generic Warning: In C:\VTK-9.0.2\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 301
vtkOpenGLPolyDataMapper::GetGeometryShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::GetGeometryShaderCode instead.

Generic Warning: In C:\VTK-9.0.2\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 293
vtkOpenGLPolyDataMapper::SetGeometryShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::SetGeometryShaderCode instead.

Generic Warning: In C:\VTK-9.0.2\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 286
vtkOpenGLPolyDataMapper::GetFragmentShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::GetFragmentShaderCode instead.

Generic Warning: In C:\VTK-9.0.2\Rendering\OpenGL2\vtkOpenGLPolyDataMapper.cxx, line 278
vtkOpenGLPolyDataMapper::SetFragmentShaderCode was deprecated for VTK 9.0 and will be removed in a future version.  Use vtkOpenGLShaderProperty::SetFragmentShaderCode instead.

Your Environment (please complete the following information):

  • OS: Widnows 10
  • Compiler: Visual Studio 2019
  • PCL Version: PCL 1.12.0 RC1
  • VTK Version: VTK 9.0.2

Possible Solution

You can temporarily work around this problem by inserting this code snippet into user code.

pcl::visualization::PCLVisualizer::Ptr viewer = pcl::make_shared<pcl::visualization::PCLVisualizer>( "Point Cloud Viewer" );
viewer->getRenderWindow()->GlobalWarningDisplayOff(); // Add This Line
@UnaNancyOwen UnaNancyOwen added kind: bug Type of issue status: triage Labels incomplete labels Jul 2, 2021
@kunaltyagi
Copy link
Member

Pinging @larshg

TLDR:
Need to replace vtkOpenGLPolyDataMapper with vtkOpenGLShaderProperty to use

  • {Get,Set}FragmentShaderCode
  • {Get,Set}VertexShaderCode
  • {Get,Set}GeometryShaderCode

@kunaltyagi kunaltyagi added this to the pcl-1.12.0 milestone Jul 2, 2021
@kunaltyagi
Copy link
Member

Questions in my head:

  • Can we move this to 1.12.1 if no API/ABI is affected?
  • Should we just disable warnings?

@larshg
Copy link
Contributor

larshg commented Jul 2, 2021

I don't think its something that we use explicitly. I at least cannot find any vtkOpenGLPolyDataMapper, only vtkPolyDataMapper.
I think its a warning from VTK internal use, please see https://discourse.vtk.org/t/vtk-9-0-rc1/2916.

I would say, that its up to the users to silence those warnings - or would you add it to the PCLVisualizer?

@kunaltyagi
Copy link
Member

Oh, ok, we can ignore them. For the binaries, we should explicitly silence them, and for the libraries, add this to release notes that the warnings are not ours.

@UnaNancyOwen
Copy link
Member Author

UnaNancyOwen commented Jul 3, 2021

You can ignore the warnings, they are due to backwards compatibility code where VTK calls deprecated code itself. Turning on VTK_LEGACY_REMOVE in CMake I think gets rid of them.
https://discourse.vtk.org/t/vtk-9-0-rc1/2916/3

If there are no problem and no bad effect turning VTK_LEGACY_REMOVE of VTK to ON in PCL, we can turn it on in VTK included in PCL All-in-one Installer.

@kunaltyagi
Copy link
Member

I don't know about switching on the flag universally because that also hides the warnings in user-only code as well

@UnaNancyOwen
Copy link
Member Author

UnaNancyOwen commented Jul 3, 2021

This is report. I tried this #4830 (comment).
I built PCL that linked VTK with VTK_LEGACY_REMOVE turned ON. But, the user code that uses it did not work well. It crashes with an error. Therefore, this idea does not seem good. At least in PCL, VTK_LEGACY_REMOVE must be OFF.

@kunaltyagi
Copy link
Member

Did you try VTK_LEGACY_REMOVE with pcl_visualizer?

@kunaltyagi kunaltyagi modified the milestones: pcl-1.12.0, pcl-1.12.1 Jul 7, 2021
@UnaNancyOwen
Copy link
Member Author

Did you try VTK_LEGACY_REMOVE with pcl_visualizer?

Yes, This is the report of that case. #4830 (comment)

@kunaltyagi
Copy link
Member

I don't think any action is needed from our end. Let's close the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Type of issue status: triage Labels incomplete
Projects
None yet
Development

No branches or pull requests

3 participants