From 3945979f2b69b2f73f41c0f59b6a40ab13e4a56c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 12 Dec 2012 09:17:21 +0000 Subject: [PATCH] Fix #33486: cycles CPU image textures were offset wrong by half a pixel compared to OpenGL/CUDA/OSL rendering. --- intern/cycles/kernel/kernel_compat_cpu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intern/cycles/kernel/kernel_compat_cpu.h b/intern/cycles/kernel/kernel_compat_cpu.h index 45f653a686c..01bb78e8e1c 100644 --- a/intern/cycles/kernel/kernel_compat_cpu.h +++ b/intern/cycles/kernel/kernel_compat_cpu.h @@ -112,8 +112,8 @@ template struct texture_image { return make_float4(0.0f, 0.0f, 0.0f, 0.0f); int ix, iy, nix, niy; - float tx = frac(x*width, &ix); - float ty = frac(y*height, &iy); + float tx = frac(x*width - 0.5f, &ix); + float ty = frac(y*height - 0.5f, &iy); if(periodic) { ix = wrap_periodic(ix, width);