Hi, I just found the error in running following script, (running under version 2.10)
ApplyTexture.prototype.postInitialize = function () {
var layer = this.app.scene.layers.getLayerByName(this.layerName);
if (layer !== null) {
// get the instance this script is attached to
var portal = this.entity;
// create a new material
var material = new pc.StandardMaterial();
portal.render.material = material;
console.log('layer.renderTarget is ', layer.renderTarget);
material.diffuseMap = layer.renderTarget.colorBuffer;
material.update();
};
};
How could I resolve this problem in ver 2.x?
thanks a lot
