|
@@ -98,15 +98,18 @@
|
|
|
protected applyCachedTexture(vertexData: VertexData, material: StandardMaterial) {
|
|
|
this._bindCacheTarget();
|
|
|
|
|
|
- var uv = vertexData.uvs;
|
|
|
- let nodeuv = this._renderableData._cacheNode.UVs;
|
|
|
- for (let i = 0; i < 4; i++) {
|
|
|
- uv[i * 2 + 0] = nodeuv[i].x;
|
|
|
- uv[i * 2 + 1] = nodeuv[i].y;
|
|
|
+ if (vertexData) {
|
|
|
+ var uv = vertexData.uvs;
|
|
|
+ let nodeuv = this._renderableData._cacheNode.UVs;
|
|
|
+ for (let i = 0; i < 4; i++) {
|
|
|
+ uv[i * 2 + 0] = nodeuv[i].x;
|
|
|
+ uv[i * 2 + 1] = nodeuv[i].y;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (material) {
|
|
|
+ material.diffuseTexture = this._renderableData._cacheTexture;
|
|
|
+ material.emissiveColor = new Color3(1, 1, 1);
|
|
|
}
|
|
|
-
|
|
|
- material.diffuseTexture = this._renderableData._cacheTexture;
|
|
|
- material.emissiveColor = new Color3(1, 1, 1);
|
|
|
this._renderableData._cacheTexture.hasAlpha = true;
|
|
|
this._unbindCacheTarget();
|
|
|
}
|
|
@@ -788,7 +791,9 @@
|
|
|
let cur = this.parent;
|
|
|
while (cur) {
|
|
|
if (cur instanceof Group2D && cur._isRenderableGroup) {
|
|
|
- cur._renderableData._childrenRenderableGroups.push(this);
|
|
|
+ if (cur._renderableData._childrenRenderableGroups.indexOf(this) === -1) {
|
|
|
+ cur._renderableData._childrenRenderableGroups.push(this);
|
|
|
+ }
|
|
|
break;
|
|
|
}
|
|
|
cur = cur.parent;
|
|
@@ -817,6 +822,9 @@
|
|
|
this._transparentSegments = new Array<TransparentSegment>();
|
|
|
this._firstChangedPrim = null;
|
|
|
this._transparentListChanged = false;
|
|
|
+ this._cacheNode = null;
|
|
|
+ this._cacheTexture = null;
|
|
|
+ this._cacheRenderSprite = null;
|
|
|
}
|
|
|
|
|
|
dispose() {
|