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

[Bug] Handling of clamped arrays? #3030

Open
abustany opened this issue Mar 12, 2024 · 2 comments
Open

[Bug] Handling of clamped arrays? #3030

abustany opened this issue Mar 12, 2024 · 2 comments
Labels
type: bug 🐞 Errors in functionality

Comments

@abustany
Copy link

Bug description

When creating data arrays from Uint8ClampedArray, VTK infers the texture type to be a float texture, not a UCHAR. This is (I suppose) because VtkDataTypes.UNSIGNED_CHAR is "Uint8Array", so the data type does not get properly detected when creating the texture.

Steps to reproduce

  1. Create a DataArray from a Uint8ClampedArray, with some random pixel data
  2. Display this data on screen (using an ImageMapper etc etc)

Detailed Behavior

getDefaultTextureInternalFormat in Rendering/OpenGL/RenderWindow.js doesn't match the data type to be uchar, and falls down to the default float case.

Expected Behavior

The OpenGL texture uses the right data type (UCHAR), that does not require the OES_texture_float_linear extension.

Environment

  • vtk.js version: 29.7.0
  • Browsers: Latest firefox+chrome
  • OS: Linux
@abustany abustany added the type: bug 🐞 Errors in functionality label Mar 12, 2024
@finetjul
Copy link
Member

@sedghi @bruyeret @sankhesh

@longuto
Copy link

longuto commented Mar 18, 2024

How to correct this issue? When using volume rendering, it appears on the Android mobile browser.
Dingtalk_20240315164407

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐞 Errors in functionality
Projects
None yet
Development

No branches or pull requests

3 participants