Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-04-17 18:47:58 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-04-17 18:47:58 +0400
commitcf0e457e524cfc9f496705de6cbf1e41c5118828 (patch)
tree55008245844f7c617ee5fe6e113a775778acb4b0 /intern/cycles/kernel/svm/svm_image.h
parent0fc4f4b7916aaec09228a54fac16b9618c192f6a (diff)
Fix #35004: fireflies with .tif image in cycles, try to avoid extreme values when
openimageio can't detect premul/straight alpha correct.
Diffstat (limited to 'intern/cycles/kernel/svm/svm_image.h')
-rw-r--r--intern/cycles/kernel/svm/svm_image.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/intern/cycles/kernel/svm/svm_image.h b/intern/cycles/kernel/svm/svm_image.h
index b2f20366573..c7551a72638 100644
--- a/intern/cycles/kernel/svm/svm_image.h
+++ b/intern/cycles/kernel/svm/svm_image.h
@@ -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) {