|
@@ -1,5 +1,5 @@
|
|
|
-module BABYLON {
|
|
|
- class StandardMaterialDefines extends MaterialDefines {
|
|
|
+module BABYLON {
|
|
|
+ export class StandardMaterialDefines extends MaterialDefines {
|
|
|
public DIFFUSE = false;
|
|
|
public AMBIENT = false;
|
|
|
public OPACITY = false;
|
|
@@ -24,7 +24,6 @@
|
|
|
public EMISSIVEFRESNEL = false;
|
|
|
public FRESNEL = false;
|
|
|
public NORMAL = false;
|
|
|
- public TANGENT = false;
|
|
|
public UV1 = false;
|
|
|
public UV2 = false;
|
|
|
public VERTEXCOLOR = false;
|
|
@@ -199,15 +198,15 @@
|
|
|
@serializeAsColorCurves()
|
|
|
public cameraColorCurves: ColorCurves = null;
|
|
|
|
|
|
- private _renderTargets = new SmartArray<RenderTargetTexture>(16);
|
|
|
- private _worldViewProjectionMatrix = Matrix.Zero();
|
|
|
- private _globalAmbientColor = new Color3(0, 0, 0);
|
|
|
- private _renderId: number;
|
|
|
+ protected _renderTargets = new SmartArray<RenderTargetTexture>(16);
|
|
|
+ protected _worldViewProjectionMatrix = Matrix.Zero();
|
|
|
+ protected _globalAmbientColor = new Color3(0, 0, 0);
|
|
|
+ protected _renderId: number;
|
|
|
|
|
|
- private _defines = new StandardMaterialDefines();
|
|
|
- private _cachedDefines = new StandardMaterialDefines();
|
|
|
+ protected _defines = new StandardMaterialDefines();
|
|
|
+ protected _cachedDefines = new StandardMaterialDefines();
|
|
|
|
|
|
- private _useLogarithmicDepth: boolean;
|
|
|
+ protected _useLogarithmicDepth: boolean;
|
|
|
|
|
|
constructor(name: string, scene: Scene) {
|
|
|
super(name, scene);
|
|
@@ -250,7 +249,7 @@
|
|
|
return this.diffuseTexture != null && this.diffuseTexture.hasAlpha;
|
|
|
}
|
|
|
|
|
|
- private _shouldUseAlphaFromDiffuseTexture(): boolean {
|
|
|
+ protected _shouldUseAlphaFromDiffuseTexture(): boolean {
|
|
|
return this.diffuseTexture != null && this.diffuseTexture.hasAlpha && this.useAlphaFromDiffuseTexture;
|
|
|
}
|
|
|
|
|
@@ -259,7 +258,7 @@
|
|
|
}
|
|
|
|
|
|
// Methods
|
|
|
- private _checkCache(scene: Scene, mesh?: AbstractMesh, useInstances?: boolean): boolean {
|
|
|
+ protected _checkCache(scene: Scene, mesh?: AbstractMesh, useInstances?: boolean): boolean {
|
|
|
if (!mesh) {
|
|
|
return true;
|
|
|
}
|
|
@@ -548,9 +547,6 @@
|
|
|
if (mesh) {
|
|
|
if (needNormals && mesh.isVerticesDataPresent(VertexBuffer.NormalKind)) {
|
|
|
this._defines.NORMAL = true;
|
|
|
- if (mesh.isVerticesDataPresent(VertexBuffer.TangentKind)) {
|
|
|
- this._defines.TANGENT = true;
|
|
|
- }
|
|
|
}
|
|
|
if (needUVs) {
|
|
|
if (mesh.isVerticesDataPresent(VertexBuffer.UVKind)) {
|
|
@@ -655,10 +651,6 @@
|
|
|
attribs.push(VertexBuffer.NormalKind);
|
|
|
}
|
|
|
|
|
|
- if (this._defines.TANGENT) {
|
|
|
- attribs.push(VertexBuffer.TangentKind);
|
|
|
- }
|
|
|
-
|
|
|
if (this._defines.UV1) {
|
|
|
attribs.push(VertexBuffer.UVKind);
|
|
|
}
|
|
@@ -995,8 +987,6 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- this._renderTargets.dispose();
|
|
|
-
|
|
|
super.dispose(forceDisposeEffect, forceDisposeTextures);
|
|
|
}
|
|
|
|