Skip to content

Commit

Permalink
Guard against NaNs in shader (#7018)
Browse files Browse the repository at this point in the history
* guard against nan when deciding whether to use performance optimization in shader

* update changelog
  • Loading branch information
philippotto authored Apr 26, 2023
1 parent 29ea776 commit 69ce101
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
### Changed

### Fixed
- Fixed rendering issues on some affected systems that led to "black holes". [#7018](https://github.com/scalableminds/webknossos/pull/7018)

### Removed

Expand Down
5 changes: 4 additions & 1 deletion frontend/javascripts/oxalis/shaders/texture_access.glsl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ export const getColorForCoords: ShaderModule = {
offsetInBucket = mod(coords, bucketWidth);
vec3 offsetInBucketUVW = transDim(offsetInBucket);
if (offsetInBucketUVW.x < 0.01 || offsetInBucketUVW.y < 0.01
|| offsetInBucketUVW.x >= 31. || offsetInBucketUVW.y >= 31.) {
|| offsetInBucketUVW.x >= 31. || offsetInBucketUVW.y >= 31.
|| isNan(offsetInBucketUVW.x) || isNan(offsetInBucketUVW.y)
|| isNan(offsetInBucketUVW.z)
) {
beSafe = true;
}
}
Expand Down

0 comments on commit 69ce101

Please sign in to comment.