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.
This commit is contained in:
Lukas Stockner 2016-06-21 00:49:25 +02:00
parent 93c6cf496e
commit 29ce3dfeb6
Notes: blender-bot 2023-02-14 07:49:03 +01:00
Referenced by issue #48691, Cycles - OpenCL - HDR Image mapping does not match CUDA rendering
1 changed files with 2 additions and 2 deletions

View File

@ -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);