This commit is contained in:
jerrywwl
2019-04-02 16:37:20 +08:00
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -249,7 +249,9 @@ export class Material extends Asset {
pass.bindTextureView(binding, val);
} else {
const textureView = val.getGFXTextureView();
if (!textureView) { console.warn('texture asset incomplete!'); return false; }
if (!textureView || !textureView.texture.width || !textureView.texture.height) {
console.warn('texture asset incomplete!'); return false;
}
pass.bindTextureView(binding, textureView);
pass.bindSampler(binding, samplerLib.getSampler(cc.game._gfxDevice, val.getGFXSamplerInfo()));
}
+1 -1
View File
@@ -326,7 +326,7 @@ export class TextureBase extends EventTargetFactory(Asset) {
*/
public setMipFilter (mipFilter: Filter) {
this._mipFilter = mipFilter; this._samplerInfo[SamplerInfoIndex.mipFilter] = mipFilter;
this._samplerInfo[SamplerInfoIndex.maxLOD] = mipFilter === Filter.NONE ? 0 : 1000;
this._samplerInfo[SamplerInfoIndex.maxLOD] = mipFilter === Filter.NONE ? 0 : 1000; // WebGL2 on some platform need this
}
/**