[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52915] trunk/blender/intern/cycles/kernel /kernel_compat_cpu.h: Fix #33486: cycles CPU image textures were offset wrong by half a pixel compared

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Dec 12 10:17:22 CET 2012


Revision: 52915
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52915
Author:   blendix
Date:     2012-12-12 09:17:21 +0000 (Wed, 12 Dec 2012)
Log Message:
-----------
Fix #33486: cycles CPU image textures were offset wrong by half a pixel compared
to OpenGL/CUDA/OSL rendering.

Modified Paths:
--------------
    trunk/blender/intern/cycles/kernel/kernel_compat_cpu.h

Modified: trunk/blender/intern/cycles/kernel/kernel_compat_cpu.h
===================================================================
--- trunk/blender/intern/cycles/kernel/kernel_compat_cpu.h	2012-12-12 07:31:22 UTC (rev 52914)
+++ trunk/blender/intern/cycles/kernel/kernel_compat_cpu.h	2012-12-12 09:17:21 UTC (rev 52915)
@@ -112,8 +112,8 @@
 			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);




More information about the Bf-blender-cvs mailing list