Hello…
I am trying to manually set the BOTH the dds and textures from AN ALREADY LOADED ASSET
let environ:any = this.app.assets.find(basename + "_env");
let textures:any = [
this.app.assets.find(basename + "_posx"),
this.app.assets.find(basename + "_negx"),
this.app.assets.find(basename + "_posy"),
this.app.assets.find(basename + "_negy"),
this.app.assets.find(basename + "_posz"),
this.app.assets.find(basename + "_negz")
];
let cubemap:pc.Texture = new pc.Texture(this.app.graphicsDevice, options);
cubemap.setSource(textures.map(function(texture) {
return texture.resource.getSource();
}));
As you can see i am loadin the textures but i dont know HOW to set the the actual dds.
I see tons of code that use a json option to specify the dds and textures like this:
var cubemapAsset = new pc.Asset('helipad', 'cubemap', {
url: "./assets/cubemap/6079289/Helipad.dds"
}, {
"textures": [
"./assets/cubemap/6079292/Helipad_posx.png",
"./assets/cubemap/6079290/Helipad_negx.png",
"./assets/cubemap/6079293/Helipad_posy.png",
"./assets/cubemap/6079298/Helipad_negy.png",
"./assets/cubemap/6079294/Helipad_posz.png",
"./assets/cubemap/6079300/Helipad_negz.png"
],
});
But in my case i already have the textures and cubemap downloaded and in the app.assets collection. So i get them using the app.assets.find
But aagain i can tell how to actually set the DDS on the cubemap texture manually using some kind of setSource method like i am doing for the textures…
Any Help… Please