[SOLVED] glTF vs USDZ ... any buzz?

I am wondering if there has been any buzz in relation to USDZ format usage in PC?

The path is quite classic for me (I guess), as I had been using some time on learning about glTF usage in here and across the sector. The ladder reveals that Apple does not support glTF - so what is the story in relation to USDZ (the bigger format support strategy) in case anybody knows?
(I am not able to google-search any related stories)

This doesn’t stop people using it for browser apps :slight_smile:

ok, but in such case I would make a browser/OS detection and make an info-alert to those users.
But main case here is more if there are some issues in regards to not-implementing USDZ?
(do you know if some of the PC-devs are indifferent to Apple and/or; is it hard to code? … the code might be quite closed-source etc)

Not sure why you would need to do this? Users can run browser apps on iOS with GLTF/GLB assets in it because the engine is doing the parsing and rendering, not the browser itself.

The USDZ support (so far) is more to do with iOS’ native ARKit viewer in Safari AFAIK.

1 Like

We are back at me trying to load glTF externally: [SOLVED] Trouble accessing children in a glTF-imported file (load externally)

My approach makes sense, but I am an entrepreneur that keeps my cards secret … within this topic, I am quite indifferent for a more useful answer … I know how the Apple org works etc.

-> In case you insist to know the exact reason: [This is a very public setting; Meaning that I maybe can tell you my grand scheme over another channel (not in here, as everyone would know)] … There is indeed a very good reason for the external-load pursuit, but I preserve that for a business plan/Shark Tank-like setting.

Well enough of the ‘BOND-villain with a white cat on the lap’ chat … thx for the answer in any case :slight_smile:

To add some more information to this: The engine currently supports GLB loading and we are currently in the process of adding FBX to GLB conversion in the Editor and deprecating the JSON model format.

This means that you should be able to externally load GLBs without the code from the PlayCanvas GLTF repo.

I doubt that would support USDZ unless there is a large demand for it and it doesn’t look like it has been the case so far.

With GLTF being effectively the standard for 3D scenes on the web, I’m not sure that will change.

Why is USDZ support need in your case? Do you really need native Apple support for AR?

being able to load 3d content cross app (being not ‘in-export’ alone), raises “2nd-life user’s 3d-object” potential … but currently not user-friendly (as !100% cross-platform)

Anyways; if I want to test PC in regards to .glB-load instead of .glTF-load I am trying this:

var asset = new pc.Asset('gltf', 'model', {
                url: ''
            });
  • but that fails (even) at Win/Chrome?

[wait … syntax on path … incorrect]

No, still not:

receive this err msg in console:

"
playcanvas-stable.min.js:1745 SyntaxError: Unexpected token o in JSON at position 1
    at JSON.parse (<anonymous>)
    at __game-scripts.js:1
    at d.g (playcanvas-stable.min.js:1901)
    at d.fire (playcanvas-stable.min.js:33)
    at Array.<anonymous> (playcanvas-stable.min.js:1899)
    at e._onSuccess (playcanvas-stable.min.js:1745)
    at playcanvas-stable.min.js:1744
    at Object.callback (playcanvas-stable.min.js:1765)
    at e._onSuccess (playcanvas-stable.min.js:1023)
    at e._onReadyStateChange (playcanvas-stable.min.js:1022)
"

->> So by that you imply; that I don’t need the glTF-syntax?:

var asset = new pc.Asset('gltf', 'model', {
                url: ''
            });

Raises another question - what to put instead?

Example: https://playcanvas.com/editor/scene/849686

var LoadGlbExternal = pc.createScript('loadGlbExternal');
LoadGlbExternal.attributes.add('url', {type: 'string'});

// initialize code called once per entity
LoadGlbExternal.prototype.initialize = function() {
    var app = this.app;
    var self = this;

    app.assets.loadFromUrl(self.url, 'model', function (err, asset) {
        // Add the loaded scene to the hierarchy
        self.entity.addComponent('model', {
            asset: asset
        });
    });
};

Asset setup: https://github.com/yaustar/3dmodel-Playcanvas/tree/master/gltf/police

This isn’t quite what you are looking for as it sounds like you would like all the materials and textures to be inside the GLB :thinking:

Ah, here is a new example of using GLB as a container: https://playcanvas.com/editor/scene/922242

var LoadGlbExternalContainer = pc.createScript('loadGlbExternalContainer');
LoadGlbExternalContainer.attributes.add('url', {type: 'string'});

// initialize code called once per entity
LoadGlbExternalContainer.prototype.initialize = function() {
    var app = this.app;
    var self = this;

    app.assets.loadFromUrlAndFilename(self.url, null, "container", function (err, asset) {
        // Add the loaded scene to the hierarchy
        self.entity.addComponent('model', {
            asset: asset.resource.model
        });
    });
};

I really recommend digging into the engine code as it sounds like you will be using PlayCanvas in a big way.

For GLB container loading, have a look through the GLB viewer tool: https://github.com/playcanvas/engine/tree/master/tools/viewer

thx - (tmp post) ->> can you make that asset setup link a ‘https://raw…’-path? (CORS on 'https://github.com … ')

If you are talking about the loadGlbExternal script, the engine assumes that both the glb and the mapping are in the same folder and have the same prefix filename. If you look inside the example, it is using a raw path.

The loadGlbExternalContainer script uses the glb as a complete container with all the materials, etc in ti.

Ok, got the path working again … Back to the glB-track: tried it as external link on an iPhone 6. Failed both on Safari and Chrome.

Final remark: PC is not to blame {the glorious Wall Street approach with the fingers in the Apple soup ==> closed sources and the usual headache for developers}

Users can choose and join “Club WinDroid” :smiley:


The glB-loader worked - so setting this solved

Wait, are you saying that the examples I posted don’t work on Apple iOS Safari?

… the GlbExternal example works on my Samsung s6, and s7 + several of my Win10-platforms.
Not on a iPhone 6, Safari (neither Chrome). Does it work on newer Apple products?

Did not test the latest LoadGlbExternalContainer example on my Mac Mini QC i5 1.4GHZ.

Thanks for letting us know. I want to take a look into this when I next get a chance as I would have that it should work on iPhone 6.

1 Like

We have just tried in on a newer iPhone and both GLB examples loaded correctly. Wonder if there is a specific issue with iPhone6

iPhone 6 has only 1GB of RAM, and iOS is quite strict with browser tabs that don’t fit its current memory allocation strategy.

Meaning if you have a handful of apps open at that instant there isn’t much left for WebGL models/textures. If that’s the case, try killing all the active apps before loading the GLB scene.

1 Like