Fixed constantly mipmap generation

Fixed bug when setting MinFilter with mipmapping after generating mipmaps causes jME to update image data every frame.
experimental
Rena4ka 11 years ago
parent 8d2b7a53e6
commit e250c47a08
  1. 4
      jme3-core/src/main/java/com/jme3/texture/Texture.java

@ -339,7 +339,7 @@ public abstract class Texture implements CloneableSmartAsset, Savable, Cloneable
"minificationFilter can not be null.");
}
this.minificationFilter = minificationFilter;
if (minificationFilter.usesMipMapLevels() && image != null && !image.isGeneratedMipmapsRequired()) {
if (minificationFilter.usesMipMapLevels() && image != null && !image.isGeneratedMipmapsRequired() && !image.hasMipmaps()) {
image.setNeedGeneratedMipmaps();
}
}
@ -631,4 +631,4 @@ public abstract class Texture implements CloneableSmartAsset, Savable, Cloneable
}
}
}

Loading…
Cancel
Save