Hi,
Im having an issue with updating my materials. its a bit weird because the last time everything worked fine.
var meshes = this.entity.parent.model.meshInstances; // get all materials assigned to the room
for(var i = 0; i < meshes.length; i++) {
var material = meshes[i].material.clone();
material.useSkybox = false; // make sure the material doesn't use the global skybox
console.log(material.name);
material.cubeMap = this.cubeMaps[0];
material.prefilteredCubeMap128 = this.cubeMaps[1];
material.prefilteredCubeMap64 = this.cubeMaps[2];
material.prefilteredCubeMap32 = this.cubeMaps[3];
material.prefilteredCubeMap16 = this.cubeMaps[4];
material.prefilteredCubeMap8 = this.cubeMaps[5];
material.prefilteredCubeMap4 = this.cubeMaps[6];
material.cubeMapProjection = pc.CUBEPROJ_BOX;
//material.cubeMapProjectionBox = new pc.BoundingBox (new pc.Vec3(0,2,0), new pc.Vec3(2,2,2));
material.update(); // update material
meshes[i].material = material; // overwrite orignal material with the "new" (cloned) material
// meshes[i].material.update();
}
in this example we can see that useSkybox is false but the material still renders it.
i am using
this.entity.parent.model.meshInstances;
because the entity is a childrem of the room that renders the cubemap.
If anyone wants to take a look inside, i can add them to the project.