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

Feature - adaptive downsampling of volume rendering based on framerate #591

Merged

Conversation

seankmartin
Copy link
Contributor

@seankmartin seankmartin commented May 21, 2024

The overall idea is that a setting (currently on by default) would allow a global downsampling in XY resolution for 3D panels of transparent layers during camera movement if the framerate drops below a certain threshold.

All of this is open to change, but currently:

Target FPS is 60
The mean framerate over a running 6 frames after a camera move is initiated is calculated
If this median framerate drops below 60, a downsampling rate of 2, 4, or 8 is chosen based on how far from 60 the framerate is.
If a downsample is detected, then during this camera movement, the downsampling rate will never go back above the highest downsample rate detected for about the last second
When the camera stops moving, a fresh full resolution drawing is requested after 300ms

To update:

  1. Only DS for VR, new buffer
  2. Make timing easy to change so that GL query can slot in as needs be
  3. More global setting for camera in constant movement. Discrete movements won't trigger DS

this is a bit agressive, but smooths the jutters that occur otherwise
might revisit for cleaner strategy
@seankmartin seankmartin changed the title Adaptive downsampling of transparent layers based on framerate Feature - adaptive downsampling of transparent layers based on framerate Jun 20, 2024
@seankmartin seankmartin changed the title Feature - adaptive downsampling of transparent layers based on framerate Feature - adaptive downsampling of volume rendering based on framerate Jun 20, 2024
@@ -295,6 +295,7 @@ class TrackableViewerState extends CompoundTrackable {
this.add("layers", viewer.layerSpecification);
this.add("showAxisLines", viewer.showAxisLines);
this.add("wireFrame", viewer.wireFrame);
this.add("enableAdaptiveDownsampling", viewer.enableAdaptiveDownsampling);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Add corresponding option to Python viewer_state.py

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @jbms ! I added it in 60ca39c

It looks like the wireframe setting was also missing, so I added it too. But let me know if that's not right c9ef6d9

@seankmartin seankmartin marked this pull request as ready for review July 1, 2024 17:19
src/perspective_view/panel.ts Outdated Show resolved Hide resolved
@jbms jbms merged commit c9081c0 into google:master Jul 3, 2024
8 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants