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] Opacity texture depends on sample distance but is not updated #3134

Open
bruyeret opened this issue Oct 1, 2024 · 0 comments
Open
Labels
type: bug 🐞 Errors in functionality

Comments

@bruyeret
Copy link
Contributor

bruyeret commented Oct 1, 2024

Bug description

In Sources\Rendering\OpenGL\VolumeMapper\index.js, the opacity texture is created by the function buildBufferObjects.
This function is only called when getNeedToRebuildBufferObjects returns true.
But opacity texture values depend on publicAPI.getCurrentSampleDistance but the change of sample distance is not taken into account in getNeedToRebuildBufferObjects.

Steps to reproduce

  • Create a simple scene with a volume, don't use high level objects like proxies and vtkVolumeController, as they can change the sample distance
  • Set the sample distance and make the very first render of the mapper
  • Set the sample distance to something different and rerender

Detailed Behavior

The opacity texture is rebuilt.

Expected Behavior

The opacity texture should be rebuilt.
This can be fixed by rebuilding the opacity texture when sample distance changes, but it doesn't look like a good idea.
A better solution would be to make the opacity texture independant of sample distance and use the sample distance in the volume mapper fragment shader instead. It could be less performant though.

Environment

  • vtk.js version: master
  • Browsers: Chrome
  • OS: Windows
@bruyeret bruyeret added the type: bug 🐞 Errors in functionality label Oct 1, 2024
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

1 participant