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

This commit is contained in:
Remy 2019-06-26 18:26:28 +02:00 committed by Stephen Gold
parent eb5d0bea2a
commit 8f3feb8012
2 changed files with 4 additions and 2 deletions

View File

@ -143,7 +143,8 @@ public class TextureBlenderAWT extends AbstractTextureBlender {
dataArray.add(newData); 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) { if (image.getMipMapSizes() != null) {
result.setMipMapSizes(image.getMipMapSizes().clone()); result.setMipMapSizes(image.getMipMapSizes().clone());
} }

View File

@ -529,9 +529,10 @@ public class Material implements CloneableSmartAsset, Cloneable, Savable {
MatParamTexture val = getTextureParam(name); MatParamTexture val = getTextureParam(name);
if (val == null) { if (val == null) {
checkTextureParamColorSpace(name, value); 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 { } else {
val.setTextureValue(value); val.setTextureValue(value);
val.setColorSpace(value.getImage() != null ? value.getImage().getColorSpace() : null);
} }
if (technique != null) { if (technique != null) {