Hello how find cubmap and use to material
1.creat skybox
I use Will Eastcott method create-skybox.js
app.root.addComponent("script", {
scripts: [
{ url: 'js/hammer.min.js' },
{ url: 'js/create-skybox.js' }
]
})
2. creat material
function createMaterial(d, s, g, n,cubmap) {
var mat = new pc.PhongMaterial();
mat.shadingModel = pc.SPECULAR_BLINN;
mat.diffuse.set(255 / 255, 203 / 255, 57 / 255);
mat.diffuseMap = d;
mat.specularMap = s;
mat.glossMap = g;
mat.normalMap = n;
mat.shininess = 100;
mat.conserveEnergy = true;
mat.cubeMap = cubmap;
mat.reflectivity = 1;
mat.update();
return mat;
}
3.find cubemap
var cubemap = app.assets.find("cubemap");
cubemap.resource;
4. use to cube
var metal = createMaterial(metald, metals, metalg, metaln,cubemap);
cube.model.model.meshInstances[0].material = metal;
At step 3
can not find the cubemap,how get the cubemap and use it to cube material
thanks ++