|
@@ -17,6 +17,9 @@ var BABYLON = BABYLON || {};
|
|
|
|
|
|
// Darkness
|
|
// Darkness
|
|
this._darkness = 0.;
|
|
this._darkness = 0.;
|
|
|
|
+
|
|
|
|
+ // Darkness
|
|
|
|
+ this._transparencyShadow = false;
|
|
|
|
|
|
// Custom render function
|
|
// Custom render function
|
|
var that = this;
|
|
var that = this;
|
|
@@ -45,7 +48,7 @@ var BABYLON = BABYLON || {};
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
- this._shadowMap.customRenderFunction = function (opaqueSubMeshes, alphaTestSubMeshes) {
|
|
|
|
|
|
+ this._shadowMap.customRenderFunction = function (opaqueSubMeshes, alphaTestSubMeshes, transparentSubMeshes) {
|
|
var index;
|
|
var index;
|
|
|
|
|
|
for (index = 0; index < opaqueSubMeshes.length; index++) {
|
|
for (index = 0; index < opaqueSubMeshes.length; index++) {
|
|
@@ -55,6 +58,12 @@ var BABYLON = BABYLON || {};
|
|
for (index = 0; index < alphaTestSubMeshes.length; index++) {
|
|
for (index = 0; index < alphaTestSubMeshes.length; index++) {
|
|
renderSubMesh(alphaTestSubMeshes.data[index]);
|
|
renderSubMesh(alphaTestSubMeshes.data[index]);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if (that._transparencyShadow) {
|
|
|
|
+ for (index = 0; index < transparentSubMeshes.length; index++) {
|
|
|
|
+ renderSubMesh(transparentSubMeshes.data[index]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
};
|
|
};
|
|
|
|
|
|
// Internals
|
|
// Internals
|
|
@@ -142,6 +151,10 @@ var BABYLON = BABYLON || {};
|
|
this._darkness = darkness;
|
|
this._darkness = darkness;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ BABYLON.ShadowGenerator.prototype.setTransparencyShadow = function (hasShadow) {
|
|
|
|
+ this._transparencyShadow = hasShadow;
|
|
|
|
+ };
|
|
|
|
+
|
|
BABYLON.ShadowGenerator.prototype.dispose = function() {
|
|
BABYLON.ShadowGenerator.prototype.dispose = function() {
|
|
this._shadowMap.dispose();
|
|
this._shadowMap.dispose();
|
|
};
|
|
};
|