Skip to content

Commit

Permalink
Prevent overwrite of the material's default texture
Browse files Browse the repository at this point in the history
  • Loading branch information
Janine Liu committed Jul 1, 2021
1 parent 494d780 commit ec9422d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Source/Scene/Material.js
Original file line number Diff line number Diff line change
Expand Up @@ -860,10 +860,14 @@ function createTexture2DUpdateFunction(uniformId) {

if (!defined(texture)) {
material._texturePaths[uniformId] = undefined;
if (uniformValueIsDefaultImage || !defined(material._defaultTexture)) {
if (!defined(material._defaultTexture)) {
material._defaultTexture = context.defaultTexture;
}
texture = material._textures[uniformId] = material._defaultTexture;
if (uniformValueIsDefaultImage) {
texture = material._textures[uniformId] = context.defaultTexture;
} else {
texture = material._textures[uniformId] = material._defaultTexture;
}

uniformDimensionsName = uniformId + "Dimensions";
if (uniforms.hasOwnProperty(uniformDimensionsName)) {
Expand Down

0 comments on commit ec9422d

Please sign in to comment.