|
@@ -212,15 +212,12 @@ module BABYLON {
|
|
|
protected _renderId: number;
|
|
|
|
|
|
protected _defines = new StandardMaterialDefines();
|
|
|
- protected _cachedDefines = new StandardMaterialDefines();
|
|
|
|
|
|
protected _useLogarithmicDepth: boolean;
|
|
|
|
|
|
constructor(name: string, scene: Scene) {
|
|
|
super(name, scene);
|
|
|
|
|
|
- this._cachedDefines.BonesPerMesh = -1;
|
|
|
-
|
|
|
this.getRenderTargetTextures = (): SmartArray<RenderTargetTexture> => {
|
|
|
this._renderTargets.reset();
|
|
|
|
|
@@ -294,8 +291,6 @@ module BABYLON {
|
|
|
var needUVs = false;
|
|
|
var needNormals = false;
|
|
|
|
|
|
- this._defines.reset();
|
|
|
-
|
|
|
// Lights
|
|
|
if (scene.lightsEnabled && !this.disableLighting) {
|
|
|
needNormals = MaterialHelper.PrepareDefinesForLights(scene, mesh, this._defines, this.maxSimultaneousLights);
|
|
@@ -590,9 +585,7 @@ module BABYLON {
|
|
|
}
|
|
|
|
|
|
// Get correct effect
|
|
|
- if (!this._defines.isEqual(this._cachedDefines)) {
|
|
|
- this._defines.cloneTo(this._cachedDefines);
|
|
|
-
|
|
|
+ if (this._defines._isDirty) {
|
|
|
scene.resetCachedMaterial();
|
|
|
|
|
|
// Fallbacks
|