Commit: 29ce3dfeb6a8b0e85c477e7b917b50a6eaca8024
Author: Lukas Stockner
Date:   Tue Jun 21 00:49:25 2016 +0200
Branches: master
https://developer.blender.org/rB29ce3dfeb6a8b0e85c477e7b917b50a6eaca8024

Fix T48691: Cycles - OpenCL - HDR Image mapping does not match CUDA rendering

The OpenCL texture code didn't offset the coordinates by half a pixel like the 
CPU code does.

===================================================================

M       intern/cycles/kernel/svm/svm_image.h

===================================================================

diff --git a/intern/cycles/kernel/svm/svm_image.h 
b/intern/cycles/kernel/svm/svm_image.h
index 3d9ab40..aa9c07c 100644
--- a/intern/cycles/kernel/svm/svm_image.h
+++ b/intern/cycles/kernel/svm/svm_image.h
@@ -93,8 +93,8 @@ ccl_device float4 svm_image_texture(KernelGlobals *kg, int 
id, float x, float y,
                r = svm_image_texture_read(kg, id, offset + ix + iy*width);
        }
        else { /* We default to linear interpolation if it is not closest */
-               float tx = svm_image_texture_frac(x*width, &ix);
-               float ty = svm_image_texture_frac(y*height, &iy);
+               float tx = svm_image_texture_frac(x*width - 0.5f, &ix);
+               float ty = svm_image_texture_frac(y*height - 0.5f, &iy);
 
                if(periodic) {
                        ix = svm_image_texture_wrap_periodic(ix, width);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to