diff options
author | Ethan-Hall <Ethan1080> | 2022-03-10 13:36:16 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-03-10 13:38:08 +0300 |
commit | 34d8ef8fa47f38e44088f34338d9dc7b126bce1c (patch) | |
tree | 1a39b55af10e377542f06e8bf5197caa37623267 /source/blender | |
parent | 7b62203fc794b5facda195bccea5981b54256044 (diff) |
Fix: closest image texture interpolation inconsistent in geometry nodes
The `-0.5f` offset is inconsistent with shader nodes.
See D14235 for an example file.
Differential Revision: https://developer.blender.org/D14235
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_image_texture.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_image_texture.cc b/source/blender/nodes/geometry/nodes/node_geo_image_texture.cc index a87aef358e1..33802d00d2b 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_image_texture.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_image_texture.cc @@ -257,8 +257,8 @@ class ImageFieldsFunction : public fn::MultiFunction { const int width = ibuf->x; const int height = ibuf->y; int ix, iy; - const float tx = frac(px * (float)width - 0.5f, &ix); - const float ty = frac(py * (float)height - 0.5f, &iy); + const float tx = frac(px * (float)width, &ix); + const float ty = frac(py * (float)height, &iy); switch (extension) { case SHD_IMAGE_EXTENSION_REPEAT: { |