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)
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.
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
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: ''
});
"
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)
"
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
});
});
};
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.
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}
⌠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?
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.