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
This commit is contained in:
parent
7b62203fc7
commit
34d8ef8fa4
|
@ -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: {
|
||||
|
|
Loading…
Reference in New Issue