@babylonjs/core 5.31.0 → 5.31.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -838,7 +838,7 @@ export class ShadowGenerator {
838
838
  effect.setMatrix("diffuseMatrix", opacityTexture.getTextureMatrix() || this._defaultTextureMatrix);
839
839
  }
840
840
  }
841
- else if (material && material.needAlphaTesting()) {
841
+ else if (material && (material.needAlphaTesting() || material.needAlphaBlending())) {
842
842
  const alphaTexture = material.getAlphaTestTexture();
843
843
  if (alphaTexture) {
844
844
  effect.setTexture("diffuseSampler", alphaTexture);
@@ -1035,7 +1035,9 @@ export class ShadowGenerator {
1035
1035
  }
1036
1036
  }
1037
1037
  // Alpha test
1038
- if (material && material.needAlphaTesting()) {
1038
+ const needAlphaTesting = material === null || material === void 0 ? void 0 : material.needAlphaTesting();
1039
+ const needAlphaBlending = material === null || material === void 0 ? void 0 : material.needAlphaBlending();
1040
+ if (material && (needAlphaTesting || needAlphaBlending)) {
1039
1041
  let alphaTexture = null;
1040
1042
  if (this.useOpacityTextureForTransparentShadow) {
1041
1043
  alphaTexture = material.opacityTexture;
@@ -1048,8 +1050,10 @@ export class ShadowGenerator {
1048
1050
  return false;
1049
1051
  }
1050
1052
  const alphaCutOff = (_a = material.alphaCutOff) !== null && _a !== void 0 ? _a : ShadowGenerator.DEFAULT_ALPHA_CUTOFF;
1051
- defines.push("#define ALPHATEST");
1052
- defines.push(`#define ALPHATESTVALUE ${alphaCutOff}${alphaCutOff % 1 === 0 ? "." : ""}`);
1053
+ defines.push("#define ALPHATEXTURE");
1054
+ if (needAlphaTesting) {
1055
+ defines.push(`#define ALPHATESTVALUE ${alphaCutOff}${alphaCutOff % 1 === 0 ? "." : ""}`);
1056
+ }
1053
1057
  if (mesh.isVerticesDataPresent(VertexBuffer.UVKind)) {
1054
1058
  attribs.push(VertexBuffer.UVKind);
1055
1059
  defines.push("#define UV1");