-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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 fails to render some scenes loaded using loader.parse(...) #14281
Comments
loader.parse(...)
My quick guess, because of no Any error logs? |
The example doesn't appear to use any textures, though. 🤔 @ikeough just to confirm the parse function's |
onLoad is called, and onError is not. I get a valid scene in the object passed into onLoad. I’ll share a runnable sample shortly.
… On Jun 13, 2018, at 2:51 AM, Don McCurdy ***@***.***> wrote:
The example doesn't appear to use any textures, though. 🤔
@ikeough just to confirm the parse function's onLoad callback is being called, and onError is not? Are you able to share runnable node.js rendering code?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@donmccurdy, here's an example project: example.zip. After unzipping, install packages:
Then run the "app":
You will find a blank If instead you run:
You will find a |
Also, @takahirox thanks for the suggestion. But alas, no :( There are no textures. Also, I would expect that |
Confirmed and reproduced the same issue here. Yeah, realized no textures in I converted
|
|
It occurs to me that I might be writing the index buffers as int32, not uint32. They have the same byte size, but in C#, the last bit is used in int32 to indicate the sign. Perhaps this is screwing something up. The act of converting the int32 bytes to an uint16 could create weirdness. Not sure how rewriting the index array could “fix” this. I’ll test this hypothesis tonight. |
@takahirox You rock! That tip lead me in the right direction. There were two things different about the C# code. Index arrays contained My original setup was just plain wrong. Your fix works because it widens the type to accommodate the original size of the data. However, I'm happy to close this if the discrepancy between these two methods is by design. |
It is the same code, excluding the entrypoint, so I'm not sure why we're getting different results here... does using |
If you do not want to depend on the |
Maybe that's the reason! Logs.
I'm thinking if adding note about it to glTF spec would be helpful... |
The spec already has a note about that, although it is a bit vague:
|
Oh, right. Thanks |
Apparently the latest headless-gl trunk added support for But headless-gl 4.0.4, the latest version from npm, does not include this fix yet. |
Thanks @vyv03354 and @takahirox. I should have reviewed the warnings on headless gl startup more carefully. As this is not a three issue, I’m closing. |
I have thumbnail server which uses
GLTFLoader
to load.glb
data fromBuffer
. The server is a node app using headless gl and three-png-stream.Previously, I'd written a python glTF exporter which generates glbs which load and render successfully on the server. Lately, I've been experimenting with glTF files that are generated using the glTF C# loader(@bghgary). I've attached one file generated with the C# loader, box.glb.zip, to help diagnose. In each of the following cases, files written using my python exporter load correctly both in the glTF viewer and on the server. The following applies only to models generated using the C# loader.
Files generated using the C# loader visualize perfectly using @donmccurdy's glTF viewer, but when loading on the server, nothing renders. In an effort to debug, I set the material for all meshes contained in the glb scene to draw to wireframe, and I see a wireframe in my scene where I would expect it. Perhaps there is an issue with
loader.parse(...)
reading materials. I've experimented with including both theKHR_materials_pbrSpecularGlossiness
extension andpbrMetallicRoughness
, and inlcuding onlypbrMetallicRoughness
, to no avail.This is for an architectural application with Z up, so I have tried both setting the
Matrix
and theRotation
of the root node. Again, everything visualizes fine in the glTF viewer with the scene being properly transformed. And, models which have theirMatrix
set to make Z up, generated by the python exporter, work fine usingloader.parse(...)
Perhaps there is a winding issue that is caused by setting aMatrix
orRotation
which is causing facets not to render correctly.I've compared the simplest case, a unit box, exported with the python generator and one generated with the C# generator. The only difference that I can see (when diagnosing by saving to .gltf and inspecting the files manually) is that the C# generator does not serialize default values. Perhaps there is an issue using
loader.parse(...)
with a.glb
which omits default values? For example, the C# loader does not serializemode:4
(TRIANGLES
) for primitives, perhaps because this is a default?This behavior is exhibited when I run the server remotely and locally, so I don't believe it has to do with the environment.
I did see #14256, which may apply as the server is running node, and I'm doing the rendering in the
onLoad
callback. But again, this works with models generated from my python exporter.Three.js version
Browser
OS
Hardware Requirements (graphics card, VR Device, ...)
The text was updated successfully, but these errors were encountered: