|
@@ -79,6 +79,7 @@ var BABYLON;
|
|
this.BonesPerMesh = 0;
|
|
this.BonesPerMesh = 0;
|
|
this.INSTANCES = false;
|
|
this.INSTANCES = false;
|
|
this.GLOSSINESS = false;
|
|
this.GLOSSINESS = false;
|
|
|
|
+ this.ROUGHNESS = false;
|
|
this._keys = Object.keys(this);
|
|
this._keys = Object.keys(this);
|
|
}
|
|
}
|
|
StandardMaterialDefines.prototype.isEqual = function (other) {
|
|
StandardMaterialDefines.prototype.isEqual = function (other) {
|
|
@@ -135,6 +136,7 @@ var BABYLON;
|
|
this.useAlphaFromDiffuseTexture = false;
|
|
this.useAlphaFromDiffuseTexture = false;
|
|
this.useSpecularOverAlpha = true;
|
|
this.useSpecularOverAlpha = true;
|
|
this.fogEnabled = true;
|
|
this.fogEnabled = true;
|
|
|
|
+ this.roughness = 0;
|
|
this.useGlossinessFromSpecularMapAlpha = false;
|
|
this.useGlossinessFromSpecularMapAlpha = false;
|
|
this._renderTargets = new BABYLON.SmartArray(16);
|
|
this._renderTargets = new BABYLON.SmartArray(16);
|
|
this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
|
|
this._worldViewProjectionMatrix = BABYLON.Matrix.Zero();
|
|
@@ -221,6 +223,9 @@ var BABYLON;
|
|
needNormals = true;
|
|
needNormals = true;
|
|
needUVs = true;
|
|
needUVs = true;
|
|
this._defines.REFLECTION = true;
|
|
this._defines.REFLECTION = true;
|
|
|
|
+ if (this.roughness > 0) {
|
|
|
|
+ this._defines.ROUGHNESS = true;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.emissiveTexture && StandardMaterial.EmissiveTextureEnabled) {
|
|
if (this.emissiveTexture && StandardMaterial.EmissiveTextureEnabled) {
|
|
@@ -489,7 +494,8 @@ var BABYLON;
|
|
"mBones",
|
|
"mBones",
|
|
"vClipPlane", "diffuseMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "specularMatrix", "bumpMatrix",
|
|
"vClipPlane", "diffuseMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "specularMatrix", "bumpMatrix",
|
|
"shadowsInfo0", "shadowsInfo1", "shadowsInfo2", "shadowsInfo3",
|
|
"shadowsInfo0", "shadowsInfo1", "shadowsInfo2", "shadowsInfo3",
|
|
- "diffuseLeftColor", "diffuseRightColor", "opacityParts", "reflectionLeftColor", "reflectionRightColor", "emissiveLeftColor", "emissiveRightColor"
|
|
|
|
|
|
+ "diffuseLeftColor", "diffuseRightColor", "opacityParts", "reflectionLeftColor", "reflectionRightColor", "emissiveLeftColor", "emissiveRightColor",
|
|
|
|
+ "roughness"
|
|
], ["diffuseSampler", "ambientSampler", "opacitySampler", "reflectionCubeSampler", "reflection2DSampler", "emissiveSampler", "specularSampler", "bumpSampler",
|
|
], ["diffuseSampler", "ambientSampler", "opacitySampler", "reflectionCubeSampler", "reflection2DSampler", "emissiveSampler", "specularSampler", "bumpSampler",
|
|
"shadowSampler0", "shadowSampler1", "shadowSampler2", "shadowSampler3"
|
|
"shadowSampler0", "shadowSampler1", "shadowSampler2", "shadowSampler3"
|
|
], join, fallbacks, this.onCompiled, this.onError);
|
|
], join, fallbacks, this.onCompiled, this.onError);
|
|
@@ -557,6 +563,9 @@ var BABYLON;
|
|
if (this.reflectionTexture && StandardMaterial.ReflectionTextureEnabled) {
|
|
if (this.reflectionTexture && StandardMaterial.ReflectionTextureEnabled) {
|
|
if (this.reflectionTexture.isCube) {
|
|
if (this.reflectionTexture.isCube) {
|
|
this._effect.setTexture("reflectionCubeSampler", this.reflectionTexture);
|
|
this._effect.setTexture("reflectionCubeSampler", this.reflectionTexture);
|
|
|
|
+ if (this._defines.ROUGHNESS) {
|
|
|
|
+ this._effect.setFloat("roughness", this.roughness);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
this._effect.setTexture("reflection2DSampler", this.reflectionTexture);
|
|
this._effect.setTexture("reflection2DSampler", this.reflectionTexture);
|