-
-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All materials render black on some mobile devices #69
Let's detect the wrong devices, and set precision to mediump only if needed.
- Loading branch information
Showing
11 changed files
with
144 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
OV.HasHighpDriverIssue = function () | ||
{ | ||
let canvas = document.createElement ('canvas'); | ||
document.body.appendChild (canvas); | ||
let parameters = { | ||
canvas : canvas, | ||
antialias : true | ||
}; | ||
|
||
let renderer = new THREE.WebGLRenderer (parameters); | ||
renderer.setClearColor ('#ffffff', 1); | ||
renderer.setSize (10, 10); | ||
|
||
let scene = new THREE.Scene (); | ||
|
||
let ambientLight = new THREE.AmbientLight (0x888888); | ||
scene.add (ambientLight); | ||
|
||
let light = new THREE.DirectionalLight (0x888888); | ||
light.position.set (0.0, 0.0, 1.0); | ||
scene.add (light); | ||
|
||
let camera = new THREE.PerspectiveCamera (45.0, 1.0, 0.1, 1000.0); | ||
camera.position.set (0.0, 0.0, 1.0); | ||
camera.up.set (0.0, 1.0, 0.0); | ||
camera.lookAt (new THREE.Vector3 (0.0, 0.0, 0.0)); | ||
scene.add (camera); | ||
|
||
let plane = new THREE.PlaneGeometry (1.0, 1.0); | ||
let mesh = new THREE.Mesh (plane, new THREE.MeshPhongMaterial ({ | ||
color : 0xcc0000 | ||
})); | ||
scene.add (mesh); | ||
renderer.render (scene, camera); | ||
|
||
let context = renderer.getContext (); | ||
let pixels = new Uint8Array (4); | ||
context.readPixels( | ||
5, 5, 1, 1, | ||
context.RGBA, | ||
context.UNSIGNED_BYTE, | ||
pixels | ||
); | ||
|
||
document.body.removeChild (canvas); | ||
if (pixels[0] < 50 && pixels[1] < 50 && pixels[2] < 50) { | ||
return true; | ||
} | ||
return false; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters