I downloaded cubemap assets and find there is a json file in a bunch of folders
app.assets.loadFromUrl("res/4658900/Sky.json", "cubemap", function(err, asset){ app.scene.setSkybox(asset.resources); })
not working …… unsurprisingly
but deep into code, I found codes handling cubemap loading in asset-registry
// check for special case for cubemaps
if (asset.file && asset.type === "cubemap") {
load = false;
open = false;
// loading prefiltered cubemap data
var url = asset.file.url;
var separator = url.indexOf('?') !== -1 ? '&' : '?';
url += separator + asset.file.hash;
this._loader.load(url, "texture", function (err, texture) {
if (!err) {
// Fudging an asset so that we can apply texture settings from the cubemap to the DDS texture
self._loader.patch({
resource: texture,
type: "texture",
data: asset.data
}, self);
// store in asset data
asset._dds = texture;
_open();
} else {
self.fire("error", err, asset);
self.fire("error:" + asset.id, err, asset);
asset.fire("error", err, asset);
return;
}
});
}
separator in cubemap name ?
file hash ?
Any one can provide an example how to set skybox by code ?