# When I use QVTKOpenGlnativeWidget, the volume rendering data of VTKSmartVolumeMapper cannot be displayed. When I change the multi-sampling parameter to 0, it can be displayed, but the effect is not good

**URL:** https://discourse.vtk.org/t/when-i-use-qvtkopenglnativewidget-the-volume-rendering-data-of-vtksmartvolumemapper-cannot-be-displayed-when-i-change-the-multi-sampling-parameter-to-0-it-can-be-displayed-but-the-effect-is-not-good/5383
**Category:** Support
**Tags:** proposal
**Created:** [March 15, 2021, 7:02am UTC](https://discourse.vtk.org/t/when-i-use-qvtkopenglnativewidget-the-volume-rendering-data-of-vtksmartvolumemapper-cannot-be-displayed-when-i-change-the-multi-sampling-parameter-to-0-it-can-be-displayed-but-the-effect-is-not-good/5383 "2021-03-15T07:02:28Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![loufear](https://discourse.vtk.org/user_avatar/discourse.vtk.org/loufear/32/3150_2.png) [@loufear](https://discourse.vtk.org/u/loufear)
#### Post date: [March 15, 2021, 7:02am UTC](https://discourse.vtk.org/t/when-i-use-qvtkopenglnativewidget-the-volume-rendering-data-of-vtksmartvolumemapper-cannot-be-displayed-when-i-change-the-multi-sampling-parameter-to-0-it-can-be-displayed-but-the-effect-is-not-good/5383/1 "2021-03-15T07:02:28Z")

</div>

Is there a better solution?

---

<div class="post-metadata">

### Author: ![sankhesh](https://discourse.vtk.org/user_avatar/discourse.vtk.org/sankhesh/32/73_2.png) [@sankhesh](https://discourse.vtk.org/u/sankhesh)
#### Post date: [March 15, 2021, 2:54pm UTC](https://discourse.vtk.org/t/when-i-use-qvtkopenglnativewidget-the-volume-rendering-data-of-vtksmartvolumemapper-cannot-be-displayed-when-i-change-the-multi-sampling-parameter-to-0-it-can-be-displayed-but-the-effect-is-not-good/5383/2 "2021-03-15T14:54:38Z")

</div>

QVTKOpenGLNativeWidget supports rendering volumes with vtkSmartVolumeMapper. See [SmartVolumeMapper example](https://kitware.github.io/vtk-examples/site/Cxx/VolumeRendering/SmartVolumeMapper/) for an example usage of `vtkSmartVolumeMapper`.

The only difference would be the render window. Use `vtkGenericOpenGLRenderWindow` and set it to the widget via `QVTKOpenGLNativeWidget::setRenderWindow`.

---

<div class="post-metadata">

### Author: ![loufear](https://discourse.vtk.org/user_avatar/discourse.vtk.org/loufear/32/3150_2.png) [@loufear](https://discourse.vtk.org/u/loufear)
#### Post date: [March 16, 2021, 4:14am UTC](https://discourse.vtk.org/t/when-i-use-qvtkopenglnativewidget-the-volume-rendering-data-of-vtksmartvolumemapper-cannot-be-displayed-when-i-change-the-multi-sampling-parameter-to-0-it-can-be-displayed-but-the-effect-is-not-good/5383/3 "2021-03-16T04:14:43Z")

</div>

Using QVTKOpenGlnativeWidget with the same parameter as VTKRenderWindow is a big difference

 ![微信图片_20210316121356](https://discourse.vtk.org/uploads/default/original/2X/1/10c816cb08415e9556c66be3e072b41fd9939d04.jpeg) ![微信图片_20210316121401](https://discourse.vtk.org/uploads/default/original/2X/f/f2ff1d109b317eae84488e0be0fc00ddaf128e0e.png)

---

<div class="post-metadata">

### Author: ![yangyang117](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/y/da6949/32.png) [@yangyang117](https://discourse.vtk.org/u/yangyang117)
#### Post date: [December 6, 2023, 2:56am UTC](https://discourse.vtk.org/t/when-i-use-qvtkopenglnativewidget-the-volume-rendering-data-of-vtksmartvolumemapper-cannot-be-displayed-when-i-change-the-multi-sampling-parameter-to-0-it-can-be-displayed-but-the-effect-is-not-good/5383/4 "2023-12-06T02:56:01Z")

</div>

hello, the github is missed. can you offer the code of use vtksmartvolumemapper and QVTKOpenGLNativeWidget to show the data by gpu?
