|
@@ -18,7 +18,7 @@ import { _DepthCullingState, _StencilState, _AlphaState } from "../States/index"
|
|
import { BaseTexture } from "../Materials/Textures/baseTexture";
|
|
import { BaseTexture } from "../Materials/Textures/baseTexture";
|
|
import { Texture } from "../Materials/Textures/texture";
|
|
import { Texture } from "../Materials/Textures/texture";
|
|
import { RenderTargetTexture } from "../Materials/Textures/renderTargetTexture";
|
|
import { RenderTargetTexture } from "../Materials/Textures/renderTargetTexture";
|
|
-import { Effect } from "../Materials/effect";
|
|
|
|
|
|
+import { Effect, EffectFallbacks } from "../Materials/effect";
|
|
import { Material } from "../Materials/material";
|
|
import { Material } from "../Materials/material";
|
|
import { MaterialHelper } from "../Materials/materialHelper";
|
|
import { MaterialHelper } from "../Materials/materialHelper";
|
|
import { Constants } from "../Engines/constants";
|
|
import { Constants } from "../Engines/constants";
|
|
@@ -468,6 +468,7 @@ export abstract class EffectLayer {
|
|
}
|
|
}
|
|
|
|
|
|
// Bones
|
|
// Bones
|
|
|
|
+ const fallbacks = new EffectFallbacks();
|
|
if (mesh.useBones && mesh.computeBonesUsingShaders) {
|
|
if (mesh.useBones && mesh.computeBonesUsingShaders) {
|
|
attribs.push(VertexBuffer.MatricesIndicesKind);
|
|
attribs.push(VertexBuffer.MatricesIndicesKind);
|
|
attribs.push(VertexBuffer.MatricesWeightsKind);
|
|
attribs.push(VertexBuffer.MatricesWeightsKind);
|
|
@@ -477,6 +478,9 @@ export abstract class EffectLayer {
|
|
}
|
|
}
|
|
defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers);
|
|
defines.push("#define NUM_BONE_INFLUENCERS " + mesh.numBoneInfluencers);
|
|
defines.push("#define BonesPerMesh " + (mesh.skeleton ? (mesh.skeleton.bones.length + 1) : 0));
|
|
defines.push("#define BonesPerMesh " + (mesh.skeleton ? (mesh.skeleton.bones.length + 1) : 0));
|
|
|
|
+ if (mesh.numBoneInfluencers > 0) {
|
|
|
|
+ fallbacks.addCPUSkinningFallback(0, mesh);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
defines.push("#define NUM_BONE_INFLUENCERS 0");
|
|
defines.push("#define NUM_BONE_INFLUENCERS 0");
|
|
}
|
|
}
|
|
@@ -489,7 +493,7 @@ export abstract class EffectLayer {
|
|
defines.push("#define MORPHTARGETS");
|
|
defines.push("#define MORPHTARGETS");
|
|
morphInfluencers = manager.numInfluencers;
|
|
morphInfluencers = manager.numInfluencers;
|
|
defines.push("#define NUM_MORPH_INFLUENCERS " + morphInfluencers);
|
|
defines.push("#define NUM_MORPH_INFLUENCERS " + morphInfluencers);
|
|
- MaterialHelper.PrepareAttributesForMorphTargets(attribs, mesh, { "NUM_MORPH_INFLUENCERS": morphInfluencers });
|
|
|
|
|
|
+ MaterialHelper.PrepareAttributesForMorphTargetsInfluencers(attribs, mesh, morphInfluencers);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -511,7 +515,7 @@ export abstract class EffectLayer {
|
|
"glowColor", "morphTargetInfluences",
|
|
"glowColor", "morphTargetInfluences",
|
|
"diffuseMatrix", "emissiveMatrix", "opacityMatrix", "opacityIntensity"],
|
|
"diffuseMatrix", "emissiveMatrix", "opacityMatrix", "opacityIntensity"],
|
|
["diffuseSampler", "emissiveSampler", "opacitySampler"], join,
|
|
["diffuseSampler", "emissiveSampler", "opacitySampler"], join,
|
|
- undefined, undefined, undefined, { maxSimultaneousMorphTargets: morphInfluencers });
|
|
|
|
|
|
+ fallbacks, undefined, undefined, { maxSimultaneousMorphTargets: morphInfluencers });
|
|
}
|
|
}
|
|
|
|
|
|
return this._effectLayerMapGenerationEffect.isReady();
|
|
return this._effectLayerMapGenerationEffect.isReady();
|