|
@@ -456,7 +456,7 @@
|
|
|
emissiveTexture = (<any>material).emissiveTexture;
|
|
|
}
|
|
|
|
|
|
- if (this.isReady(subMesh, hardwareInstancedRendering, emissiveTexture)) {
|
|
|
+ if (this._isReady(subMesh, hardwareInstancedRendering, emissiveTexture)) {
|
|
|
engine.enableEffect(this._glowMapGenerationEffect);
|
|
|
mesh._bind(subMesh, this._glowMapGenerationEffect, Material.TriangleFillMode);
|
|
|
|
|
@@ -549,7 +549,31 @@
|
|
|
* @param emissiveTexture the associated emissive texture used to generate the glow
|
|
|
* @return true if ready otherwise, false
|
|
|
*/
|
|
|
- private isReady(subMesh: SubMesh, useInstances: boolean, emissiveTexture: Nullable<Texture>): boolean {
|
|
|
+ public isReady(subMesh: SubMesh, useInstances: boolean): boolean {
|
|
|
+ let material = subMesh.getMaterial();
|
|
|
+ let mesh = subMesh.getRenderingMesh();
|
|
|
+
|
|
|
+ if (!material || !mesh || !this._meshes) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ let emissiveTexture: Nullable<Texture> = null;
|
|
|
+ let highlightLayerMesh = this._meshes[mesh.uniqueId];
|
|
|
+
|
|
|
+ if (highlightLayerMesh && highlightLayerMesh.glowEmissiveOnly && material) {
|
|
|
+ emissiveTexture = (<any>material).emissiveTexture;
|
|
|
+ }
|
|
|
+ return this._isReady(subMesh, useInstances, emissiveTexture);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Checks for the readiness of the element composing the layer.
|
|
|
+ * @param subMesh the mesh to check for
|
|
|
+ * @param useInstances specify wether or not to use instances to render the mesh
|
|
|
+ * @param emissiveTexture the associated emissive texture used to generate the glow
|
|
|
+ * @return true if ready otherwise, false
|
|
|
+ */
|
|
|
+ private _isReady(subMesh: SubMesh, useInstances: boolean, emissiveTexture: Nullable<Texture>): boolean {
|
|
|
let material = subMesh.getMaterial();
|
|
|
|
|
|
if (!material) {
|