[]我想动态改自定义shader里的值,应该怎么写??
我想动态改自定义shader里的值,
CustomMaterial.js应该怎么写??我这样写set的时候报错
Uncaught TypeError: this._setValue is not a function at CustomMaterial.setAlphaTestValue (CustomMaterial.js:34) at LayaAir3D.js:94CustomMaterial.setAlphaTestValue @ CustomMaterial.js:34
(anonymous)
CustomMaterial.js应该怎么写??我这样写set的时候报错
Uncaught TypeError: this._setValue is not a function at CustomMaterial.setAlphaTestValue (CustomMaterial.js:34) at LayaAir3D.js:94CustomMaterial.setAlphaTestValue @ CustomMaterial.js:34
(anonymous)
function CustomMaterial() {
CustomMaterial.__super.call(this);
this.setShaderName("CustomShader");
}
Laya.class(CustomMaterial, "CustomMaterial", Laya.BaseMaterial);
CustomMaterial.DIFFUSETEXTURE = 1;
CustomMaterial.NORMALTEXTURE = 2;
CustomMaterial.ALPHATESTVALUE = 0;
CustomMaterial.prototype.getDiffuseTexture = function () {
return this._getTexture(CustomMaterial.DIFFUSETEXTURE);
}
CustomMaterial.prototype.setDiffuseTexture = function (value) {
this._setTexture(CustomMaterial.DIFFUSETEXTURE,value);
}
CustomMaterial.prototype.getNormalTexture = function () {
return this._getTexture(CustomMaterial.NORMALTEXTURE);
}
CustomMaterial.prototype.setNormalTexture = function (value) {
this._setTexture(CustomMaterial.NORMALTEXTURE,value);
}
CustomMaterial.prototype.getAlphaTestValue = function () {
return this._getValue(CustomMaterial.ALPHATESTVALUE);
}
CustomMaterial.prototype.setAlphaTestValue = function (value) {
this._setValue(CustomMaterial.ALPHATESTVALUE,value);
}
没有找到相关结果
已邀请:
要回复问题请先登录
2 个回复
ebaww
赞同来自: cuixueying
Monica - 知识达人
赞同来自: