Skip to content

Commit edd2245

Browse files
committed
Comment to explain checker code.
1 parent c7ef690 commit edd2245

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

source/external/threemodelloader.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ OV.ThreeModelLoader = class
7575
let obj = this;
7676
this.callbacks.onVisualizationStart ();
7777
let params = new OV.ModelToThreeConversionParams ();
78-
// https://github.com/kovacsv/Online3DViewer/issues/69
7978
params.forceMediumpForMaterials = this.hasHighpDriverIssue;
8079
OV.ConvertModelToThreeMeshes (importResult.model, params, {
8180
onTextureLoaded : function () {

source/external/threeutils.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Some mobile devices say that they support mediump, but in reality they don't. At the end
2+
// all materials rendered as black. This hack renders a single plane with red material and
3+
// it checks if it's really red. If it's not, then probably there is a driver issue.
4+
// https://github.com/kovacsv/Online3DViewer/issues/69
15
OV.HasHighpDriverIssue = function ()
26
{
37
let canvas = document.createElement ('canvas');
@@ -43,7 +47,9 @@ OV.HasHighpDriverIssue = function ()
4347
);
4448

4549
document.body.removeChild (canvas);
46-
if (pixels[0] < 50 && pixels[1] < 50 && pixels[2] < 50) {
50+
51+
let blackThreshold = 50;
52+
if (pixels[0] < blackThreshold && pixels[1] < blackThreshold && pixels[2] < blackThreshold) {
4753
return true;
4854
}
4955
return false;

0 commit comments

Comments
 (0)