Repository navigation
Conversation
…ltered The volume, reslice and CPR mappers set the scalar texture filter only at render time, so the norm16 linear filtering guard never applied. Also make preferSizeOverAccuracy override norm16 as documented. Kitware#3706
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The volume, reslice and CPR mappers set the scalar texture filter only at render time, so the norm16 linear filtering guard never applied. Also make preferSizeOverAccuracy override norm16 as documented.
#3706
Context
Fixes #3706
On browsers that expose EXT_texture_norm16 but cannot linearly filter norm16 textures (e.g. Firefox on Windows), vtkVolumeMapper, vtkImageResliceMapper and vtkImageCPRMapper render nothing for Int16/Uint16 scalars with linear interpolation. supportsNorm16Linear() correctly returns false there, but the guard added for #3194 only applies when the texture filter is already LINEAR when the format is chosen. These mappers create the scalar texture with the default NEAREST filter and switch to LINEAR afterwards, so the texture is uploaded as norm16 and samples as 0. The texture is also cached per scalars array, so it is never rebuilt when the interpolation changes.
Separately, preferSizeOverAccuracy is documented to override norm16, but on WebGL2 it had no effect when norm16 was available.
Results
Before: on an affected browser, Int16 data with linear interpolation renders nothing (scalar texture R16_SNORM), and preferSizeOverAccuracy keeps norm16.
After: the scalar texture falls back to R32F (or half float when exact), the volume, reslice and CPR render correctly with both linear and nearest interpolation, and preferSizeOverAccuracy uses half float instead of norm16.
Browsers where norm16 linear filtering works (Chrome, Edge) are unchanged.
Changes
No API added, removed or changed.
PR Checklist