File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ( ) {
Original file line number Diff line number Diff line change 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
15OV . 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 ;
You can’t perform that action at this time.
0 commit comments