Fix #33486: cycles CPU image textures were offset wrong by half a pixel compared

to OpenGL/CUDA/OSL rendering.
This commit is contained in:
Brecht Van Lommel
2012-12-12 09:17:21 +00:00
parent f06370dd44
commit 3945979f2b

View File

@@ -112,8 +112,8 @@ template<typename T> 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);