From 10645448290b43bc585c84a00b2b0b6fd17414f9 Mon Sep 17 00:00:00 2001 From: Yun Hsiao Wu Date: Fri, 25 Jan 2019 16:44:54 +0800 Subject: [PATCH] fix default material fallback --- cocos/3d/framework/model-component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos/3d/framework/model-component.ts b/cocos/3d/framework/model-component.ts index e21d23bb81..2063beb14c 100644 --- a/cocos/3d/framework/model-component.ts +++ b/cocos/3d/framework/model-component.ts @@ -233,10 +233,10 @@ export class ModelComponent extends RenderableComponent { if (this._model == null) { return; } - this._onRebuildPSO(idx, material); + this._onRebuildPSO(idx, material || this._getBuiltinMaterial()); } - protected _onRebuildPSO (idx, material) { + protected _onRebuildPSO (idx: number, material: Material) { if (this._model) { this._model.setSubModelMaterial(idx, material); }