Fix #35004: fireflies with .tif image in cycles, try to avoid extreme values when

openimageio can't detect premul/straight alpha correct.
This commit is contained in:
Brecht Van Lommel
2013-04-17 14:47:58 +00:00
parent 0fc4f4b791
commit cf0e457e52
4 changed files with 31 additions and 7 deletions

View File

@@ -93,6 +93,12 @@ __device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y, u
r.x *= invw;
r.y *= invw;
r.z *= invw;
if(id >= TEX_NUM_FLOAT_IMAGES) {
r.x = min(r.x, 1.0f);
r.y = min(r.y, 1.0f);
r.z = min(r.z, 1.0f);
}
}
if(srgb) {
@@ -234,6 +240,12 @@ __device float4 svm_image_texture(KernelGlobals *kg, int id, float x, float y, u
r.x *= invw;
r.y *= invw;
r.z *= invw;
if(id >= TEX_NUM_FLOAT_IMAGES) {
r.x = min(r.x, 1.0f);
r.y = min(r.y, 1.0f);
r.z = min(r.z, 1.0f);
}
}
if(srgb) {