VTK issueshttps://gitlab.kitware.com/vtk/vtk/-/issues2023-03-31T09:40:24-04:00https://gitlab.kitware.com/vtk/vtk/-/issues/18825Choose one or more OpenGL rendering replacements2023-03-31T09:40:24-04:00David ThompsonChoose one or more OpenGL rendering replacementsVTK needs to migrate away from OpenGL for rendering as vendors (esp. Apple) are dropping support for it.
There are several alternatives and VTK is designed to allow implementations for each, although it is unrealistic to expect funding ...VTK needs to migrate away from OpenGL for rendering as vendors (esp. Apple) are dropping support for it.
There are several alternatives and VTK is designed to allow implementations for each, although it is unrealistic to expect funding exists to implement+maintain them all:
+ [ANARI](https://www.khronos.org/anari) is focused on ray-tracing rather than rasterization. It has support from many hardware vendors, but may not be a fully-functional replacement for some time.
+ [Dawn](https://dawn.googlesource.com/dawn) is a C++ implementation of the [WebGPU](https://webgpu.dev/) standard. Its intended audience is browser developers (esp. Google Chrome), but can be used standalone. The benefit is that [vtk.js implements rendering](https://github.com/Kitware/vtk-js/tree/master/Sources/Rendering/WebGPU) with WebGPU and most of this code could be easily adapted to C++.
+ [Vulkan](https://discourse.vtk.org/t/vulkan-development/3307) has some preliminary work done in VTK but is not natively supported on all platforms (Apple does not support it directly; a third-party adaptor named [MoltenVK](https://moltengl.com/moltenvk/) does exist).
+ [Metal](https://developer.apple.com/metal/) is an Apple-only compute-shader API. Because it is platform-specific, it is unlikely to be adopted.
+ [Direct3D v12](https://en.wikipedia.org/wiki/Direct3D#Direct3D_12) is a Windows-only compute-shader API. Because it is platform-specific, it is unlikely to be adopted.https://gitlab.kitware.com/vtk/vtk/-/issues/18990Blanking points for structured grid.2023-06-07T02:59:33-04:00Jens Munk HansenBlanking points for structured grid.Hi Developers
Not really sure how to report issues. A template for how to fix issues appeared in the description
On the master branch:
SHA eab65effdf34d3853f2fcba8ba7256cdff41b26c
There is currently an issue blanking cell points. Th...Hi Developers
Not really sure how to report issues. A template for how to fix issues appeared in the description
On the master branch:
SHA eab65effdf34d3853f2fcba8ba7256cdff41b26c
There is currently an issue blanking cell points. The example https://examples.vtk.org/site/Cxx/StructuredGrid/BlankPoint/ produces the following output. I will most likely look into this myself sometimes next week, but I believe it is good practice to report such an issue.
![image](/uploads/2eb0008602363a0d1d99efb11dada026/image.png)
Thanks again
Jens Munk Hansenhttps://gitlab.kitware.com/vtk/vtk/-/issues/18865solid meshes with edges enabled show all triangle edges when semi-opaque2023-08-16T09:58:27-04:00Adrian Hallsolid meshes with edges enabled show all triangle edges when semi-opaqueUnder vtk 8.1.1, a semi-opaque plane with solid appearance and edges enabled would be shown like this:
![vtk8](/uploads/80ce09546985f39b64da9b05f30d5b82/vtk8.png)
in vtk 9.2.6, it is shown like this, with the inner triangle edge visibl...Under vtk 8.1.1, a semi-opaque plane with solid appearance and edges enabled would be shown like this:
![vtk8](/uploads/80ce09546985f39b64da9b05f30d5b82/vtk8.png)
in vtk 9.2.6, it is shown like this, with the inner triangle edge visible from some angles:
![vtk9](/uploads/a608087a155b95c0f1ccc98191764398/vtk9.png)
The same behavior occurs with all meshes. The inner edge gets thicker as general line thickness is increased, but is not as thick as the "true" edges. It is generally visible from oblique angles, but not acute ones.
Further discussion at this support topic: https://discourse.vtk.org/t/change-in-rendering-of-semi-opaque-solid-meshes-with-edges-enabled/11120/4
See the following minimum reproducible example
```
import vtk
polydata = vtk.vtkPolyData()
points = vtk.vtkPoints()
points.InsertNextPoint(0, 0, 0)
points.InsertNextPoint(1, 0, 0)
points.InsertNextPoint(1, 1, 0)
points.InsertNextPoint(0, 1, 0)
polys = vtk.vtkCellArray()
polys.InsertNextCell(4, [0, 1, 2, 3])
colors = vtk.vtkUnsignedCharArray()
colors.SetNumberOfComponents(4)
colors.InsertNextTuple([200, 200, 200, 255])
polydata.SetPoints(points)
polydata.SetPolys(polys)
polydata.GetCellData().SetScalars(colors)
mapper = vtk.vtkPolyDataMapper()
mapper.SetInputData(polydata)
actor = vtk.vtkActor()
actor.SetMapper(mapper)
actor.GetProperty().SetEdgeColor(1, 0, 0)
actor.GetProperty().SetEdgeVisibility(True)
actor.GetProperty().SetLineWidth(2)
renderer = vtk.vtkRenderer()
renderer.AddActor(actor)
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(renderer)
renWin.Render()
renderer.ResetCamera()
interactor = vtk.vtkRenderWindowInteractor()
interactor.SetRenderWindow(renWin)
interactor.Start()
```https://gitlab.kitware.com/vtk/vtk/-/issues/16859VTK volume rendering should support Gouraud shading2022-02-04T03:09:04-05:00Aashish ChaudharyVTK volume rendering should support Gouraud shadingCurrently only Phong shading is supported.Currently only Phong shading is supported.https://gitlab.kitware.com/vtk/vtk/-/issues/19003RenderingVR: Add support for validating ActionManifest and BindingFile2024-03-01T17:41:58-05:00Jean-Christophe Fillion-RobinRenderingVR: Add support for validating ActionManifest and BindingFileThis issue was created to track additional improvements discussed in the context of https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9892
_Originally posted by @jcfr in https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9892#note_13...This issue was created to track additional improvements discussed in the context of https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9892
_Originally posted by @jcfr in https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9892#note_1326117_
> @LucasGandelKitware To follow up on our discussion, I generalized the definition of the action and bindings introducing `complexgestureaction` to be used in place of both `leftgripaction` and `rightgripaction`.
>
> I also looking into performing some error checking and warning reported to help developer transition but this would be a more involved changed to be consistently done for both `OpenVR` and `OpenXR`.
>
> Indeed, while the `OpenXR` implementation explicitly handle the parsing of both action and bindings `*.json`, the `OpenVR` implementation relies on `vr::VRInput()->SetActionManifestPath()` that is internally loading the action as well as the `default_bindings`.
>
> This means that to support our own json check in both `OpenVR` and `OpenXR`, we would need to add method like `ParseActionManifest` and `ParseDefaultBindingFile` to both, and report warnings in the following cases:
> * if either `leftgripaction` or `rightgripaction` are found in the manifest, report a warning
> * if at least one `complexgestureaction` output is specified in the bindings, report an error indicating that two are required.
_Originally posted by @LucasGandelKitware in https://gitlab.kitware.com/vtk/vtk/-/merge_requests/9892#note_1326117_
> Thanks @jcfr, the new approach looks much better as it allows for binding any button in order to handle complex gestures. Thank you very much for doing this change.
>
> Going a bit further with the checks you listed, we should also check that the 2 `complexgestureaction` output, are using a different path, one is for [left](https://gitlab.kitware.com/vtk/vtk/-/blob/930053f104685941bc2ddf527ad8b689c08438e8/Rendering/OpenVR/vtk_openvr_binding_oculus_touch.json#L24) and the other is for [right](https://gitlab.kitware.com/vtk/vtk/-/blob/930053f104685941bc2ddf527ad8b689c08438e8/Rendering/OpenVR/vtk_openvr_binding_oculus_touch.json#L60). Otherwise we can have 2 buttons of the same controller performing gesture recognition, which makes no sense.<br/>
> In addition, in your last point I think you meant "if only one" instead of "if at least one".https://gitlab.kitware.com/vtk/vtk/-/issues/19291Update minimum OpenGL version to 4.12024-03-26T09:12:56-04:00Jaswant Panchumarti (Kitware)Update minimum OpenGL version to 4.1This should be easy as almost all VTK applications out there use 4.5 already. The three OpenGL render window classes will have to drop support for less than 4.1 from and ensure a clean CI.
If not all, most modern computers are capable o...This should be easy as almost all VTK applications out there use 4.5 already. The three OpenGL render window classes will have to drop support for less than 4.1 from and ensure a clean CI.
If not all, most modern computers are capable of 4.5
- Mesa 12 onwards support OpenGL 4.3 (ubuntu 20.04 has mesa 21.2.6, debian 10 has 18.3.6, many distros considered 'old' have a mesa version > 18.)
- macOS only supports upto 4.1, this is the reason we can't aim higher than 4.1Jaswant Panchumarti (Kitware)Jaswant Panchumarti (Kitware)https://gitlab.kitware.com/vtk/vtk/-/issues/19144Transparent disk in the vtkCameraOrientationRepresentation fails to render wi...2023-10-26T23:19:53-04:00Jaswant Panchumarti (Kitware)Transparent disk in the vtkCameraOrientationRepresentation fails to render with OpenGL ES 3.0WebGL2 warnings and errors from VTK
![image](/uploads/781cb6397e129ac7562bfc8c2abab4e9/image.png)
The shafts, handles and text render correctly. Only the transparent disk fails to render. This might be a problem with `vtkOrderIndependen...WebGL2 warnings and errors from VTK
![image](/uploads/781cb6397e129ac7562bfc8c2abab4e9/image.png)
The shafts, handles and text render correctly. Only the transparent disk fails to render. This might be a problem with `vtkOrderIndependentTranslucentPass`. Translucency, in general works with vtk.wasm, so it's not clear why transparent parts of a representation fail to render.
![image](/uploads/3b1922ac802b7798ea0267c1a0b4afd3/image.png)Jaswant Panchumarti (Kitware)Jaswant Panchumarti (Kitware)https://gitlab.kitware.com/vtk/vtk/-/issues/19128Qt + osmesa = broken, but no CMake error?2023-10-11T14:45:01-04:00Matthew WoehlkeQt + osmesa = broken, but no CMake error?I configured VTK with (among other things):
```
-DVTK_BUILD_ALL_MODULES=ON
-DVTK_OPENGL_HAS_OSMESA:BOOL=ON
-DVTK_USE_X:BOOL=OFF
```
I am told that this is broken (note that `-DVTK_BUILD_ALL_MODULES=ON` enables Qt), and that CMake should...I configured VTK with (among other things):
```
-DVTK_BUILD_ALL_MODULES=ON
-DVTK_OPENGL_HAS_OSMESA:BOOL=ON
-DVTK_USE_X:BOOL=OFF
```
I am told that this is broken (note that `-DVTK_BUILD_ALL_MODULES=ON` enables Qt), and that CMake should have complained about it.https://gitlab.kitware.com/vtk/vtk/-/issues/19094vtkCompositePolyDataMapper & Static flag2023-11-01T13:53:23-04:00clintonstimpsonvtkCompositePolyDataMapper & Static flagSince it is now being recommended that `vtkCompositePolyDataMapper` be used instead of `vtkCompositePolyDataMapper2`, I'll point out a difference in behavior. That is, `vtkCompositePolyDataMapper::GetBounds()` doesn't return initialized...Since it is now being recommended that `vtkCompositePolyDataMapper` be used instead of `vtkCompositePolyDataMapper2`, I'll point out a difference in behavior. That is, `vtkCompositePolyDataMapper::GetBounds()` doesn't return initialized bounds like `vtkCompositePolyDataMapper2::GetBounds()` does, if the `Static` flag is enabled. The result is the actor gets culled and the dataset is not rendered. I'm seeing this issue when trying the VTK 9.3 RC.Jaswant Panchumarti (Kitware)Jaswant Panchumarti (Kitware)https://gitlab.kitware.com/vtk/vtk/-/issues/19089WASM: Shader program error2023-10-19T17:54:30-04:00Jaswant Panchumarti (Kitware)WASM: Shader program errorThis issue was copied over from an external customer helpdesk.
Ploydata with lines generates the following error if edge or vertex visibility is set to true:
ERROR: In vtkShaderProgram.cxx, line 442
Uncomment following lines to genera...This issue was copied over from an external customer helpdesk.
Ploydata with lines generates the following error if edge or vertex visibility is set to true:
ERROR: In vtkShaderProgram.cxx, line 442
Uncomment following lines to generate error
```
//vtkProperty.SetEdgeVisibility(true);
//vtkProperty.SetVertexVisibility(true);
```
File to reproduce error:
[shader_program_error.7z](/uploads/9984b4db1beabc938bcee29d9e5bf7b4/shader_program_error.7z)Jaswant Panchumarti (Kitware)Jaswant Panchumarti (Kitware)https://gitlab.kitware.com/vtk/vtk/-/issues/19078WASM: Incorrect polygon display2023-10-19T17:54:30-04:00Jaswant Panchumarti (Kitware)WASM: Incorrect polygon displayThis issue is copy pasted from a customer's external help desk.
For polygons, mesh display is not correct (image 2) if both face and edge visibility are on. In the current case, the facets count is around 2m.
Image 1:
![image](/upload...This issue is copy pasted from a customer's external help desk.
For polygons, mesh display is not correct (image 2) if both face and edge visibility are on. In the current case, the facets count is around 2m.
Image 1:
![image](/uploads/2a1642dd6d5535b6f879c0b5b09545e9/image.png)
Image 2:
![image](/uploads/e184ae4bffac507381b948dd9bc4ad58/image.png)
Image 3:
![image](/uploads/f635fe5f1310e37f5534d247cf580f47/image.png)Jaswant Panchumarti (Kitware)Jaswant Panchumarti (Kitware)https://gitlab.kitware.com/vtk/vtk/-/issues/19060build failure with emscripten 3.1.452023-10-19T17:54:30-04:00Raymond Chenbuild failure with emscripten 3.1.45I am tring to use webgpu, but can not build .
### commit `1221eaeeb7`
### the build error info
```
vtk/Rendering/WebGPU/vtkWebGPUInternalsShaderModule.cxx:11:12: error: no member named 'source' in 'wgpu::ShaderModuleWGSLDescriptor'
...I am tring to use webgpu, but can not build .
### commit `1221eaeeb7`
### the build error info
```
vtk/Rendering/WebGPU/vtkWebGPUInternalsShaderModule.cxx:11:12: error: no member named 'source' in 'wgpu::ShaderModuleWGSLDescriptor'
11 | wgslDesc.source = source.c_str();
| ~~~~~~~~ ^
1 error generated.
```
### in `webgpu_cpp.h`
![image](/uploads/dd48a1c05beb00cf07a6f3a679effa1c/image.png)
![image](/uploads/7b1d76040bddaefa106cbef2500a73b8/image.png)
### emcc
```
emcc -v
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.45 (ef3e4e3b044de98e1811546e0bc605c65d3412f4)
clang version 18.0.0 (https://github.com/llvm/llvm-project d1e685df45dc5944b43d2547d0138cd4a3ee4efe)
Target: wasm32-unknown-emscripten
Thread model: posix
```Jaswant Panchumarti (Kitware)Jaswant Panchumarti (Kitware)https://gitlab.kitware.com/vtk/vtk/-/issues/18973Wireframe rendering fails on linux with amdgpu drivers2023-05-24T15:26:18-04:00David GobbiWireframe rendering fails on linux with amdgpu driversOn ubuntu 22.04, with Radeon GPU/APU, and amdgpu drivers, the wireframe rendering is incorrectly shaded. Many lines are black.
For TestQuadricDecimationRegularization, the black lines ruin the rendering completely:
![TestQuadricDecima...On ubuntu 22.04, with Radeon GPU/APU, and amdgpu drivers, the wireframe rendering is incorrectly shaded. Many lines are black.
For TestQuadricDecimationRegularization, the black lines ruin the rendering completely:
![TestQuadricDecimationRegularization.orig](/uploads/1a9c174c5571e18182a35080f72f2ece/TestQuadricDecimationRegularization.orig.png) ![TestQuadricDecimationRegularization](/uploads/24555c22db8fbba036d6d4a527084a5a/TestQuadricDecimationRegularization.png)
For TestCoincident, the change is more subtle, but is enough to cause a test failure:
![TestCoincident.orig](/uploads/b7b443e716617bd2a5d8f3a62bdc0362/TestCoincident.orig.png) ![TestCoincident](/uploads/ec5c5de5726577bc0594674b6bc0afc0/TestCoincident.png)
The total number of test that fail with amdgpu drivers due to this issue is around 20 (pretty much every test that uses wireframe rendering).https://gitlab.kitware.com/vtk/vtk/-/issues/18958UnstructuredGrid edge display issue2023-06-09T10:22:09-04:00Alex KaszynskiUnstructuredGrid edge display issueWhen displaying both vtkTriangle and vtkLine on the same plot with `SetEdgeVisibility(True)`, edges for some of the triangles do not appear. Here is a MWE:
![tmp](/uploads/5f72c02a4e18bde1148b06c01cc384a2/tmp.png)
```py
import vtk
vtk...When displaying both vtkTriangle and vtkLine on the same plot with `SetEdgeVisibility(True)`, edges for some of the triangles do not appear. Here is a MWE:
![tmp](/uploads/5f72c02a4e18bde1148b06c01cc384a2/tmp.png)
```py
import vtk
vtk_points = vtk.vtkPoints()
vtk_points.InsertNextPoint([0.0, 0.0, -0.5])
vtk_points.InsertNextPoint([-0.5, 0.0, 0.0])
vtk_points.InsertNextPoint([0.25, 0.43, 0.0])
vtk_points.InsertNextPoint([0.25, -0.43, 0.0])
cells = vtk.vtkCellArray()
triangle1 = vtk.vtkTriangle()
triangle1.GetPointIds().SetId(0, 1)
triangle1.GetPointIds().SetId(1, 2)
triangle1.GetPointIds().SetId(2, 0)
cells.InsertNextCell(triangle1)
triangle2 = vtk.vtkTriangle()
triangle2.GetPointIds().SetId(0, 3)
triangle2.GetPointIds().SetId(1, 1)
triangle2.GetPointIds().SetId(2, 0)
cells.InsertNextCell(triangle2)
line = vtk.vtkLine()
line.GetPointIds().SetId(0, 2)
line.GetPointIds().SetId(1, 3)
cells.InsertNextCell(line)
ugrid = vtk.vtkUnstructuredGrid()
ugrid.SetPoints(vtk_points)
ugrid.SetCells([5, 5, 3], cells)
mapper = vtk.vtkDataSetMapper()
mapper.SetInputData(ugrid)
actor = vtk.vtkActor()
actor.SetMapper(mapper)
actor.GetProperty().SetLineWidth(5)
actor.GetProperty().SetEdgeVisibility(True)
renderer = vtk.vtkRenderer()
renderer.AddActor(actor)
renderer.SetBackground(0.3, 0.3, 0.3)
render_window = vtk.vtkRenderWindow()
render_window.AddRenderer(renderer)
interactor = vtk.vtkRenderWindowInteractor()
interactor.SetRenderWindow(render_window)
interactor.Initialize()
interactor.Start()
```
Is there a workround for this issue?https://gitlab.kitware.com/vtk/vtk/-/issues/18848PolydataMapper consumes too much system memory for large datasets2023-10-18T08:49:58-04:00Jaswant Panchumarti (Kitware)PolydataMapper consumes too much system memory for large datasetsThis documents a memory consumption issue with the polydata mappers (Desktop GL and GLES). It is noticeable when rendering 10000 or more objects with `vtkCompositePolyDataMapper2` which internally use `vtkPolyDataMapper` to minimize numb...This documents a memory consumption issue with the polydata mappers (Desktop GL and GLES). It is noticeable when rendering 10000 or more objects with `vtkCompositePolyDataMapper2` which internally use `vtkPolyDataMapper` to minimize number of OpenGL data uploads. While there are no known leaks, the memory consumption is unexpectedly high.
1. [Desktop OpenGL](https://chart-studio.plotly.com/~jspanchu/3/#/)
<img src=/uploads/74b1cb264804590a78adf86c699bd85b/GL.png width="800" height="400">
2. [OpenGL ES3.0](https://chart-studio.plotly.com/~jspanchu/1/#/)
<img src=/uploads/e5deb528a98edfdf4923705ca8e06229/GLES.png width="800" height="400">
In GLES 3.0, the mapper duplicates shared vertices so that explains higher memory usage than desktop GL. In any case, the RAM usage is more than double the actual size of the datasets. The GLES 3.0 mapper was meant for consumption in the browser through WebAssembly where memory is a scarce resource (limited to 2GB). The limit is easily hit for 3 million triangles.
These memory profiles can be reproduced with scripts and datasets found at [vtk-polydata-mapper-memory](https://gitlab.kitware.com/jaswant.panchumarti/vtk-polydata-mapper-memory)Jaswant Panchumarti (Kitware)Jaswant Panchumarti (Kitware)https://gitlab.kitware.com/vtk/vtk/-/issues/18743No TimerEvent from vtkWin32RenderWindowInteractor when timers created2022-12-08T21:20:58-05:00David GobbiNo TimerEvent from vtkWin32RenderWindowInteractor when timers createdTimers do not seem to work with the vtkWin32RenderWindowInteractor.
The following code shows an animated cone and prints timer counts on Linux with vtkXRenderWindowInteractor, but shows no timer activity with vtkWin32RenderWindowInterac...Timers do not seem to work with the vtkWin32RenderWindowInteractor.
The following code shows an animated cone and prints timer counts on Linux with vtkXRenderWindowInteractor, but shows no timer activity with vtkWin32RenderWindowInteractor:
```cpp
#include "vtkCamera.h"
#include "vtkCommand.h"
#include "vtkPolyDataMapper.h"
#include "vtkNew.h"
#include "vtkRenderWindow.h"
#include "vtkRenderWindowInteractor.h"
#include "vtkRenderer.h"
#include "vtkConeSource.h"
class CallbackClass
{
public:
CallbackClass(vtkCamera* camera) : TimerCount(0), Camera(camera) {}
void OnTimer(vtkObject* caller, unsigned long event, void*) {
std::cout << caller->GetClassName() << " ";
std::cout << vtkCommand::GetStringFromEventId(event) << " ";
std::cout << this->TimerCount << std::endl;
++this->TimerCount;
this->Camera->Roll(10);
static_cast<vtkRenderWindowInteractor*>(caller)->Render();
}
private:
int TimerCount;
vtkCamera* Camera;
};
int main(int, char* [])
{
vtkNew<vtkConeSource> sphereSource;
sphereSource->Update();
vtkNew<vtkPolyDataMapper> mapper;
mapper->SetInputConnection(sphereSource->GetOutputPort());
vtkNew<vtkActor> actor;
actor->SetMapper(mapper);
vtkNew<vtkRenderer> renderer;
renderer->AddActor(actor);
vtkNew<vtkRenderWindow> renderWindow;
renderWindow->AddRenderer(renderer);
vtkNew<vtkRenderWindowInteractor> interactor;
interactor->SetRenderWindow(renderWindow);
interactor->Initialize();
renderWindow->Render();
CallbackClass o(renderer->GetActiveCamera());
interactor->AddObserver(vtkCommand::TimerEvent, &o, &CallbackClass::OnTimer);
int timerId = interactor->CreateRepeatingTimer(1000);
interactor->Start();
interactor->DestroyTimer(timerId);
return 0;
}
```https://gitlab.kitware.com/vtk/vtk/-/issues/18453Wireframe black artefact (OSMesa, Intel chipset)2023-05-07T16:42:27-04:00Lucas GandelWireframe black artefact (OSMesa, Intel chipset)Black artefacts are visible when rendering a quad as wireframe on different hardware.
This has been reproduced with OSMesa and Intel UHD Graphics 630.
vtkResliceCursorWidget tests are impacted after forcing the representation of the wi...Black artefacts are visible when rendering a quad as wireframe on different hardware.
This has been reproduced with OSMesa and Intel UHD Graphics 630.
vtkResliceCursorWidget tests are impacted after forcing the representation of the widget to wireframe in order to workaround #18441. (See !8879) It only happens when the cursor is perfectly aligned with the camera view up. Moving the cursor a bit brings the color back.
<img src="/uploads/72c365864088c2c08eb1a5c7a3801638/ResliceCursorBlackLine.PNG" width="300" height="300">
<img src="/uploads/47f7df827ccbd0c49744486cfedfe3f0/ResliceCursorOK.PNG" width="300" height="300">
Similar issues can be reproduce with a simple quad rendered as wireframe.
<img src="/uploads/2e42bc2b6f0026fed99739a27766f203/PlaneSource1.PNG" width="500" height="300">
Please note:
- it only affect quads (vtkResliceCursorActor above is not using lines, but quads with a normal orthogonal to the camera direction).
- it seems to be caused by a wrong computation of `normalVCVSOutput` in [vtkOpenGLPolyDataMapper](https://gitlab.kitware.com/vtk/vtk/-/blob/master/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx#L2208).https://gitlab.kitware.com/vtk/vtk/-/issues/18372Crash on window close with vtkXRenderWindowInteractor2022-03-30T04:25:35-04:00David GobbiCrash on window close with vtkXRenderWindowInteractorThis is an issue in VTK 9.0 and 9.1 (and possibly earlier?)
The `vtkXRenderWindowInteractor` will crash when the window is closed, if the window called `XOpenDisplay()` before the interactor was attached to it. The problem is that, if...This is an issue in VTK 9.0 and 9.1 (and possibly earlier?)
The `vtkXRenderWindowInteractor` will crash when the window is closed, if the window called `XOpenDisplay()` before the interactor was attached to it. The problem is that, if the window thinks it owns the `DisplayId` handle (if `win->OwnDisplay == 1`), then closing the window will call `XCloseDisplay(win->DisplayId)`, which leaves the `iren->DisplayId` dangling.
Conversely, if the interactor calls `XOpenDisplay()` then there is no crash when the window closes, but there is a resource leak since the interactor never calls `XCloseDisplay()`. See `vtkXRenderWindowInteractor::Initialize()`:
```c++
this->DisplayId = static_cast<Display*>(renWin->GetGenericDisplayId());
if (!this->DisplayId)
{
vtkDebugMacro("opening display");
this->DisplayId = XOpenDisplay(nullptr);
vtkDebugMacro("opened display");
renWin->SetDisplayId(this->DisplayId);
}
```
Test code for reproducing the crash:
```python
from vtkmodules.vtkRenderingCore import (
vtkRenderer,
vtkRenderWindow,
vtkRenderWindowInteractor,
)
import vtkmodules.vtkRenderingUI
import vtkmodules.vtkRenderingOpenGL2
import vtkmodules.vtkInteractionStyle
ren = vtkRenderer()
ren.SetBackground(0.5, 0.2, 0.2)
renWin = vtkRenderWindow()
renWin.AddRenderer(ren)
# this line causes renWin->DisplayId and renWin->OwnDisplay to be set
renWin.Render()
iren = vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
# this line causes iren->DisplayId to be set to renWin->DisplayId
iren.Initialize()
# here we start the main loop, but when we close the window, renWin closes
# its DisplayId, and iren->DisplayId is left dangling (segfault!)
iren.Start()
```https://gitlab.kitware.com/vtk/vtk/-/issues/18278LIBGL_ALWAYS_SOFTWARE=1 with stock linux drivers gives black window2021-08-27T08:56:16-04:00David GobbiLIBGL_ALWAYS_SOFTWARE=1 with stock linux drivers gives black windowWhen the environment variable LIBGL\_ALWAYS\_SOFTWARE is set on linux to force the use of llvmpipe instead of hardware rendering, the resulting window is black.
Bisection shows that this was caused by !6965, which changed framebuffer ha...When the environment variable LIBGL\_ALWAYS\_SOFTWARE is set on linux to force the use of llvmpipe instead of hardware rendering, the resulting window is black.
Bisection shows that this was caused by !6965, which changed framebuffer handling.
To reproduce, run a VTK test as follows on Linux with stock (not proprietary) drivers:
```
LIBGL_ALWAYS_SOFTWARE=1 bin/vtkInteractionWidgetsCxxTests TestCameraWidget
```
I did the testing on Ubuntu 20.04 with amdgpu and nouveau drivers
```text
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 12.0.0, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 21.0.3
```
Note that the Qt tests render correctly, while tests that use vtkXOpenGLRenderWindow produce a black window.https://gitlab.kitware.com/vtk/vtk/-/issues/18174Edge artifacts in surface representation2022-04-05T06:14:11-04:00Federico MiorelliEdge artifacts in surface representationI'm having strange edge artifacts when displaying surfaces of grids (ImageData, RectilinearGrid, StructuredGrid does not seem to make a difference) with EdgeVisibility.
Part of the edges that should be hidden are visible even though the...I'm having strange edge artifacts when displaying surfaces of grids (ImageData, RectilinearGrid, StructuredGrid does not seem to make a difference) with EdgeVisibility.
Part of the edges that should be hidden are visible even though there is no transparency.
![image](/uploads/86e1e33b651d0f5000f38ef57eca8f55/image.png)
![image](/uploads/7d5fa8dd3c890cff0417f4eb65a95172/image.png)
Did not happen with older (< 8) VTK versions, although I cannot confirm which is the first version that introduced the issue.
Possibly related to #17783 and #18064 ?
This is easily reproduced with the code below. Relates to grid size, the effect is less noticeable with smaller grids.
```
import vtk
image_data = vtk.vtkImageData()
image_data.SetDimensions(100, 100, 2)
mapper = vtk.vtkDataSetMapper();
mapper.SetInputData(image_data)
actor = vtk.vtkActor();
actor.GetProperty().SetEdgeVisibility(True)
actor.SetMapper(mapper);
renderer = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(renderer)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
iren.Initialize()
renderer.AddActor(actor)
cam = renderer.GetActiveCamera();
cam.SetPosition(-1, -1, .3);
cam.SetFocalPoint(0.0, 0.0, 0.5);
cam.SetViewUp(0, 0, 1);
cam.Zoom(0.5)
iren.Start()
```