Skip to content

Commit

Permalink
Mitigate rare rendering bug (#7163)
Browse files Browse the repository at this point in the history
* increase plane subdivision to mitigate rare rendering error

* update changelog
  • Loading branch information
philippotto authored Jun 26, 2023
1 parent b27c7c6 commit a7da37a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Redesigned the info tab in the right-hand sidebar to be fit the new branding and design language. [#7110](https://github.com/scalableminds/webknossos/pull/7110)

### Fixed
- Fixed rare rendering bug at viewport edge for anisotropic datasets. [#7163](https://github.com/scalableminds/webknossos/pull/7163)

### Removed

Expand Down
15 changes: 11 additions & 4 deletions frontend/javascripts/oxalis/geometries/plane.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,20 @@ import constants, {
OrthoViewValues,
} from "oxalis/constants";

// A subdivision of 80 means that there will be 80 segments per axis
// and thus 81 vertices per axis (i.e., the vertex shader is executed 81**2).
// A subdivision of 100 means that there will be 100 segments per axis
// and thus 101 vertices per axis (i.e., the vertex shader is executed 101**2).
// In an extreme scenario, these vertices would have a distance to each other
// of 32 voxels. Thus, each square (two triangles) would render one bucket.
// 80**2 == 6400 buckets per plane are currently unrealistic and therefore
// 100**2 == 10,000 buckets per plane are currently unrealistic and therefore
// a valid upper bound.
export const PLANE_SUBDIVISION = 80;
// However, note that in case of anisotropic datasets, the above calculation
// needs to be adapted a bit. For example, consider a dataset with mag 8-8-1.
// The XZ plane could render 100 buckets along the X coordinate (as above), but
// only ~13 buckets along the Z coordinate. This would require 1300 which is not
// unrealistic. PLANE_SUBDIVISION values of 80 showed rare problems which is why
// a value of 100 is now used. If this should become problematic, too, a dynamic
// subdivision would probably be the next step.
export const PLANE_SUBDIVISION = 100;

class Plane {
// This class is supposed to collect all the Geometries that belong to one single plane such as
Expand Down

0 comments on commit a7da37a

Please sign in to comment.