-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
glTF Loader issue - duck is dark #8381
Comments
Try the dev branch. http://threejsworker.com/api/branch/dev/examples/webgl_loader_gltf.html Although, the models in this link do not render for me using Safari 9.0.3 on OS X 10.11.3. |
It seems to work fine here... Fedora 23 (Wayland) + Chrome 49 + Intel Iris Graphics 540 /ping @tparisi |
yeah I'm not seeing that |
Ah yeah, we fixed these issues in the past in the built-in shaders. @tparisi welcome to the lovely world of gpu discrepancies support 😉 |
Hello everyone. I have the same problem with him example ( http://jsdo.it/cx20/GLug ). My environment is Windows10, Chrome 49.0.2623.87 m, Quadro K2000D. But, I'm not seeing this problem using MacBook Pro (Retina, 15-inch, Mid 2015, Radeon R9 M370X). mysterious... anyway, I guess this problem happens in Windows. |
@pjcozzi looks like we some issues w the GLSL being generated by the converter |
@tparisi can you try putting this workaround in JavaScript for the @cx20 can you try to drag and drop the duck model (original COLLADA and textures or glTF with embedded resources) into the Cesium viewer so we can isolate if this is the shaders: http://cesiumjs.org/convertmodel.html? |
@pjcozzi will do |
Yes. I expect |
#8429 should fix this. |
I tried fixed glTFLoader.js. But, I failed. However, after changing following undefined to 1.0 with a debugger, it was colored.. |
@mrdoob how to proceed? I guess I can scare up a Windows box to test this on... |
Hi. I'd like to add additional infomation to @cx20's comment. @cx20 and I tried latest dev:branch (pullrequest #8429 included), but the same problem still happened. @cx20 set breakpoint at glTFLoader.js#L167. Then, u_shininess's value was undefined in all browsers.
Yes. the value is undefined. But... My Windows's firefox: works fine. According to this results, When a uniform value is set to |
I found the cause that shininess became undefined. After making the following modifications, a value came to be set in shininess variable. https://github.com/mrdoob/three.js/blob/dev/examples/js/loaders/gltf/glTFLoader.js#L824
case WebGLRenderingContext.FLOAT :
utype = "f";
uvalue = shaderParam.value;
if (pname == "transparency") {
var USE_A_ONE = true; // for now, hack because file format isn't telling us
var opacity = USE_A_ONE ? value : (1.0 - value);
uvalue = opacity;
params.transparent = true;
} // Case, uvalue except "transparency" are not set pname.
break;
case WebGLRenderingContext.FLOAT_VEC2 :
case WebGLRenderingContext.FLOAT :
utype = "f";
uvalue = shaderParam.value;
if (pname == "transparency") {
var USE_A_ONE = true; // for now, hack because file format isn't telling us
var opacity = USE_A_ONE ? value : (1.0 - value);
uvalue = opacity;
params.transparent = true;
} else if (value) {
uvalue = value;
}
break;
case WebGLRenderingContext.FLOAT_VEC2 : WebGL Inspector |
- Replace .set(...) with .fromArray(...) where possible for THREE.js Math objects (thanks @mrdoob) - Include fix for mrdoob#8381 (thanks @cx20) - Move THREE.GLTFShaders to THREE.GLTFLoader.Shaders - Move THREE.GLTFAnimator to THREE.GLTFLoader.Animations - Rename .setBaseUrl(...) to .setPath(...) - Update demo page 'examples/webgl_loader_gltf_new.html' with renamed APIs
* Initial GLTFLoader updates so it will also obtain async resources over the network * First take at adding shader support to new GLTFLoader * First working custom shaders version of GLTFLoader.js * Fully working custom GLTF shaders + general library fix-ups * Add skins, animations, lights, extensions and continue to refactor the library * Refactor new GLTFLoader (seperate glTF parsing and internal library building) * Fix GLSL shader update binding to point at the correct nodes + more general refactoring * Make _each thenable and refactor dependencies graph + other minor fixes * Improves spec compliance: primitive.mode is optional * Update GLTFLoader v2 with feedback on PR: mrdoob#9786 - Replace .set(...) with .fromArray(...) where possible for THREE.js Math objects (thanks @mrdoob) - Include fix for mrdoob#8381 (thanks @cx20) - Move THREE.GLTFShaders to THREE.GLTFLoader.Shaders - Move THREE.GLTFAnimator to THREE.GLTFLoader.Animations - Rename .setBaseUrl(...) to .setPath(...) - Update demo page 'examples/webgl_loader_gltf_new.html' with renamed APIs * Replace 'examples/webgl_loader_gltf.html' with new version of GLTFLoader * Update documentation at /docs/?q=gltf#Reference/Loaders/GLTFLoader to reference new GLTFLoader * Move /examples/js/loaders/gltf/* to /examples/js/loaders/deprecated/gltf/* * Actually add a fix for mrdoob#8381 * Re-fix mrdoob#8381 in a more logical way * Update material parameter checking and validation. * Fix issue whereby the spec says doubleSided and transparent should be in the 'values' section but every use of these params I've seen in the wild has been outside this section * Ambient is not a valid properties for THREE.js materials * THREE textures have flipY set to true by default. By setting to false we can remove double flip from GLTFLoader * Fix issue where Firefox Promise then callback can not correctly keep track of its key * Remove debugging from examples/loaders/deprecated/gltf/glTFLoader.js * Refactor waitForDependencies in to _withDependencies. Remove need for global library.* tracking. Other general refactoring
* Initial GLTFLoader updates so it will also obtain async resources over the network * First take at adding shader support to new GLTFLoader * First working custom shaders version of GLTFLoader.js * Fully working custom GLTF shaders + general library fix-ups * Add skins, animations, lights, extensions and continue to refactor the library * Refactor new GLTFLoader (seperate glTF parsing and internal library building) * Fix GLSL shader update binding to point at the correct nodes + more general refactoring * Make _each thenable and refactor dependencies graph + other minor fixes * Improves spec compliance: primitive.mode is optional * Update GLTFLoader v2 with feedback on PR: mrdoob#9786 - Replace .set(...) with .fromArray(...) where possible for THREE.js Math objects (thanks @mrdoob) - Include fix for mrdoob#8381 (thanks @cx20) - Move THREE.GLTFShaders to THREE.GLTFLoader.Shaders - Move THREE.GLTFAnimator to THREE.GLTFLoader.Animations - Rename .setBaseUrl(...) to .setPath(...) - Update demo page 'examples/webgl_loader_gltf_new.html' with renamed APIs * Replace 'examples/webgl_loader_gltf.html' with new version of GLTFLoader * Update documentation at /docs/?q=gltf#Reference/Loaders/GLTFLoader to reference new GLTFLoader * Move /examples/js/loaders/gltf/* to /examples/js/loaders/deprecated/gltf/* * Actually add a fix for mrdoob#8381 * Re-fix mrdoob#8381 in a more logical way * Update material parameter checking and validation. * Fix issue whereby the spec says doubleSided and transparent should be in the 'values' section but every use of these params I've seen in the wild has been outside this section * Ambient is not a valid properties for THREE.js materials * THREE textures have flipY set to true by default. By setting to false we can remove double flip from GLTFLoader * Fix issue where Firefox Promise then callback can not correctly keep track of its key * Remove debugging from examples/loaders/deprecated/gltf/glTFLoader.js * Refactor waitForDependencies in to _withDependencies. Remove need for global library.* tracking. Other general refactoring
Duck is now bright. Thank you everyone. 👍 https://cdn.rawgit.com/mrdoob/three.js/dev/examples/webgl_loader_gltf.html ThinkPad X201 + Intel HD Graphics |
Description of the problem
Result
duck.gltf (http://threejs.org/examples/models/gltf/duck/glTF/duck.gltf) is dark.
...
Three.js version
Browser
OS
Hardware Requirements (graphics card, VR Device, ...)
ThinkPad X201 + Intel HD Graphics
The text was updated successfully, but these errors were encountered: