question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

glTF renders incorrectly, but correct in McCurdy viewer

See original GitHub issue

Can anyone help me debug a glTF file? It looks ok in Don McCurdy’s glTF viewer at https://gltf-viewer.donmccurdy.com/ (though it’s pretty different from how it looks in Blender) but most of its pieces are missing when I use aframe to look at it: https://sgouros.com/scorpii/index1.html.

Two of the meshes are visible, but something has happened to the other dozen meshes. I’m not sure if this is a support question or a complaint about the glTF display feature of aframe, so I’ve posted it here as well as at SO: https://stackoverflow.com/questions/59852899/gltf-file-renders-incorrectly-in-aframe

The model is at https://sgouros.com/scorpii/data/scorpii3.glb, but it looks like this in the McCurdy viewer:

Screen Shot 2020-01-22 at 3 00 45 PM

Displayed like this:

    <a-scene id="mainScene"
             background="color: #666666"
             renderer="antialias: true;
                       colorManagement: false;
                       logarithmicDepthBuffer: true;"
             environment>
      <a-assets timeout="20000">
        <a-asset-item id="uscorpii"
                      src="data/uscorpii2.glb"
                      crossorigin="anonymous">
        </a-asset-item>
   ...
     <a-entity gltf-model="#uscorpii"
                scale="1 1 1"
                position="0 0 -15"
                animation="property: object3D.rotation.y;
                           to: 360; loop: true;
                           easing: linear; dur: 136000">
  
  • A-Frame Version: 1.0.3
  • Platform / Device: Firefox, Chrome
  • Reproducible Code Snippet or URL: See links above

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
donmccurdycommented, Jan 23, 2020

This model requires depthWrite=false on any transparent materials. A quick patch would be:

model.traverse((o) => {
  if (o.isMesh) o.material.depthWrite = !o.material.transparent;
});

I’ve implemented that in my viewer, and proposed a fix for threejs (https://github.com/mrdoob/three.js/pull/18235) but the threejs version has not been merged yet. This could be done in a custom component, in the meantime.

0reactions
dmarcoscommented, Jan 24, 2020

@donmccurdy Thanks for clarifying. Much appreciated as always.

Read more comments on GitHub >

github_iconTop Results From Across the Web

gltf file renders incorrectly in aframe - Stack Overflow
Can anyone help me debug a glTF file? It looks ok in Don McCurdy's glTF viewer at https://gltf-viewer.donmccurdy.com/ (though it's pretty ...
Read more >
glTF rendered with issues on BabylonJS but correct on ThreeJS - Bugs
The following free glTF 3D model is rendered incorrectly in the BabylonJS viewer but correctly in the ThreeJS viewer. Can anyone explain what...
Read more >
Exported gltf looks odd in other programs? - three.js forum
When I export gltfs using the gltf exporter, I notice that the colors don't look quite the same as they were when rendered...
Read more >
GLB file has incorrect materials set - PlayCanvas Forum
I got a GLB file which when I view it in Playcanvas viewer it looks like ... to DM us one of the...
Read more >
Glb file not loading correctly - Bugs - Sketchfab Forum
It seems like the glb files are not processed correctly, yet. ... I loaded the exact same file in other PBR Viewers I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found