when the image object has a ColorSpace value we pass it on, else we leave it at the default value. fix for #1106 (#1110)

accellbaker
Remy 6 years ago committed by Stephen Gold
parent 23759820e5
commit adb88dcaeb
  1. 3
      jme3-blender/src/main/java/com/jme3/scene/plugins/blender/textures/blending/TextureBlenderAWT.java
  2. 3
      jme3-core/src/main/java/com/jme3/material/Material.java

@ -143,7 +143,8 @@ public class TextureBlenderAWT extends AbstractTextureBlender {
dataArray.add(newData);
}
Image result = depth > 1 ? new Image(Format.RGBA8, width, height, depth, dataArray, ColorSpace.Linear) : new Image(Format.RGBA8, width, height, dataArray.get(0), ColorSpace.Linear);
ColorSpace colorSpace = baseImage.getColorSpace() != null ? baseImage.getColorSpace() : ColorSpace.Linear;
Image result = depth > 1 ? new Image(Format.RGBA8, width, height, depth, dataArray, colorSpace) : new Image(Format.RGBA8, width, height, dataArray.get(0), colorSpace);
if (image.getMipMapSizes() != null) {
result.setMipMapSizes(image.getMipMapSizes().clone());
}

@ -537,9 +537,10 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable {
MatParamTexture val = getTextureParam(name);
if (val == null) {
checkTextureParamColorSpace(name, value);
paramValues.put(name, new MatParamTexture(type, name, value, null));
paramValues.put(name, new MatParamTexture(type, name, value, value.getImage() != null ? value.getImage().getColorSpace() : null));
} else {
val.setTextureValue(value);
val.setColorSpace(value.getImage() != null ? value.getImage().getColorSpace() : null);
}
if (technique != null) {

Loading…
Cancel
Save