[slicer-v9.2.20230607-1ff325c54-2] Backports related to Rendering & VR#46
Conversation
- The last few triangle's edges were not visible because the PrimitiveIDOffset in the shader overflowed and went past the end of the EdgeValues texture buffer. As a result, the edge equation's z component was garbage or 0. - Resize and fill the edge values vector with placeholder elements to fix out of bounds access in geometry shader. - This fix is borrowed from the vtkOpenGLBatchedPolyDataMapper code. (cherry picked from commit Kitware/VTK@13e28a9)
VTK !8186 added support for using multitexturing with InterpolateScalarsBeforeMappingOn to allow for blending interpolated scalars with texture coloring. This commit extends this support to the "actortexture" and "albedoTex" textures that can be respectively set with vtkActor::SetTexture() and vtkActor::GetProperty()->SetBaseColorTexture(). When turning on InterpolateScalarsBeforeMapping, the mapper internally creates a texture with the associated texture coordinates. This commit adds a specific attribute for those tcoords to avoid overriding the existing polydata tcoords. Merge-request: vtk/vtk!10271 (cherry picked from commit Kitware/VTK@7996928)
Merge-request: vtk/vtk!10271 (cherry picked from commit Kitware/VTK@3db581f)
…data mapper Backport fix from Kitware/VTK@79969286 Merge-request: vtk/vtk!10271 (cherry picked from commit Kitware/VTK@9925fd1)
… polydata mapper Backport fix from Kitware/VTK@79969286 Merge-request: vtk/vtk!10271 (cherry picked from commit Kitware/VTK@00a170c)
TestBlockOpacity is using vtkCompositePolyDataMapper2 that was deprecated for 9.3. Remove this test here as it won't pass after the fix introduced in 7996928. Backporting 7996928 to fix the TestBlockOpacity is easy, but there is no point in fixing the deprecated class. The functionality is still tested with vtkCompositePolyDataMapper in Rendering/Core. Merge-request: vtk/vtk!10271 (cherry picked from commit Kitware/VTK@cc2498c)
Merge-request: vtk/vtk!10343 (cherry picked from commit Kitware/VTK@0d1d852)
Merge-request: vtk/vtk!10343 (cherry picked from commit Kitware/VTK@28ecc8b)
Merge-request: vtk/vtk!10343 (cherry picked from commit Kitware/VTK@f58faae)
Merge-request: vtk/vtk!10311 (cherry picked from commit Kitware/VTK@4b14422)
Merge-request: vtk/vtk!10341 (cherry picked from commit Kitware/VTK@7676b6a)
Merge-request: vtk/vtk!10341 (cherry picked from commit Kitware/VTK@b61cc84)
Fixes issue https://gitlab.kitware.com/vtk/vtk/-/issues/18503. Merge-request: vtk/vtk!10391 (cherry picked from commit Kitware/VTK@cff3d9a)
Render surface with edges uses a geometry shader to draw a triangle strip at the edges of polygons. Apart from calculating the edge equation, it was offsetting the vertex positions to accommodate wide lines. However, this would lead to overlapping inner edges. This change removes this offset. Merge-request: vtk/vtk!10403 (cherry picked from commit Kitware/VTK@2fe546c)
Merge-request: vtk/vtk!10435 (cherry picked from commit Kitware/VTK@3755243)
Supports using multivolume with IndependentComponentOff. As in the single-input volume approach, the first three components are used directly as RGB colors without being mapped through the color transfer function. Merge-request: vtk/vtk!10477 (cherry picked from commit Kitware/VTK@bf461af)
Merge-request: vtk/vtk!10477 (cherry picked from commit Kitware/VTK@97ba1fb)
Add changelog. Merge-request: vtk/vtk!10477 (cherry picked from commit Kitware/VTK@9db07b4)
…unction Merge-request: vtk/vtk!10477 (cherry picked from commit Kitware/VTK@129c55c)
Merge-request: vtk/vtk!10541 (cherry picked from commit Kitware/VTK@6dc5382)
…entTranslucentPass. Merge-request: vtk/vtk!10603 (cherry picked from commit Kitware/VTK@fb22318)
Merge-request: vtk/vtk!10636 (cherry picked from commit Kitware/VTK@9d6f627)
Merge-request: vtk/vtk!10636 (cherry picked from commit Kitware/VTK@6ed84ca)
Merge-request: vtk/vtk!10636 (cherry picked from commit Kitware/VTK@9162959)
…o report errors Merge-request: vtk/vtk!10646 (cherry picked from commit Kitware/VTK@3bd2e83)
Enable overriding the default depth mask value for volumes. Read the value of the existing DepthMaskOverride property key to alter the value of the depth mask if needed. Merge-request: vtk/vtk!10642 (cherry picked from commit Kitware/VTK@1995c65)
…cement Add a tag for shader replacement in computeLighting. This can be used to store variable as global variables when using shader replacement. Merge-request: vtk/vtk!10645 (cherry picked from commit Kitware/VTK@2e94e80)
Merge-request: vtk/vtk!10705 (cherry picked from commit Kitware/VTK@d43ab15)
…ture Merge-request: vtk/vtk!10644 (cherry picked from commit Kitware/VTK@0f2025f)
…ys efficiently Expose virtual functions called for each prop in the PreRender and PostRender functions of vtkOpenGLRenderPass. This allows for accessing information keys without having to iterate again over the array of filtered props. Merge-request: vtk/vtk!10725 (cherry picked from commit Kitware/VTK@44e8f26)
…ntime dynamically The default OpenXRManagerConnection ensure that XR_RUNTIME_JSON environment variable is unset in Initialize. This enable multiple version queries or OpenXR render windows to use different OpenXR runtimes. Merge-request: vtk/vtk!10543 (cherry picked from commit Kitware/VTK@d32293b)
This doesn't need a full vtkOpenXRManager initialization, this function instantiates an independent xrInstance to query the version. Merge-request: vtk/vtk!10543 (cherry picked from commit Kitware/VTK@b46651d)
To support scenario where OpenXRRemoting library and companion files provided by the "microsoft.holographic.remoting.openxr" package are not distributed along side the application executable, this commit updates the heuristic looking up for "RemotingXR.json" to first consider the vtkRenderingOpenXRRemoting library directory. Merge-request: vtk/vtk!10449 (cherry picked from commit Kitware/VTK@7c0474c)
Merge-request: vtk/vtk!10550 (cherry picked from commit Kitware/VTK@b22f520)
Fix ForEachNonWidgetProp Merge-request: vtk/vtk!10555 (cherry picked from commit Kitware/VTK@2904bb8)
It is included by `vtkVRRenderWindow.h`. Merge-request: vtk/vtk!10621 (cherry picked from commit Kitware/VTK@d79eba4)
Merge-request: vtk/vtk!10735 (cherry picked from commit Kitware/VTK@dd2a56a)
Merge-request: vtk/vtk!10735 (cherry picked from commit Kitware/VTK@d1699eb)
This enables interactor styles to override controller pose, in events such as PositionProp or Move3D events, but still getting access to the up to date value in said events. Merge-request: vtk/vtk!10742 (cherry picked from commit Kitware/VTK@a155740)
Merge-request: vtk/vtk!10307 (cherry picked from commit Kitware/VTK@28e580e)
This new option is off by default, but when turned on, renders the scalar bar title vertically rather than horizontally. Merge-request: vtk/vtk!10306 (cherry picked from commit Kitware/VTK@fa6552e)
…nd left trigger with triggeraction This is required to support using the trigger button for complex gesture. See vtkVirtualRealityViewInteractor::SetGestureButtonToTrigger() Co-authored-by: Lucas Gandel <lucas.gandel@kitware.com>
|
After running a bisect, I ended up identifying the faulty commit as being d8cacb2 introduced in upstream as Kitware@cff3d9a through MR-10391 and intended to fix VTK issue 18503. |
|
Great detective work @jcfr. Make sure the VTK team is aware of the issue - they would probably want to revert the commit or do further investigation (and for this the test that you created for the bisect could be very useful). |
The process was manual. Enabling the volume rendering of This is likely explained by how we make sure of |
|
@lassoan As the original contributor of One potential approach is to consider adding a boolean parameter to the existing Footnotes |
|
I've posted to the VTK merge request here: https://gitlab.kitware.com/vtk/vtk/-/merge_requests/10391#note_1459483 |
Approved. Reviewing 55 commits in detail would be very time consuming, so I only had a quick look at the commit headlines. I was just wondering why do we manage so many backported changes. Could we use a more recent VTK release and have maybe just a couple of Slicer-specific patches? |
Considering the end of the year & the fact I have to integrate some of the recent Rendering changes along with the one related to OpenXR & OpenXRRemoting, it was easier to select the few commits specific to rendering and VR/XR. In a nutshell, I preferred to only introduce selected "critical" changes and avoid to deal with side effects of VTK build-system updates and alike (yet).
This will be done earlier next year. To clarify, the only Slicer specific changes are these ones and beside of 2e91328 introduced few days ago and specific to
.. from which these one have already been integrated upstream through MR-10400:
and this one was just to avoid a false positive:
|
Agreed. And, as you mentioned, having a quick look is the way to go. To put things in perspective, when I update VTK or ITK, I also go through the list of changes introduced between version doing a cursory review. As you noted, looking at each one of them in details would not be feasible. This set of backported changes is not much different from a regular version update. The advantage in this case is that it allowed to fairly efficiently identify a regression through |
|
All sounds good, thank you. |

Testing
overload/ Windowscomputron/ macOSmetroplex/ Linux(*) A performance regression was identified while exercising the volume rendering module. Running
git bisect(see #46 (comment)) helped identify Kitware@cff3d9a60 (vtkRenderer: Fix prop picking in GetZ method) as the culprit.List of changes related to Rendering & VR
Slicer specific
[SlicerVirtualReality] ENH: Update OpenVR json binding to map right and left trigger with triggeractionBackports
Features
Add ForceVerticalTitle option to vtkScalarBarActor(MR-10306)Add ForceVerticalTitle option to vtkScalarBarActor(Kitware/VTK@fa6552e)vtkOpenGLPolyDataMapper: add line opacity control(MR-10307)vtkOpenGLPolyDataMapper: add line opacity control(Kitware/VTK@28e580e)VR/OpenVR/OpenXR
XR: Move device pose update in interactor(MR-10742)XR: Move device pose update in interactor(Kitware/VTK@a155740)Overrideable vr interactionsMR-10735VR: Add VTKIS_USCALE support in VR interactor style(Kitware/VTK@d1699eb)VR: enable interaction methods to be overrideable(Kitware/VTK@dd2a56a)vtkModule: use FILE_SETs for header files(MR-10555)Rendering/VR: makeglewa public dependency(Kitware/VTK@d79eba4)Add volume clipping to vtkVRInteractorStyle(MR-10555)Add volume clipping to vtkVRInteractorStyle(Kitware/VTK@2904bb8)OpenXR: Add missing EndInitialize in QueryInstanceVersion(MR-10550)OpenXR: Add missing EndInitialize in QueryInstanceVersion(Kitware/VTK@b22f520)OpenXRRemoting: Streamline integration as plugin(MR-10449)OpenXRRemoting: Streamline integration as plugin(Kitware/VTK@7c0474c)XR: Improve OpenXR instance management(MR-10543)Add a utility function to query OpenXR instance version(Kitware/VTK@b46651d)Enable switching from remoting XR runtime to default XR runtime dynamically(Kitware/VTK@d32293b)[Backport MR-10449] OpenXRRemoting: Streamline integration as plugin(abbbb1b)OpenXR: Generalize XrCheck and downgrade action suggestion to a debug output(MR-10450)OpenXRRemoting: Using XrCheckOutput(Kitware/VTK@8eee120)[Backport MR-10450] OpenXR: Improve XrCheckOutput API fixing constness of level parameter(259459f)[Backport MR-10450] OpenXRRemoting: Fix windows build using XrCheckOutput instead of XrCheckError(5c31352)Move teleportation to interaction modes(MR-10546)Move teleportation to interaction modes(Kitware/VTK@8e8b0fe)Add teleportation to VR(MR-10509)Add teleportation to VR(Kitware/VTK@179d044)VR Renderer: Add cross markers at tip of controllers(MR-10478)VR Renderer: Add cross markers at tip of controllers(Kitware/VTK@9014167)OpenXR: Support depth buffer composition layer(MR-10596)OpenXR: Support depth buffer composition layer(Kitware/VTK@ac4a96d)vtkWin32OpenGLDXRenderWindow: Fix missing include(MR-10730)vtkWin32OpenGLDXRenderWindow: Fix missing include(Kitware/VTK@82af107)Split vtkWin32OpenGLDXRenderWindow initialization(MR-10484)Split vtkWin32OpenGLDXRenderWindow initialization(Kitware/VTK@50c861b)Rendering
SSAO for volumes(MR-10725)Test SSAO pass with GPU raycast volume mapper(Kitware/VTK@1b49690)Expose volume opacity threshold in SSAO pass(Kitware/VTK@eb55fc7)Support SSAO for volumes(Kitware/VTK@8773b02)Allow vtkOpenGLRenderPass subclasses to add information keys efficiently(Kitware/VTK@44e8f26)Allow to specify other formats for the ssao pass depth texture(MR-10644)Allow to specify other formats for the ssao pass depth texture(Kitware/VTK@0f2025f)Fix normal mapping with edge visibility(MR-10705)Fix normal mapping with edge visibility(Kitware/VTK@d43ab15)Add VTK::ComputeLighting::Exit tag for volume shader replacement(MR-10645)Add VTK::ComputeLighting::Exit tag for volume shader replacement(Kitware/VTK@2e94e80)Allow volumes to write to the depth buffer(MR-10642)Allow volumes to write to the depth buffer(Kitware/VTK@1995c65)Optimize out unncessary OpenGL state queries(MR-10646)OpenGL: Optimize out unnecessary query for buffer size(Kitware/VTK@d75b9ab60ad)ReadPixels: Check for errors only when VTK is configured to report errors(Kitware/VTK@3bd2e8384cf)Point gaussian improvements(MR-10636)Rename scale option and scale in the shader(Kitware/VTK@9162959)Use quad instead of triangle to bound the gaussian splat(Kitware/VTK@6ed84ca)Use index array for point gaussians(Kitware/VTK@9d6f627)RenderingOpenGL2: Fixed final blending of vtkOrderIndependentTranslucentPass.(MR-10603)RenderingOpenGL2: Fixed final blending of vtkOrderIndependentTranslucentPass.(Kitware/VTK@fb22318)Glyph3DMapper: Fix display attribute inheritance logic(MR-10541)Glyph3DMapper: Fix display attribute inheritance logic(Kitware/VTK@6dc5382)vtkOpenGLES30PolyDataMapper: Remove override for ReplaceShaderCoincidentOffset(MR-10521)vtkOpenGLES30PolyDataMapper: Remove override for ReplaceShaderCoincidentOffset(Kitware/VTK@cc0de41)Support 4-component RGBA inputs for multivolume(MR-10477)Test vtkMultiVolume with RGBA input and gradient opacity function(Kitware/VTK@129c55c)Update vtkMultiVolume doc to mention RGBA support(Kitware/VTK@9db07b4)Test multivolume with RGBA inputs(Kitware/VTK@97ba1fb)Support 4-component RGBA inputs for multivolume(Kitware/VTK@bf461af)Dolly3D: Remove incorrect check in Y axis only(MR-10435)Dolly3D: Remove incorrect check in Y axis only(Kitware/VTK@3755243)rendering: Do not offset vertices for drawing polygon edges(MR-10403)rendering: Do not offset vertices for drawing polygon edges(Kitware/VTK@2fe546c)vtkRenderer: Fix prop picking in GetZ method(MR-10391)vtkRenderer: Fix prop picking in GetZ method(Kitware/VTK@cff3d9a)Document FrameBlitMode in vtkOpenGLRenderWindow.(MR-10341)Apply 1 suggestion(s) to 1 file(s)(Kitware/VTK@b61cc84)Document FrameBlitMode in vtkOpenGLRenderWindow.(Kitware/VTK@7676b6a)Add missing SIZE_HINT on vtkImageActor::GetDisplayBounds(MR-10311)Add missing SIZE_HINT on vtkImageActor::GetDisplayBounds(Kitware/VTK@4b14422)Fix abi namespace(MR-10269)ABI: fix vtkOpenGLBatchedPolyDataMapper(Kitware/VTK@f58faae)ABI: fix vtkCompositeSurfaceLICMapper(Kitware/VTK@28ecc8b)ABI: fix vtkFieldDataToDataSetAttribute(Kitware/VTK@f0e61af)ABI: fix vtkValueFromString(Kitware/VTK@0d1d852)Support any texture with interpolate scalars(MR-10271)Remove the TestBlockOpacity test(Kitware/VTK@cc2498c)Support both texture and interpolated scalars in composite polydata mapper(Kitware/VTK@00a170c)Support both texture and interpolated scalars in GLES polydata mapper(Kitware/VTK@9925fd1)Add tests for texture coloring with interpolated scalars(Kitware/VTK@3db581f)Support any texture with interpolate scalars(Kitware/VTK@7996928)SurfaceWithEdges: Fix mixed geometry rendering(MR-10269)SurfaceWithEdges: Fix mixed geometry rendering(Kitware/VTK@13e28a9)