Skip to content

Commit

Permalink
Fix issue where unique texture map could get identical layout between…
Browse files Browse the repository at this point in the history
… two different texture sharing setups. (#4681)
  • Loading branch information
GSterbrant committed Sep 29, 2022
1 parent a3f0aff commit 43ce2af
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/scene/materials/standard-material-options-builder.js
Expand Up @@ -108,7 +108,6 @@ class StandardMaterialOptionsBuilder {
this._mapXForms = [];

const uniqueTextureMap = {};
this.uniqueTextureMappingCounter = 0;
for (const p in _matTex2D) {
this._updateTexOptions(options, stdMat, p, hasUv0, hasUv1, hasVcolor, minimalOptions, uniqueTextureMap);
}
Expand Down Expand Up @@ -358,9 +357,8 @@ class StandardMaterialOptionsBuilder {
const mapId = stdMat[mname].id;
let identifier = uniqueTextureMap[mapId];
if (identifier === undefined) {
uniqueTextureMap[mapId] = this.uniqueTextureMappingCounter;
identifier = this.uniqueTextureMappingCounter;
this.uniqueTextureMappingCounter++;
uniqueTextureMap[mapId] = p;
identifier = p;
}

options[mname] = !!stdMat[mname];
Expand Down

0 comments on commit 43ce2af

Please sign in to comment.