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

Fix large scalar values #2915

Merged
merged 3 commits into from
Feb 7, 2024
Merged

Fix large scalar values #2915

merged 3 commits into from
Feb 7, 2024

Conversation

floryst
Copy link
Collaborator

@floryst floryst commented Sep 13, 2023

Context

Large scalar values cannot be accurately represented in half float format. When large scalar values are detected, switch to 32-bit floats.

Additionally enables the OES_texture_float_linear extension for 32-bit texture filtering.

Results

Changes

  • fixes vtkOpenGLImageMapper to support the norm16 ext
  • fixes to vtkOpenGLTexture to enable the texture_float_linear extension
  • fixes to vtkOpenGLRenderWindow to support 32-bit formats

PR and Code Checklist

  • semantic-release commit messages
  • Run npm run reformat to have correctly formatted code

Testing

  • This change adds or fixes unit tests
  • Tested environment:
    • vtk.js: v28.3.3
    • OS: macOS
    • Browser: Chrome 116, Firefox 117

@floryst floryst requested a review from sankhesh September 13, 2023 19:37
@sedghi
Copy link
Contributor

sedghi commented Dec 6, 2023

But will get overwritten to halfFloat if the preferSizeOverAccuracy is set to true, right?

@floryst
Copy link
Collaborator Author

floryst commented Dec 12, 2023

Yes, preferSizeOverAccuracy should prefer halfFloat.

Copy link
Collaborator

@sankhesh sankhesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Scalars that cannot be represented accurately with half-float should be
rendered with a full float format. useHalfFloat tells use whether the
scalars can be accurately represented in half-float.

OES_texture_float_linear is needed to filter 32 bit internal formats.
@floryst floryst force-pushed the fix-large-scalar-values branch from 87eaed7 to 2dca152 Compare February 6, 2024 20:39
floryst and others added 2 commits February 6, 2024 15:43
This keeps the ImageMapper in-line with the VolumeMapper.
@floryst floryst force-pushed the fix-large-scalar-values branch from 2dca152 to ce2b9bf Compare February 6, 2024 20:43
@floryst
Copy link
Collaborator Author

floryst commented Feb 6, 2024

Rebased and updated the tests to use tape rather than tape-catch.

@floryst floryst added this pull request to the merge queue Feb 7, 2024
Merged via the queue into master with commit 76a6271 Feb 7, 2024
3 checks passed
Copy link

github-actions bot commented Feb 7, 2024

🎉 This PR is included in version 29.5.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the released Automated label label Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Automated label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem rendering vtkImageData with large scalar values
3 participants