|
@@ -95,6 +95,7 @@ var BABYLON;
|
|
this.DIFFUSEFRESNEL = false;
|
|
this.DIFFUSEFRESNEL = false;
|
|
this.OPACITYFRESNEL = false;
|
|
this.OPACITYFRESNEL = false;
|
|
this.REFLECTIONFRESNEL = false;
|
|
this.REFLECTIONFRESNEL = false;
|
|
|
|
+ this.REFRACTIONFRESNEL = false;
|
|
this.EMISSIVEFRESNEL = false;
|
|
this.EMISSIVEFRESNEL = false;
|
|
this.FRESNEL = false;
|
|
this.FRESNEL = false;
|
|
this.NORMAL = false;
|
|
this.NORMAL = false;
|
|
@@ -505,6 +506,7 @@ var BABYLON;
|
|
if (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled ||
|
|
if (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled ||
|
|
this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled ||
|
|
this.opacityFresnelParameters && this.opacityFresnelParameters.isEnabled ||
|
|
this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled ||
|
|
this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled ||
|
|
|
|
+ this.refractionFresnelParameters && this.refractionFresnelParameters.isEnabled ||
|
|
this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled) {
|
|
this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled) {
|
|
if (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled) {
|
|
if (this.diffuseFresnelParameters && this.diffuseFresnelParameters.isEnabled) {
|
|
this._defines.DIFFUSEFRESNEL = true;
|
|
this._defines.DIFFUSEFRESNEL = true;
|
|
@@ -515,6 +517,9 @@ var BABYLON;
|
|
if (this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled) {
|
|
if (this.reflectionFresnelParameters && this.reflectionFresnelParameters.isEnabled) {
|
|
this._defines.REFLECTIONFRESNEL = true;
|
|
this._defines.REFLECTIONFRESNEL = true;
|
|
}
|
|
}
|
|
|
|
+ if (this.refractionFresnelParameters && this.refractionFresnelParameters.isEnabled) {
|
|
|
|
+ this._defines.REFRACTIONFRESNEL = true;
|
|
|
|
+ }
|
|
if (this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled) {
|
|
if (this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled) {
|
|
this._defines.EMISSIVEFRESNEL = true;
|
|
this._defines.EMISSIVEFRESNEL = true;
|
|
}
|
|
}
|
|
@@ -662,7 +667,7 @@ var BABYLON;
|
|
"mBones",
|
|
"mBones",
|
|
"vClipPlane", "diffuseMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "specularMatrix", "bumpMatrix", "lightmapMatrix",
|
|
"vClipPlane", "diffuseMatrix", "ambientMatrix", "opacityMatrix", "reflectionMatrix", "emissiveMatrix", "specularMatrix", "bumpMatrix", "lightmapMatrix",
|
|
"shadowsInfo0", "shadowsInfo1", "shadowsInfo2", "shadowsInfo3", "depthValues",
|
|
"shadowsInfo0", "shadowsInfo1", "shadowsInfo2", "shadowsInfo3", "depthValues",
|
|
- "diffuseLeftColor", "diffuseRightColor", "opacityParts", "reflectionLeftColor", "reflectionRightColor", "emissiveLeftColor", "emissiveRightColor",
|
|
|
|
|
|
+ "diffuseLeftColor", "diffuseRightColor", "opacityParts", "reflectionLeftColor", "reflectionRightColor", "emissiveLeftColor", "emissiveRightColor", "refractionLeftColor", "refractionRightColor",
|
|
"logarithmicDepthConstant"
|
|
"logarithmicDepthConstant"
|
|
], ["diffuseSampler", "ambientSampler", "opacitySampler", "reflectionCubeSampler", "reflection2DSampler", "emissiveSampler", "specularSampler", "bumpSampler", "lightmapSampler", "refractionSampler",
|
|
], ["diffuseSampler", "ambientSampler", "opacitySampler", "reflectionCubeSampler", "reflection2DSampler", "emissiveSampler", "specularSampler", "bumpSampler", "lightmapSampler", "refractionSampler",
|
|
"shadowSampler0", "shadowSampler1", "shadowSampler2", "shadowSampler3"
|
|
"shadowSampler0", "shadowSampler1", "shadowSampler2", "shadowSampler3"
|
|
@@ -713,6 +718,10 @@ var BABYLON;
|
|
this._effect.setColor4("reflectionLeftColor", this.reflectionFresnelParameters.leftColor, this.reflectionFresnelParameters.power);
|
|
this._effect.setColor4("reflectionLeftColor", this.reflectionFresnelParameters.leftColor, this.reflectionFresnelParameters.power);
|
|
this._effect.setColor4("reflectionRightColor", this.reflectionFresnelParameters.rightColor, this.reflectionFresnelParameters.bias);
|
|
this._effect.setColor4("reflectionRightColor", this.reflectionFresnelParameters.rightColor, this.reflectionFresnelParameters.bias);
|
|
}
|
|
}
|
|
|
|
+ if (this.refractionFresnelParameters && this.refractionFresnelParameters.isEnabled) {
|
|
|
|
+ this._effect.setColor4("refractionLeftColor", this.refractionFresnelParameters.leftColor, this.refractionFresnelParameters.power);
|
|
|
|
+ this._effect.setColor4("refractionRightColor", this.refractionFresnelParameters.rightColor, this.refractionFresnelParameters.bias);
|
|
|
|
+ }
|
|
if (this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled) {
|
|
if (this.emissiveFresnelParameters && this.emissiveFresnelParameters.isEnabled) {
|
|
this._effect.setColor4("emissiveLeftColor", this.emissiveFresnelParameters.leftColor, this.emissiveFresnelParameters.power);
|
|
this._effect.setColor4("emissiveLeftColor", this.emissiveFresnelParameters.leftColor, this.emissiveFresnelParameters.power);
|
|
this._effect.setColor4("emissiveRightColor", this.emissiveFresnelParameters.rightColor, this.emissiveFresnelParameters.bias);
|
|
this._effect.setColor4("emissiveRightColor", this.emissiveFresnelParameters.rightColor, this.emissiveFresnelParameters.bias);
|
|
@@ -925,6 +934,9 @@ var BABYLON;
|
|
if (this.reflectionFresnelParameters && this.reflectionFresnelParameters.clone) {
|
|
if (this.reflectionFresnelParameters && this.reflectionFresnelParameters.clone) {
|
|
newStandardMaterial.reflectionFresnelParameters = this.reflectionFresnelParameters.clone();
|
|
newStandardMaterial.reflectionFresnelParameters = this.reflectionFresnelParameters.clone();
|
|
}
|
|
}
|
|
|
|
+ if (this.refractionFresnelParameters && this.refractionFresnelParameters.clone) {
|
|
|
|
+ newStandardMaterial.refractionFresnelParameters = this.refractionFresnelParameters.clone();
|
|
|
|
+ }
|
|
if (this.opacityFresnelParameters && this.opacityFresnelParameters.clone) {
|
|
if (this.opacityFresnelParameters && this.opacityFresnelParameters.clone) {
|
|
newStandardMaterial.opacityFresnelParameters = this.opacityFresnelParameters.clone();
|
|
newStandardMaterial.opacityFresnelParameters = this.opacityFresnelParameters.clone();
|
|
}
|
|
}
|
|
@@ -960,6 +972,9 @@ var BABYLON;
|
|
if (this.reflectionFresnelParameters) {
|
|
if (this.reflectionFresnelParameters) {
|
|
serializationObject.reflectionFresnelParameters = this.reflectionFresnelParameters.serialize();
|
|
serializationObject.reflectionFresnelParameters = this.reflectionFresnelParameters.serialize();
|
|
}
|
|
}
|
|
|
|
+ if (this.refractionFresnelParameters) {
|
|
|
|
+ serializationObject.refractionFresnelParameters = this.refractionFresnelParameters.serialize();
|
|
|
|
+ }
|
|
if (this.emissiveTexture) {
|
|
if (this.emissiveTexture) {
|
|
serializationObject.emissiveTexture = this.emissiveTexture.serialize();
|
|
serializationObject.emissiveTexture = this.emissiveTexture.serialize();
|
|
}
|
|
}
|
|
@@ -1019,6 +1034,9 @@ var BABYLON;
|
|
if (source.reflectionFresnelParameters) {
|
|
if (source.reflectionFresnelParameters) {
|
|
material.reflectionFresnelParameters = FresnelParameters.Parse(source.reflectionFresnelParameters);
|
|
material.reflectionFresnelParameters = FresnelParameters.Parse(source.reflectionFresnelParameters);
|
|
}
|
|
}
|
|
|
|
+ if (source.refractionFresnelParameters) {
|
|
|
|
+ material.refractionFresnelParameters = FresnelParameters.Parse(source.refractionFresnelParameters);
|
|
|
|
+ }
|
|
if (source.emissiveTexture) {
|
|
if (source.emissiveTexture) {
|
|
material.emissiveTexture = BABYLON.Texture.Parse(source.emissiveTexture, scene, rootUrl);
|
|
material.emissiveTexture = BABYLON.Texture.Parse(source.emissiveTexture, scene, rootUrl);
|
|
}
|
|
}
|