Replies: 1 comment 2 replies
-
@elalish - could you point me to the correct way to access the material geometry in modelviewer? i'm running into issues that are likely some combination of the way in which three.js is used and that i don't understand typescript. in ar.ts, here is what i am trying to do, after removing the shadow and right before the USDZ export:
which gives the build error: Property 'geometry' does not exist on type 'Object3D'. i've been trying to figure out the correct type from looking at how three.js is imported, but seem to be flailing a bit:
/Users/mylocalpathto/model-viewer/packages/model-viewer/node_modules/@types/three/index"' has no exported member 'ThreeMaterial' |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
i'm really struggling to maintain the aesthetic of a very simple PBR GTLF material when going from web-viewer to AR. the results are significantly worse than the code we wrote to do this directly in three.js - so i suspect there may be something going on. at the same time, i'm not really sure if this is a bug, so i figured i'd start with a discussion thread rather than create an issue.
here's the summary, in pictures. (you can try for yourself with the link at bottom). the model looks like this in webviewer



looks like a bright lemon yellow on android:
looks brown/dark - even green under certain lighting conditions on iOS:
for clarification, the above three images are all from AR of the same file on model-viewer. for comparison - when we wrote our own three.js exporter using USDZexporter.js, we saw a much more favorable result in USDZ:

(i don't have an android comparison because of the whole sceneviewer blob debacle (a different thread.))
since github won't let me upload .GLB, see here for the file i'm testing with: https://ar-polyspectra-com.pages.dev/your-stl-here-PBR-simple.glb and here for a very simple test site using model-viewer: https://ar-polyspectra-com.pages.dev/
is this color discrepancy considered normal? i understand that we are trying to get lots of different things to play nice together with Apple/Google and WebGL/WebXR/Scene Viewer/Quick Look and that there will be tradeoffs - but for such a simple GLTF 2.0 compliant pbrMetallicRoughness material - i am pretty surprised by the inconsistency.
i do have some breadcrumbs towards a possible solution, but i don't know enough about the guts of model-viewer to say for sure if it is relevant here. when we were getting really crappy-looking USDZ exports from three.js - "Tape" on the three.js discord suggested it was an issue with surface normals, and @donmccurdy suggested the following approach, which completely fixed the problem:
the full workflow looks like:
then later:
Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions